GitHub source snapshot fails before build
bondarsvetlana096-cyber
HOBBYOP

21 days ago

Hello,

My production service can no longer complete the GitHub source snapshot.

GitHub-connected deployments repeatedly fail at:

Initialization → Snapshot code

On one attempt Railway reported:

GitHub rejected the credentials Railway used to read the repository. The Railway GitHub App's access to this repository is no longer valid.

A subsequent manual Deploy latest commit attempt remained in Initialization for approximately 55 minutes and then failed with:

snapshot operation was canceled

Neither attempt reached Docker build, container creation, or application startup.

The previous production deployment remains healthy and serving normally. Railway can still display the connected repository, branch and commit metadata, but cannot complete the source snapshot.

I have stopped retrying deployments.

The repository currently contains approximately 6.92 GB of tracked files, mostly static image assets, with approximately 6.91 GB under the backend directory.

Could someone from Railway please clarify:

Whether this error indicates that the Railway GitHub App authorization needs to be repaired.

Whether there is a safe way to refresh the GitHub source authorization without disrupting the currently healthy deployment.

Whether a repository of approximately 6.9 GB is supported by Railway's GitHub source snapshot pipeline.

Whether there is a source snapshot size or timeout limit that could explain the repeated approximately 55-minute cancellation.

I have deliberately not disconnected/reconnected the repository because the existing production deployment is healthy.

Thank you.

$10 Bounty

5 Replies

Railway
BOT

21 days ago

This thread has been opened as a bounty so the community can help solve it.

Status changed to Open Railway • 21 days ago


Have you tried deleting the Railway github app from https://github.com/settings/installations, and installing it again? Relinking the github repo might also help (it won't affect the previous healthy deployment if it fails).


codermitra
HOBBY

21 days ago

Recommended Action Plan

Prerequisite:

Go to GitHub Settings → Installations (https://github.com/settings/installations), locate the Railway app, and verify it has explicit access to your repository. If needed, uninstall and reinstall it, then go to Railway Project Settings → Repository and reconnect your repo. Your live service will stay online throughout.

Temporary Fix : Bypass the Snapshot via Railway CLI (Immediate Workaround)

If you need to push a code change immediately without waiting to refactor your assets:

Install the Railway CLI: npm i -g @railway/cli

Add your static assets folder (e.g., backend/static/images) to a local .railwayignore or .gitignore file.

Run railway login and railway link.

Run railway up from your terminal. This streams your source code directly to Railway, completely bypassing the GitHub source snapshot pipeline and file size bottlenecks.

.Offload Static Assets (Permanent Solution):Best Practice.Remove the 6.9 GB of images from Git history and host them on an object storage service like Cloudflare R2, AWS S3, or a mounted Railway Volume. Storing static assets externally reduces your Git repository size to megabytes and allows snapshots to complete in seconds.


bondarsvetlana096-cyber
HOBBYOP

21 days ago

Thanks. I checked the Railway GitHub App installation directly in GitHub.

The Railway App is currently installed and active. Repository access is set to "All repositories", so the affected repository is already included in the installation's repository access.

The installation is not suspended, and GitHub currently shows the Railway App with the required repository permissions.

This creates an inconsistency:

  • GitHub shows the Railway App as installed, active, and authorized for all repositories.
  • Railway can still resolve the connected repository, branch, and commit metadata.
  • However, Railway previously reported:

"GitHub rejected the credentials Railway used to read the repository. The Railway GitHub App's access to this repository is no longer valid."

  • A subsequent deployment then remained at "Initialization → Snapshot code" for approximately 55 minutes and ended with:

"snapshot operation was canceled"

Neither attempt reached Docker build or application startup.

I also found another recent Railway thread reporting a similar GitHub integration inconsistency: the GitHub App has repository access, but Railway cannot use or resolve that access correctly. In that case, attempting to re-authenticate also resulted in:

"Error authenticating with GitHub"

"Problem completing OAuth login"

Because of this, I am hesitant to uninstall/reinstall the Railway GitHub App or disconnect/reconnect the repository without confirmation, especially because my previous production deployment is currently healthy and serving normally.

Could someone from Railway please confirm:

  1. Whether this can be caused by a stale or invalid installation token / source-integration state on Railway's side even though GitHub shows the App installation as valid.

  2. Whether uninstalling and reinstalling the Railway GitHub App is the recommended next step in this specific situation.

  3. Whether uninstalling/reinstalling the GitHub App or reconnecting the repository can affect the currently healthy production deployment.

  4. Whether there is a safer way to refresh or reset the Railway-side GitHub authorization without disturbing the running deployment.

  5. Whether the approximately 6.92 GB repository size could independently contribute to the source snapshot cancellation, even after the GitHub authorization issue is resolved.

I have stopped retrying deployments and have not changed the GitHub App installation or disconnected the repository.

Thank you.


bondarsvetlana096-cyber

Thanks. I checked the Railway GitHub App installation directly in GitHub. The Railway App is currently installed and active. Repository access is set to "All repositories", so the affected repository is already included in the installation's repository access. The installation is not suspended, and GitHub currently shows the Railway App with the required repository permissions. This creates an inconsistency: - GitHub shows the Railway App as installed, active, and authorized for all repositories. - Railway can still resolve the connected repository, branch, and commit metadata. - However, Railway previously reported: "GitHub rejected the credentials Railway used to read the repository. The Railway GitHub App's access to this repository is no longer valid." - A subsequent deployment then remained at "Initialization → Snapshot code" for approximately 55 minutes and ended with: "snapshot operation was canceled" Neither attempt reached Docker build or application startup. I also found another recent Railway thread reporting a similar GitHub integration inconsistency: the GitHub App has repository access, but Railway cannot use or resolve that access correctly. In that case, attempting to re-authenticate also resulted in: "Error authenticating with GitHub" "Problem completing OAuth login" Because of this, I am hesitant to uninstall/reinstall the Railway GitHub App or disconnect/reconnect the repository without confirmation, especially because my previous production deployment is currently healthy and serving normally. Could someone from Railway please confirm: 1. Whether this can be caused by a stale or invalid installation token / source-integration state on Railway's side even though GitHub shows the App installation as valid. 2. Whether uninstalling and reinstalling the Railway GitHub App is the recommended next step in this specific situation. 3. Whether uninstalling/reinstalling the GitHub App or reconnecting the repository can affect the currently healthy production deployment. 4. Whether there is a safer way to refresh or reset the Railway-side GitHub authorization without disturbing the running deployment. 5. Whether the approximately 6.92 GB repository size could independently contribute to the source snapshot cancellation, even after the GitHub authorization issue is resolved. I have stopped retrying deployments and have not changed the GitHub App installation or disconnected the repository. Thank you.

xertrec
HOBBY

20 days ago

Removing the connection from https://github.com/settings/installations should not affect in any way the currently running deployment as it's only needed for detecting changes and make new deployments. You should remove the current connection, and adding it again, so at least we discard that option, as it's right now the most likely solution


bondarsvetlana096-cyber
HOBBYOP

20 days ago

I followed the recommended recovery procedure.

I disconnected the GitHub source from the siteformo Railway service and connected the same repository again.

Railway successfully showed the repository again, with:

repository: bondarsvetlana096-cyber/siteformo

branch: main

root directory: backend

GitHub auto-deploy enabled

I then performed exactly one Deploy latest commit attempt after the fresh reconnection.

Unfortunately, the result is unchanged.

The deployment remained at:

Initialization → Snapshot code

for 45 minutes 34 seconds, then failed with:

GitHub rejected the credentials Railway used to read "bondarsvetlana096-cyber/siteformo".

The Railway GitHub App's access to this repository is no longer valid.

Build duration: 00:00

Deploy: not started.

Therefore, disconnecting and reconnecting the Railway service source did not refresh or repair the failing GitHub credentials.

On GitHub, the Railway App still appears installed, active, not suspended, and configured for All repositories.

I will not retry further deployments until the authorization issue is understood.

Could Railway please advise whether the next step should now be a full uninstall/reinstall of the Railway GitHub App, or whether this indicates a Railway-side GitHub App/OAuth credential issue?

I would also still appreciate confirmation whether the approximately 6.92 GB repository size is supported by Railway's source snapshot pipeline, since each failed snapshot spends approximately 45–55 minutes in initialization.

Thank you.


Welcome!

Sign in to your Railway account to join the conversation.

Loading...