Deployment Issues
Heyo!
So recently I changed the repo of my discord bot and applied the same settings the previous repo was using. This new one has major code changes compared to the first one.
My problem is that whenever I trigger a deploy/redeploy the only thing I get in the deployment logs is a database error, and nothing else.
I replicated the same conditions on my laptop and everything works out just fine. No db issue and the bot connects instantly. I've ensured that everything Is the same so I really don't understand why It doesn't work anymore.
21 Replies
Project ID:
bdf52ca3-6199-4fdc-b415-bc60d97ba135
bdf52ca3-6199-4fdc-b415-bc60d97ba135
build logs please https://bookmarklets.up.railway.app/log-downloader/
That db error has happened in the previous repo as well, but was never an issue
and you said that you can connect to this database locally just fine?
Yep
can you try to add a 3 second sleep before starting your app?
That error has always been there for whatever reason, but I can connect just fine
might be running into the network initialisation times
Do you mind helping me with this? I’m quite unsure how to do this
sure, what's your current start command?
It’s the default one.
npm run start
Bot is in ts if that matterscool, what's your start script
Build command is also default
Pretty sure it’s
node .
If that’s what you mean
*I’m not entirely fluent in English so I might not understand what you’re talking me through here and then. I apologise for that
If I recall correctly, this also happened the first time I tried to deploy my old repo on railway. However, after I triggered another redeploy It seemed to fix itselfyou're doing great!
that's what the start script in your package.json says?
Yes, but there are other things included in the scripts
Don’t quite understand why this happens, even the first time with the original repo. Though it only happens once there; here it’s happening every time haha
Solution
change your start script in your package.json to
So just "sleep 3 && node ."
Gotcha
@Brody Thank you so much, it fully works now. I really appreciate it :)
no problem, happy to help!