Railway deploying stale GitHub build and showing "GitHub Repo not found"
anjalivish732
FREEOP

17 days ago

Hi Railway team,

I’m facing an issue where Railway seems to be deploying an older/stale GitHub build instead of the latest code from my repository.

Repository:

pinasystems0/MobileApp

Branch:

main

Root Directory:

/backend

Current problems:

  1. Railway dashboard shows:

"GitHub Repo not found"

even though:

  • the repository still exists
  • the GitHub app is connected
  • auto deploy is enabled
  • GitHub PRs are successfully merging into main
  1. Railway deployment is crashing with:

Cannot find module '../models/InstituteTeacherUpload'

But this module/file was already removed or updated in the latest GitHub codebase.

  1. Local environment and GitHub latest code no longer show this issue, which makes it seem Railway is building an older cached commit or stale deployment state.

What I already tried:

  • Redeploy latest deployment
  • Restart service
  • Reconnect GitHub
  • Push new commits to main
  • Verified repository exists
  • Verified root directory is /backend

Could you please:

  • verify which commit Railway is actually building
  • clear any stale build cache if needed
  • re-sync the GitHub integration
  • force Railway to use the latest main branch state

Thank you.

$10 Bounty

1 Replies

Status changed to Open Railway 17 days ago


sheeki03
FREE

16 days ago

This looks like a source-binding problem first, not a Node module-cache problem.

Two facts point that way:

  1. Railway is showing "GitHub Repo not found".
  2. The running build is failing on a module path that you say no longer exists in the current main branch.

First confirm the actual Git SHA being built. Add a temporary startup/build log line:

echo "Railway git commit: $RAILWAY_GIT_COMMIT_SHA"
echo "Railway git branch: $RAILWAY_GIT_BRANCH"
echo "Railway repo: $RAILWAY_GIT_REPO_OWNER/$RAILWAY_GIT_REPO_NAME"

Compare that SHA against the latest commit on GitHub main. If it is not the current SHA, redeploying the same service will not fix the application error because Railway is still building the wrong source snapshot.

Given the dashboard says "GitHub Repo not found", use this order:

  1. In GitHub, open the Railway GitHub App installation and confirm pinasystems0/MobileApp is included. If the app is set to "Only select repositories", remove and re-add this repo.
  2. In Railway, disconnect/reconnect the service's source repo after the GitHub App access is corrected. Re-select owner pinasystems0, repo MobileApp, branch main, and root directory /backend.
  3. Trigger a new deploy and verify the logged RAILWAY_GIT_COMMIT_SHA matches GitHub main.
  4. If the old SHA still appears, create a new Railway service from the same repo/root rather than redeploying the existing disconnected service. This separates a bad service source binding from an application build issue.
  5. If the new service builds the correct SHA but the old service does not, migrate traffic/env vars to the new service or ask Railway support to repair the old service's source binding.
  6. If even a new service builds the stale SHA, include the old SHA, expected SHA, service id, project id, latest deployment id, branch, and root directory in a Railway support follow-up, because only Railway can clear or repair a backend-side GitHub source/cache issue.

Only debug Cannot find module '../models/InstituteTeacherUpload' after the SHA check proves Railway is building the expected commit. If Railway is building an older SHA, the missing-module error is just a symptom of stale source. If Railway is building the expected SHA, then check case-sensitive import paths, Docker build context/root directory, and whether /backend contains generated files or stale build artifacts referenced by the start command.


Welcome!

Sign in to your Railway account to join the conversation.

Loading...