Cron schedule via config as code not executed
benisenstein
PROOP

3 months 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
PROOP

3 months ago

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


3 months 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
PROOP

3 months ago

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


3 months ago

Could you maybe remove the railway.json? 🙏


benisenstein
PROOP

3 months ago

For sure


3 months ago

I


benisenstein
PROOP

3 months ago

SHould I manually change the cron schedule to something new?


3 months ago

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


benisenstein
PROOP

3 months ago

I just selected hourly


3 months ago

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

1449567621975638000


benisenstein
PROOP

3 months 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)


3 months ago

Were you getting errors when trying it?


benisenstein
PROOP

3 months ago

Yesterday it errored out when trying to execute manually


jaredlunde
EMPLOYEE

3 months ago

Can you try redeploying actually?


jaredlunde
EMPLOYEE

3 months ago

And then tell me if excecuting manually works


benisenstein
PROOP

3 months 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
PROOP

3 months ago

Sure


3 months ago

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


benisenstein
PROOP

3 months ago

Just redeployed both services


benisenstein
PROOP

3 months ago

thanks Thalles!


benisenstein
PROOP

3 months ago

The redeploys were successful, manual trigger worked!


jaredlunde
EMPLOYEE

3 months ago

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


3 months ago

Maybe try with the railway.json again?


benisenstein
PROOP

3 months 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
PROOP

3 months 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

3 months ago

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


benisenstein
PROOP

3 months 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

3 months 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
PROOP

3 months ago

Got it. Thanks for your help!


Status changed to Solved passos 3 months ago


Loading...