3 months ago
When deploying my node.js back-end, I first run migrations through Prisma by running "npx prisma migrate deploy".
This works fine on my staging environment, but on the production environment it marks the deployment as failed while there aren't any errors.
It seems to mark the "npm notice" about the version as an error, which it isn't. The extra weird part is that it doesn't happen on staging.
Am I missing something?
Cheers!
Attachments
Pinned Solution
3 months ago
I think I've found the issue. I also have the migration running in the CMD of my dockerfile. This in combination with the healthcheck created a race condition that made the container sometimes stop because of it.
I'll clean all of this and see if this fixes the issue consistently.
2 Replies
3 months ago
Thanks for looking into it. I did try this but same problem. The docs also mention not to run migrations in the start command, but in the pre-deploy steps. So it should work like this. You do have a good point about the error being the "container stopped" instead of the npm notice though.
Docs I mentioned: https://docs.railway.com/guides/pre-deploy-command
3 months ago
I think I've found the issue. I also have the migration running in the CMD of my dockerfile. This in combination with the healthcheck created a race condition that made the container sometimes stop because of it.
I'll clean all of this and see if this fixes the issue consistently.
Status changed to Solved brody • 3 months ago