Every deployment sends me an email saying failed even when successful

morganbradbury
HOBBY

a month ago

Hi

On my discord bot project every time I make a deployment it sends me an email saying its failed when it doesnt fail... please can you look into this?

I've tried re-creating the application within Railway and this didn't fix it

$10 Bounty

4 Replies

morganbradbury
HOBBY

a month ago

Sorry I mis-spelt - It says it crashed, not failed.


a month ago

This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.

Status changed to Open brody about 1 month ago


codixer
HOBBY

a month ago

Like the email says, check the deploy logs. Go to your env, and click on the "view logs".

From there, click on any failed deployment inside of your app. And use the "view logs" button. See if you can find an error through there.

If not, what errors (if any) are you getting?

Attachments


0xthrpw
PRO

a month ago

I had a similar issue with a telegram bot I wrote. Railway doesn't stop your currently deployed container until the new one is up and running, so when redeploying, sometimes the new instance of your bot tries to start up before the old one has been stopped. My bot was 'crashing' because the library I used wouldn't allow two instances of the same bot ID to be running at the same time. I had a restart policy set so every time I checked the logs the bot appeared to be running just fine.

You could possibly confirm this by removing the currently deployed instance manually in Railway before starting your new deployment. If the new instance comes up without triggering a crash notification, then that's probably your issue.

Manually shutting down your service before every redeployment is a hassle, a more sustainable solution would be to write a loop or interval at the top of your service with a try/catch around creating the bot. Attempt to create the instance of the bot and if it fails, wait a few seconds and then try again. This will at least catch the error and not trigger a crash and should allow the previous service to shut down before creating the new bot in your redeployment.


codixer
HOBBY

a month ago

@morganbradbury
Any update? How'd it go with your bot?


Every deployment sends me an email saying failed even when successful - Railway Help Station