a month ago
Hi Railway team,
I've got a Pre-deploy Command that isn't fully running, and I've dug in enough to be pretty confident it's not a mistake on my end —
hoping you can take a look.
Project: handsome-courtesy (8ed175ba-9951-48f5-833a-caf781974ac0)
Service: livoh
Environment: production (8c584d9d-4135-4092-a964-127113a12cb6)
Configured Pre-deploy Command:
npx prisma migrate deploy && node dist/db/loadStoredProcedures.js
What's happening: prisma migrate deploy runs and completes every time — I can see its full output in Deploy Logs. But node
dist/db/loadStoredProcedures.js, the second half of that same &&-chained command, never produces a single line of output. Not
success, not a no-op message, not even an error — it's designed to log loudly on every code path (including a hard failure if an env
var is missing), so total silence points to it not running at all rather than running and failing quietly.
I've reproduced this across three separate deployments so far: b1c23194-d1b3-41af-8f08-c140332d2b55,
79b9e66b-be2f-4ae8-bf0c-f6c7a8018049, and b1423715-d381-4de7-98e9-d86d38d2c33a. In each case, Deploy Logs go straight from the Prisma
migration output to the app's own runtime startup logs, with nothing in between.
To rule out a mistake on my side, I've already:
- Confirmed the command itself is correct (it matches my package.json's own start script, split across your Pre-deploy/Start fields).
- Re-saved the Pre-deploy Command field and triggered a fresh deploy from the dashboard — same result.
- Checked Deploy Logs directly in the dashboard, not just the CLI, and confirmed the same absence there.
- Confirmed the identical script runs and logs correctly ("loadStoredProcedures: script applied" or "unchanged — skipped") on every
boot of our staging environment, which is configured the same way. It's only production where the second command seems to be dropped.
- Confirmed the script itself works fine when I run it manually against the production database from my own machine.
So the app code and database are fine — this is specifically about the Pre-deploy step not carrying through its second command on
this one environment.
Could someone take a look at why production's Pre-deploy Command isn't executing that second command? Happy to provide any further
logs or details you need.
Thanks,
Kartikey
Pinned Solution
a month ago
Try add that command as new scripts on your package.json and run the script as pre-deploy command, or wrap your pre-deploy command in a shell like this
sh -c "npx prisma migrate deploy && node dist/db/loadStoredProcedures.js"
1 Replies
a month ago
This thread has been opened as a bounty so the community can help solve it.
Status changed to Open Railway • 26 days ago
a month ago
Try add that command as new scripts on your package.json and run the script as pre-deploy command, or wrap your pre-deploy command in a shell like this
sh -c "npx prisma migrate deploy && node dist/db/loadStoredProcedures.js"
Status changed to Solved 0x5b62656e5d • 25 days ago