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
31 Replies
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)?
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? 🙏
3 months ago
I
3 months ago
I would suggest using the custom option and then typing the same as your railway.json one.
3 months ago
Weirdly enough I was able to set one via railway.json

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?
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
3 months ago
Oh that's good to know, i'll let Jared take over then
Great! It will start running as it normally would then. Sorry about that!
3 months ago
Maybe try with the railway.json again?
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?
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
I think Dockerfiles and railway.json resolve the same but I'm not 100% certain off the top of my head
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
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.
Status changed to Solved passos • 3 months ago