简体   繁体   中英

Openshift hourly cron job suddenly stopped working

Suddenly the hourly cron job on openshift stopped working. I am using a free account and the cron was running fine until suddenly it just stopped working.

Minutely jobs on the other hand are running fine, given the following files

app-root/runtime/repo/.openshift/cron/minutely/cminut

#!/bin/bash
echo 'ping'

and

app-root/runtime/repo/.openshift/cron/hourly/chour

#!/bin/bash
echo 'pong'

as well as the following permissions [xxx-xxxxxxx.rhcloud.com cron]\\> ls -la hourly/ total 4 drwx------. 2 1234567 1234567 18 Jun 28 19:04 . drwx------. 4 1234567 1234567 52 Jun 28 19:04 .. -rwx--x--x. 1 1234567 1234567 24 Jun 28 19:04 chour [xxx-xxxxxxx.rhcloud.com cron]\\> ls -la minutely/ total 4 drwx------. 2 1234567 1234567 19 Jun 28 19:04 . drwx------. 4 1234567 1234567 52 Jun 28 19:04 .. -rwx------. 1 1234567 1234567 24 Jun 28 19:04 cminut [xxx-xxxxxxx.rhcloud.com cron]\\> [xxx-xxxxxxx.rhcloud.com cron]\\> ls -la hourly/ total 4 drwx------. 2 1234567 1234567 18 Jun 28 19:04 . drwx------. 4 1234567 1234567 52 Jun 28 19:04 .. -rwx--x--x. 1 1234567 1234567 24 Jun 28 19:04 chour [xxx-xxxxxxx.rhcloud.com cron]\\> ls -la minutely/ total 4 drwx------. 2 1234567 1234567 19 Jun 28 19:04 . drwx------. 4 1234567 1234567 52 Jun 28 19:04 .. -rwx------. 1 1234567 1234567 24 Jun 28 19:04 cminut [xxx-xxxxxxx.rhcloud.com cron]\\>

The minutely cron job runs fine and i can see the log file cron_minutely.log in $OPENSHIFT_LOG_DIR

For the hourly cron job i can not see the cron_hourly.log neither the job is executed

My previous attempts wen't trough uninstalling and re installing the cron cartridge as mentioned here but there was no success running the hourly cron job.

Is there any other way that i can debug this, or any openshift specific fix known in order to solve this?

After some desperate attempts and inspecting the cron job cartridge script cron_runjobs.sh

i came to note that whenever i runed the hourly cron via this script the log

":SKIPPED: $freq cron run for openshift user '$OPENSHIFT_GEAR_UUID"

popped up, such message was not fired for other crons (minutely, weekly...)

upon closer inspection i noticed that there were several processes with this script cron_runjobs.sh running on the server, after killing this processes and re-deploying the application the hourly cron job started again to work as expected.

I do not know why were these processes hanged and still running, maybe because i used sleep in the hourly cron before, although not sure if that was the reason.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM