Skip to content
Rotate sealed
michall1983
OP

a month ago

Subject: Sealed variable rotation unexpectedly triggers service redeployment

Hello Railway Community,

I'm using Railway Hobby with multiple services in a production environment.

I need to rotate sealed environment variables while avoiding unintended redeployments of existing services.

During a previous configuration update, I used Alt+Deploy to commit staged changes without redeployment. However, one existing service was unexpectedly redeployed, while the other services remained unchanged.

The affected service continued running correctly afterward, but I would like to understand how to prevent this behavior during future secret rotations.

Could someone clarify:

  1. Does editing an existing sealed variable always create staged changes without immediately redeploying the service?
  2. Is Alt+Deploy guaranteed to commit changes without triggering a redeployment, including when sealed variables are involved?
  3. Could changing a sealed variable cause a service to redeploy despite using Alt+Deploy?
  4. What is the recommended procedure for rotating related signing keys across multiple services without accidentally restarting production workloads?
  5. Do already-running containers receive updated environment variables, or is a controlled redeployment required?
  6. How should rollback be handled when previous sealed values cannot be retrieved?

I would appreciate a documented, safe procedure suitable for the Hobby plan.

I am not sharing project identifiers, credentials, signing keys, monitoring URLs, or deployment IDs.

Thank you!

Solved

5 Replies

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


chandrika
EMPLOYEE

a month ago

Editing a sealed variable is staged the same way as any other variable change. Committing with Alt held on Deploy (or Alt+Shift+Enter) applies the commit without triggering deploys, and sealing a variable does not change that.

Running containers keep the environment variables they started with. A new value only reaches a service on its next deployment, so the controlled approach is to stage the rotated values, commit them without deploying, then redeploy each service yourself when you are ready to switch it over.

We can't tell from here what redeployed that one service without looking at the project. Networking changes are not staged and apply immediately, so a commit that changes networking alongside the variables behaves differently from a variables-only commit. Reviewing the staged change diff under "Details" before committing shows exactly what is included. Staged changes docs

Once a variable is sealed, its value cannot be shown again in the dashboard or the API, and it cannot be unsealed. To be able to roll back, keep the previous value in your own secret store before you rotate. Rolling back then means setting that saved value again and redeploying the affected services.


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


chandrika

Editing a sealed variable is staged the same way as any other variable change. Committing with Alt held on Deploy (or `Alt+Shift+Enter`) applies the commit without triggering deploys, and sealing a variable does not change that. Running containers keep the environment variables they started with. A new value only reaches a service on its next deployment, so the controlled approach is to stage the rotated values, commit them without deploying, then redeploy each service yourself when you are ready to switch it over. We can't tell from here what redeployed that one service without looking at the project. Networking changes are not staged and apply immediately, so a commit that changes networking alongside the variables behaves differently from a variables-only commit. Reviewing the staged change diff under "Details" before committing shows exactly what is included. [Staged changes docs](https://docs.railway.com/deployments/staged-changes) Once a variable is sealed, its value cannot be shown again in the dashboard or the API, and it cannot be unsealed. To be able to roll back, keep the previous value in your own secret store before you rotate. Rolling back then means setting that saved value again and redeploying the affected services.

michall1983
OP

a month ago

Hello Čandrika, and thank you for your earlier explanation regarding sealed variables.

We have encountered a second, separate issue in the same Railway project, and I would appreciate your guidance.

One of our production services is currently CRASHED due to an application-level SQLite size limit ("StopTest: DB_SIZE_CAP").

Its persistent volume is marked Ready, but we cannot access the files.

Railway SSH failed with "Connection to ssh.railway.com closed by remote host". We also attempted the documented direct volume SFTP access using a temporary registered SSH key, but it failed before returning a file listing. Unfortunately, the detailed SFTP error was not preserved.

We need to inspect and safely back up the SQLite databases and their WAL/SHM files before making any changes or restarting the service.

Could you please advise on the supported way to access or export a persistent volume when the associated service is CRASHED?

We want to preserve all historical data and avoid restarting the collector until we can verify database integrity.

No files have been modified, and all temporary SSH keys have been removed.

Thank you again for your help!


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


Railway
BOT

a month ago

SSH, SFTP and the railway volume files commands all reach a volume through the service's running deployment, not as direct access to stored data. A CRASHED service has no running container to connect to, so these paths fail while it stays crashed, even though the volume itself shows Ready.

Volume backups are the copy that does not depend on a running container. A backup captures the whole volume at one point in time, so the SQLite databases and their WAL/SHM files on that volume are captured together. That is crash-consistent, the same state the files were in when the process stopped, so SQLite's own recovery still applies when the files are opened. Your existing backups are listed on the service's Backups tab.

Restoring a backup is not a read-only preview. It creates a new volume and stages a swap onto it, and deploying that staged change redeploys the service. We do not offer a way to download a backup or to browse an unattached restored copy, so getting at the files themselves requires the service to be running again.


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


michall1983
OP

a month ago

Hello,

Thank you for your previous explanation.

We have now confirmed that the crashed service's volume has no backups, and creating a new backup is not available on our current Hobby plan.

We have prepared a diagnostic deployment that would temporarily replace the collector's start command with a minimal process that only reads file sizes and timestamps. It would not open SQLite databases, start the collector, or make provider requests.

Before attempting this, could you please clarify:

  1. Can the existing persistent volume be mounted strictly read-only for such a diagnostic deployment?

  2. If a read-only mount is not supported, does Railway provide any way to obtain an immutable export or snapshot of the existing crashed volume without upgrading the plan or modifying the original files?

  3. If neither is available, is replacing the start command with a non-writing diagnostic process the recommended recovery approach, and what filesystem or volume changes should we expect from the platform itself?

Our priority is preserving the original SQLite databases and their WAL files. We do not want to risk losing the only copy of our historical PAPER data.

Thank you for your guidance.


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


Railway
BOT

a month ago

Volumes are mounted into the container as a regular read/write directory at the mount path, and there's no setting to attach one read-only. Your diagnostic process is what decides whether anything gets written.

We don't offer a downloadable backup archive or an export of a volume taken without a running deployment. Backups and restores also don't give you a read-only copy to browse, because a restore creates a new volume and stages a swap that redeploys the service.

So the way to reach the files is a deployment with the volume attached. A start command that only lists sizes and timestamps is a reasonable way to get one. On the platform side, the redeploy stops the crashed deployment and mounts the same volume into the new container at the start command, as root. The volume isn't mounted during the build or a pre-deploy command, so don't put file checks there. Once that container is running, railway volume files download or SFTP through the service can copy the databases and their WAL/SHM files off before you change anything else.


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


Railway
BOT

25 days 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 • 25 days ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...