Does a manual restart rerun pre-deploy commands?
Anonymous
HOBBYOP

a month ago

Hello Railway team,

We need clarification of platform behavior before a controlled staging

restart.

Our currently successful Web deployment uses:

  • Dockerfile build
  • Runtime V2
  • One replica
  • Pre-deploy command: python manage.py migrate --noinput
  • Railway CLI 5.45.2

We intend to use railway restart on the existing deployment, without

changing source, image, configuration or variables.

Please confirm:

  1. Does this manual restart execute the configured pre-deploy command

    again, or is that step skipped?

  2. Is the answer also applicable to the Dashboard Restart action?

    We are not asking about redeploy, automatic crash recovery or

    platform-initiated host migration.

  3. What supported event/metadata can identify the restart and whether

    a pre-deploy execution was scheduled for that event?

Our test requires no migration-command invocation, not merely no new

migrations applied. Reusing the image or observing unchanged migration

records does not distinguish those conditions.

Please provide an explicit statement of the supported behavior or a

documentation reference. Please do not restart or modify our services

while answering this question.

Thank you.

Solved

3 Replies

Railway
BOT

a month ago

A railway restart (and the equivalent Dashboard Restart action) restarts the process within the existing deployment's container without creating a new deployment, so the pre-deploy command does not run. Pre-deploy commands execute only as part of the full build-then-deploy lifecycle, which a restart skips entirely. You can confirm this by checking your deployment logs after the restart: no new deployment entry will appear, and no PRE_DEPLOY_COMMAND step will be listed in the deployment's event timeline. A railway redeploy, by contrast, creates a new deployment from the same source and does execute the pre-deploy command. See railway restart and Pre-Deploy Command for reference.


Status changed to Awaiting User Response Railway • about 1 month ago


Anonymous
HOBBYOP

a month ago

Thank you. The automated response says that CLI and Dashboard Restart skip

pre-deploy, which addresses the behavior we need to establish.

Could a Railway team member explicitly confirm this, or point us to the

exact official documentation passage that states it?

Specifically: for a successful deployment with

“python manage.py migrate --noinput” configured as its pre-deploy command,

does a manual CLI/Dashboard Restart skip that command entirely when no

source or configuration changes are made?

Our requirement is no migration-command invocation, not merely no rebuild

or no new migrations applied. We are not asking about Redeploy.

Please answer without restarting or modifying our services.


Status changed to Awaiting Railway Response Railway • about 1 month ago


a month ago

Confirmed: a manual restart, whether via railway restart or the Dashboard Restart action, does not execute the pre-deploy command. A restart reuses the existing deployment image and restarts the process inside that container without going through the build-deploy lifecycle. Because the pre-deploy command runs "between building and deploying" as part of a new deployment, and a restart creates no new deployment, python manage.py migrate --noinput will not be invoked. The relevant docs are railway restart (see the "Behavior" and "Difference from redeploy" sections) and Pre-Deploy Command. After the restart, you can verify no pre-deploy step was scheduled by checking that no new deployment entry appears in the deployment event timeline for that service.


Status changed to Awaiting User Response brody • about 1 month ago


Railway
BOT

a month ago

This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!

Status changed to Solved Railway • 29 days ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...