Page 1 of 1

Error with CRON

Posted: Thu Jun 25, 2015 9:27 am
by bullmoose20
Hello,

I am getting the following error on a regular basis. The CRON is running, but I get the following error:

504 Gateway Time-out
________________________________________
nginx/1.7.9

If I manually goto: http://www.speedylines.com/cake/zuluru/all/cron I will also get the timeout error. Then if I run it a second time, I get the following:
Rosters

No roster activity to report.

Attendance

attendance reminders sent

attendance summaries sent

Team Event Attendance

attendance reminders sent

attendance summaries sent

I am not sure what might be causing this or how to troubleshoot it. Since the system does not have any users in it yet, I guess its normal that there is no activity to report.

And just to be clear...for email reminders and emails to coaches on attendance, its the CRON that does this? Right now, I have the CRON setup to run twice a day. Is that enough?

Thanks,
NIck

Re: Error with CRON

Posted: Thu Jun 25, 2015 11:57 am
by GregS
I'll start with the easy part. Yes, this is the thing that will send out attendance reminders, as well as other regularly-scheduled system emails. Most (all?) other leagues have this run just once a day. My recommendation is to have it go at 1pm, on the theory that people just coming back from lunch will be most likely to have a couple free minutes to deal with such emails. Running it twice a day is fine, but depending on the times you choose, it is highly likely that the large majority of processing will be done in one of the runs and almost nothing in the other. Note that it's possible to run just some parts if you want, like leagues/cron to make sure leagues and divisions are opened/closed, games/cron for attendance, etc. You can see the list of what is done in controllers/all_controller.php.

Now, as to the error. The second time you run it, it is skipping everything because there is an entry in the locks table indicating that a cron is already running; running two at the same time would cause problems, so it blocks that. The entry is not removed because of some problem during the first run. If it ran successfully and did nothing, you'd see "0 attendance reminders sent" instead of "attendance reminders sent". (I should put error checking in there for this case, but it really never happens on fully functional systems, so it's been low priority.) For figuring out why it's crashing the first time, do you have debugging enabled? Are you running this on an nginx server? If not, why is there a gateway involved? Sounds like a configuration I haven't encountered before, so it may be something in that setup that's either not quite right, or not playing nicely with Zuluru.

Re: Error with CRON

Posted: Thu Jun 25, 2015 7:27 pm
by bullmoose20
Hello,

I am running at siteground.com so I am not sure what they are using...

That being said, I will turn on debug to level 2. The thing is that I will need to wait for the 15 minutes timeout to occur so that I can try hitting the /all/cron link and see what the debug says. Right now, because it is waiting to timeout, nothing gets shown from a debug log perspective.

Regards,
Nick

Re: Error with CRON

Posted: Thu Jun 25, 2015 7:39 pm
by bullmoose20
So I get the bad gateway error again and nothing shows to screen that makes it obvious as to where the problem may lie. Does the debug write to a file on the server somewhere or just to the screen? If so, where is the debug log so I can review it.

I know that the debug log setting of 2 is working because other pages I navigate to are showing me the sql commands.

Other suggestions? maybe I should be trying to run individual cron jobs to see if one of the many is causing the issue?

Nick

Re: Error with CRON

Posted: Sun Jun 28, 2015 10:55 am
by bullmoose20
$controllers = array('people', 'leagues', 'teams', 'games', 'team_events', 'events');

people - good
leagues - timeout
teams - good
games - timeout
team_events - good
events - good

Between each manual run, I ensured that the lock was removed from the locks table.

Of course, when the timeout occurs, the debug does not show anything on the web page.... so I am going to have to look at the corresponding files to determine what may be going on...

NIck

Re: Error with CRON

Posted: Sun Jun 28, 2015 12:26 pm
by GregS
Good progress on sorting this out! The debug and error logs are in zuluru/tmp/logs. My guess, based on which ones are failing, is that there's maybe something wrong with your data import, either in the games table or one of its relations.

Re: Error with CRON

Posted: Sun Jun 28, 2015 4:57 pm
by bullmoose20
Wow... this is getting stranger as I troubleshoot...

The logs had lots of errors in them, so I deleted the errors.log and debug.log, went back to try and run the individual crons and now I no longer have errors.

I then proceeded to run the /all/cron and it came back properly with "0"'s and not null values.

Go figure... I will monitor for a couple of days and see what happens.

Nick