Cron deployments never running
sdcooke
PROOP

2 years ago

I apologise for posting in a couple of places, I'm not sure if this thread is being monitored in the same way as new threads: https://help.railway.app/feedback/cron-reliability-improvements-c2f2c959

I've tried creating a database backup cron and it only ever gets into a "Ready" state - i.e. built but not deployed. If I deploy as a service without cron and push code it runs successfully and exits, so I think the service is set up correctly. If I push an update, click "Run now", or the cron triggers I get another build that sits in a READY state, but doesn't run.

Ideally I'd prefer to keep things simple and not to have to use node-cron or equivalent if Railway can handle this for me.

Solved

16 Replies

chandrika
EMPLOYEE

2 years ago

Hi Sam 👋, and no worries about posting here and there — in this case posting there is helpful feedback and this is a great place to get help with your specific needs!

Could you confirm if you're still having the issue? We were having an outage earlier and want to make sure that wasn't interfering with your crons not running.

Could you also let me know if this is a recent issue on crons that were previously working as expect, or if it's the first time you tried crons on Railway and ran into this issue?


Status changed to Awaiting User Response Railway over 1 year ago


sdcooke
PROOP

2 years ago

Hi Chandrika - I'm still having the issue. I just changed the cron schedule to be a couple of minutes ago and the same thing happened (well, didn't happen!). I was initially trying around 18-20 hours ago as well.

I've never had cron working, this is the first time I've tried cron on Railway.


Status changed to Awaiting Railway Response Railway over 1 year ago


chandrika
EMPLOYEE

2 years ago

We merged in a fix that should help with this issue! (..and you should be able to try it out with "Run now" too)


Status changed to Awaiting User Response Railway over 1 year ago



Status changed to Awaiting Railway Response Railway over 1 year ago


2 years ago

Hey Clint. Could you try toggling on the "new cron experience" feature flag and seeing if it fires?


Status changed to Awaiting User Response Railway over 1 year ago


2 years ago

Actually Clint it looks like you're already using the new feature flag. So the run should show up under the "Schedule" tab now

Can you confirm it's running there?


clintfix
PRO

2 years ago

It started workign correctly when I turned the feature flag off.


Status changed to Awaiting Railway Response Railway over 1 year ago


2 years ago

Yea so, it actually was running before it would have just been under that "Schedule" tab (you can see it in your loom)

The new experience has it's own tab for cron stuff because, as you and many users found out, it's really confusing to have Ready, completed, building, deploying, etc all in one place


Status changed to Awaiting User Response Railway over 1 year ago


clintfix
PRO

2 years ago

No, it was NOT executing the startCommand even though it said it was running. I explain that in my video.

Turning off the new front functionality fixed the problem. Now the startCommand gets executed on the cron schedule.


Status changed to Awaiting Railway Response Railway over 1 year ago


2 years ago

Gotchya. If you could toggle the flag back on and screenshot that "Schedule"/"Cron runs" tab that would be great


Status changed to Awaiting User Response Railway over 1 year ago


clintfix
PRO

2 years ago

Turned it on. It had all the runs from when I had it set to every 5 minutes to test it. None of those actually ran the startCommand. The top one at 8:00 is from me clicking run now just before I recorded, which doesn’t run the command successfully.

I switched the flag back off so my cron will run correctly for now. I won’t be at my computer for a couple days.

Attachments


Status changed to Awaiting Railway Response Railway over 1 year ago


clintfix
PRO

2 years ago

Now it’s stuck on the new cron service and I can’t turn it off (feature flag is missing) and it’s not working. Can I get the old version back? It worked. If not I’ll need to switch services asap


2 years ago

Hey clint can you link to the service that's not working?


Status changed to Awaiting User Response Railway over 1 year ago



2 years ago

It looks like your application is still running. When your cron finishes, are you calling "Exit" because if you don't, it'll keep running

You can see in this tab that it's skipped because the instance is still running, and that's what we see when I inspect the instance on our side


2 years ago

Just an FYI there is now an option to enable "Old cron experience" if this is still problematic


Railway
BOT

9 months ago

This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!

Status changed to Solved Railway 10 months ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...