Jump to content


Photo

My Cron jobs stopped working

cron staff response

  • Please log in to reply
3 replies to this topic

#1 eugeneb

eugeneb

    Advanced Member

  • Members
  • PipPipPip
  • 223 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
  • 223 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
  • 223 posts
  • LocationCenturion, south Africa

Posted 11 July 2017 - 12:46 AM

SOLVED?

 

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.







0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users