Cronjob code executing every 13 seconds instead of on the schedule 0 13 * * *
The process is the one that should send one daily notification to all the users.
Even after I have deleted the ENTIRE cronjob service, there is some kind of zombie process that's in an infinite loop (since around last night / this morning). So its sending notifications to everyone, every 13 seconds.
Project ID: 2bbc885c-7904-4d61-a9a6-3d1a117d28d2
37 Replies
Project ID:
2bbc885c-7904-4d61-a9a6-3d1a117d28d2
Okay it might have died down a few minutes after deleting the entire service š¤ But I will need to recreate the service now & I'm hoping the issue doesn't reoccur. Could you look into it and find a probable cause please?
More info: I deployed new code (with different env variables), but in the logs the code that was running every few seconds had the old env variables. So the process somehow got detatched and stuck in a loop.
railway's cron scheduler has a minimum limit of 15 minutes last I checked, your code running in a loop seems more like a code issue?
No, it wasn't doing this before today and there are no loops in the code
It's very simple code
was railway's UI sending out a deployment every 13 seconds?
Literally just does one request
No; the deployment was invisible, but I could see the logs coming every 13 seconds
where could you see the logs?
observability section
could you send a screenshot of that please?
Started today at 9:00am on the dot almost
(UK time)
It wasn't just logs, I was also getting a notification every 13 seconds š„²
Hi, I haven't received a satisfactory response to this? Please advise
Similar things have been happening with my database backups
From July until November had no issues, it ran at 5am every day:
And then it's getting worse and worse as time goes on:
If this isn't resolved I'm going to have to exit because I can't have a cron scheduler that's running amock from time to time - it needs to be reliable
Jan 4th was particularly bad:
@Brody āļø I had to disable my notifications cron completely until I move it to a separate provider. DB backups are less harmful but it could still DDOS my database / cost me a ton of money if I had more users / data
e.g. a 1GB backup that decides to run 10x a minute between 2am and 4am as above is not ok
this is very odd, no one else has yet to report anything even remotely similar
can you share your repo and the exact cron expression you are using?
Sure I can add you to the repo if you give me your GH name, and then link you to code I'm using
It's all as basic as could be
š¤ I'm pretty sure its not an issue on my end, because this was literally working for months, before it started breaking (with me having made no changes).
I can't tell you how much I would love to not have to move off railway, its such a great product aside this phantom behaviour!
it's been a while since you opened this thread and still no one has reported anything even remotely similar, so please add me to your repo
brody192
https://github.com/ps-george/hayfriends/tree/main/apps/cron
Invited, link to the folder that has the cronjobs in it
If you have access to my logs, you can see it plainly - the cronjob some days ends up triggering randomly and repeatedly, other days it acts normally
i dont work for railway so i dont have acess to your project
Wasn't sure even railway would tbh
the team can see your logs yes
In any case, in the past week every day is fine and then suddenly on the 7th Feb it goes haywire.. Looking at my repo I haven't even pushed unrelated code since 3rd Feb. And as you say, I reported this a while ago. This has been ongoing since around November
why not use railway's backup template?
kind of irrelevent, I had to disable my daily notifications cronjob because overdoing backups is fine, overdoing sending users 100 notifications a day is not fine
But when I set this up it was the recommended way of doing things
can you try with the restart policy set to never
has been that all along
im not seeing anything that stands out to me, ill flag the team
Thanks Brody
Thread has been flagged to Railway team by @Brody.
PRO-1865 - Cron Job running multiple times in quick succession
Cron job is scheduled to run 0 5 * * *. You can see in the screenshot in the thread that it ran multiple times back to back on Feb 8 (4:58 and then again at 5:00). This is one occurrence, but has happened several times in the past. See thread for more context going back to January.
Status
Triage
Product
hi psgeorge, apologies for this experience. I have created a ticket for us to look into the issue
Thanks @Melissa