Skip to content
Cron schedule via config as code not executed
benisenstein
OP

a year ago

I have a monorepo with two cron jobs. Each job lives in a subdirectory, with its source code plus a railway.json file for the cron schedule.

In the railway project, I manually configure each service's root directory and config file path.

It is noteworthy that up until sometime in the last two weeks, all I had to configure was root directory. It seems that is no longer enough to have the platform respect my config as code file. So now I manually set root directory --> /my-job and railway config file --> /my-job/railway.json

In any case, I haven't had regular cron executions since December 4th and would like some help troubleshooting. Thank you!

project id: 675c7104-52e7-4685-9806-2b3cbd0a9af7

source github repo: https://github.com/BenIsenstein/pgonrails-cron-jobs

Solved

31 Replies

benisenstein
OP

a year ago

Some extra information: the service GUIs in the project canvas does show that they have cron schedule! It just hasn't been executing...


a year ago

Hey, can you share both of the service links? And would you be able to re-create the service or manually set a schedule on both services (just a troubleshooting step to help us understand what's going on)?




benisenstein
OP

a year ago

The cron schedule is set in railway.json, so I can't manually change it


a year ago

Could you maybe remove the railway.json? 🙏


benisenstein
OP

a year ago

For sure


a year ago

I


benisenstein
OP

a year ago

SHould I manually change the cron schedule to something new?


a year ago

I would suggest using the custom option and then typing the same as your railway.json one.


benisenstein
OP

a year ago

I just selected hourly


a year ago

Weirdly enough I was able to set one via railway.json

1449567621975638087


benisenstein
OP

a year ago

Well, it wouldnt even execute by the manual trigger yesterday but I was just able to execute it manually so that's positive (Y)


a year ago

Were you getting errors when trying it?


benisenstein
OP

a year ago

Yesterday it errored out when trying to execute manually


jaredlunde
EMPLOYEE

a year ago

Can you try redeploying actually?


jaredlunde
EMPLOYEE

a year ago

And then tell me if excecuting manually works


benisenstein
OP

a year ago

The UI was displaying that I had correctly set the cron schedule with railway.json all this time, even though it hadn't been executing since December 4th


benisenstein
OP

a year ago

Sure


a year ago

Oh that's good to know, i'll let Jared take over then


benisenstein
OP

a year ago

Just redeployed both services


benisenstein
OP

a year ago

thanks Thalles!


benisenstein
OP

a year ago

The redeploys were successful, manual trigger worked!


jaredlunde
EMPLOYEE

a year ago

Great! It will start running as it normally would then. Sorry about that!


a year ago

Maybe try with the railway.json again?


benisenstein
OP

a year ago

Quick question for clarity - if I configure the root directory for a service, will it apply a railway.json file at the root of that subdirectory?


benisenstein
OP

a year ago

That would be very desirable if it did. It does that for Dockerfiles at the root. I wish it would do that for config as code too


jaredlunde
EMPLOYEE

a year ago

I think Dockerfiles and railway.json resolve the same but I'm not 100% certain off the top of my head


benisenstein
OP

a year ago

In the past I've seen mixed signals about this. I've seen in docs somewhere that a service's root directory won't pick up a railway.json file, but it was working nicely for almost a month before whatever update was rolled out on December 4th


jaredlunde
EMPLOYEE

a year ago

This particular issue with the schedule going away was unrelated to how the railway.json resolves. We only resolve it once when your application builds, then we read it where necessary. Unfortunately something occurred which caused some schedules configured via the railway.json to get dropped, but that has been fixed.


benisenstein
OP

a year ago

Got it. Thanks for your help!


Status changed to Solved passos • 11 months ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...