Jump to content


Photo

My Cron jobs stopped working

cron staff response

  • Please log in to reply
8 replies to this topic

#1 eugeneb

eugeneb

    Advanced Member

  • Members
  • PipPipPip
  • 229 posts
  • LocationCenturion, south Africa

Posted 06 July 2017 - 06:35 AM

Hi guys,

 

we realised today that the cron jobs don't work. If I fiddle with the cron table settings (via web request) then after saving it works, but then when we test after say an hour, it doesn't work again.

 

We test by running a simple macro flow with a comment-wait-comment-wait-comment sequence to see if the actions fire after the wait state.

 

I checked the server and done the API resolvability test and works fine.

 

Any ideas of where to start fault finding.

 

Thanks

 

Eugene



#2 X2Raymond

X2Raymond

    Advanced Member

  • Administrators
  • 972 posts
  • LocationSanta Cruz, CA

Posted 06 July 2017 - 07:48 AM

Hello Eugene,

 

Ah very interesting, would you happen to have some automation system or control panel in place which might manage cronjobs? After configuring the cronjobs from the Cron Table settings page, examine the cron table from the CLI with a command like:

sudo crontab -eu www-data

substituting your web server user as appropriate. Ensure that the X2CRM automation jobs are present in the crontab, then inspect it again later to verify they are still there. You can also try running the console command from within the protected directory manually with:

./yiic cron

If it remains present in the crontab, we can continue by looking into possible errors in the automation methods. You can update the cron jobs to save the output by appending something like " >> ;/tmp/x2cronjob.log". You'll also want to grep your Apache access log for the string "cron" to find the calls to api/cron, and examine the status code, which should be 200.

 

Please let me know what you find and we can continue troubleshooting.

 

Thanks,

Raymond



#3 eugeneb

eugeneb

    Advanced Member

  • Members
  • PipPipPip
  • 229 posts
  • LocationCenturion, south Africa

Posted 10 July 2017 - 10:03 AM

Hi Ray, I am working on it now as the problem still persists. I have done the above with:

  1. We aren't running cron jobs or tasks and for X2 only use the webcall internal settings of X2. All worked until recently. Nothing recently was changed on the server or X2
  2. I ran the CLI 'sudo crontab -eu www-data'. Is this suppose to show cron tasks? i dont know what the output should be. Currently it shows simple explanation with comment # infront each line commenting out.  There are no tasks or anything else in the file. I have also run a flow using three timed delays and the flow runs to the first wait state and stays there. There doesn't seem to be a command task then after that.
  3. On checking the next step, on running the ./yiic command my CLI says I don't have Permission although I am logged in as SU

After some testing via the X2 interface: If I change the cron settings in Admin in X2 and save it, it seems to then run the flows and crons. But after some time or condition it stops. 



#4 eugeneb

eugeneb

    Advanced Member

  • Members
  • PipPipPip
  • 229 posts
  • LocationCenturion, south Africa

Posted 11 July 2017 - 12:46 AM

UNSOLVED?

 

I have reset my Apache server last night and it seems to run now. We will continue testing on a regular basis. But 

 

I was able to manually Run the Curl command from CLI which also worked before resetting the Apache server.



#5 eugeneb

eugeneb

    Advanced Member

  • Members
  • PipPipPip
  • 229 posts
  • LocationCenturion, south Africa

Posted 07 August 2017 - 06:22 AM

Hi guys,

 

I cannot for the live of me get my Crons to work. My network guys checked the server, cran tab and apache log and other crons work meaning it points to the X2 code base.

 

I can run manual CL statement that works, and also if I change the schedule via the interface, it starts working. But then after hours the automation stops.

 

We have started testing each morning and now have to manually run crons to wake it up.

 

Please help if you can



#6 X2Isaiah

X2Isaiah

    Advanced Member

  • Moderators
  • 102 posts

Posted 07 August 2017 - 10:34 AM

Hey Eugene,

 

Sorry that is happening to you, we will try to get this fixed.

 

What I would recommend to further debug this issue is to take a look at the error logs, as well as the log located on the x2 cron table page. Another recommendation is to add a 'mailto' to your x2 crontab with your user and have the cron logs sent to your email. The more information we have on the issue, the better. Then, once you gather all of that, feel free to PM the logs to me and we can further debug from there



#7 eugeneb

eugeneb

    Advanced Member

  • Members
  • PipPipPip
  • 229 posts
  • LocationCenturion, south Africa

Posted 01 September 2017 - 03:25 AM

Hi X2Isaiah,

 

I am still struggling and its a issue now. I went through your advice but I haven't worked on Crons server level before so without precise instruction I don't know what to extract from logs.

 

1. What error logs do you need. Ray have SSL access to our server so you can access them direct, but I am happy to email. X2 logs, or Apache or what?

2. I have no idea how to ad mailto to the crontab. The crontab is alien to me at this stage. My technical support guy is unavailable to help with command line cron work.

 

I am happy to do myself as I have su access, but not sure what to do. I tried ring fencing the bug but the crons either work or not. Cant find any pattern. Sometimes it seemsits X2 and other times the server. grrr 

 

If you can help or email me direct please do. I am really stuck and without the crons working all our processes have grinded to a halt in the last month without manual provocation of firing off.

 

Thanks



#8 X2Isaiah

X2Isaiah

    Advanced Member

  • Moderators
  • 102 posts

Posted 01 September 2017 - 11:35 AM

Hey Eugene,

 

You can find error logs and application logs in the /protected/runtime directory which may be helpful in finding what may be causing the issue.

 

To edit the crontab in your instance, use the command

crontab -e

however, you can also check your system logs for any cron information using

sudo grep CRON /var/log/syslog

I would actually recommend the second option, and feel free to PM the logs if you need more information



#9 eugeneb

eugeneb

    Advanced Member

  • Members
  • PipPipPip
  • 229 posts
  • LocationCenturion, south Africa

Posted 07 September 2017 - 06:45 AM

Dear Isaiah,

 

I cant PM you as you cant attach files on a PM in this forum. I don't think it will work just dumping the content in the PM message. Please email me at eugeneb@disalox.co.za so I can send you the attachment logs.

 

On your solution yes I can run the Crontab command but what am I looking for? It mentions two lines of content with no reference to X2 but seemingly writing to cron.log. Am I looking for something specific?

 

I have the cron.log and the grep CRON search which I put in a txt file

 

How can i get it to you to help please.

 

Thanks







0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users