GitHub repo cannot be connected: "Invalid GitHub OAuth callback"
jim-lgtm
PROOP

11 days ago

Railway user ID: 50bea76a-58dc-424f-ac48-6c96ea8bb7b2

Project: profit-simulator (ed22556e-3fb8-4dee-9334-6d4e0ae7a078)

Environment: production (89620c61-d8d7-4295-b191-6824bbb1ab49)

Service: 01e36438-34f6-4571-9a2a-37a3894d0bcc

Repo I am trying to connect: github.com/jim-lgtm/profit-simulator (private)

Problem

I cannot connect this service to its GitHub repository. Starting the GitHub

authorisation flow from the Railway dashboard fails and returns:

Invalid GitHub OAuth callback

It fails every time, so the service has never been linked to the repo and I

have no way to enable deploy-on-push.

What I have tried

  • Starting the connect flow from the service Settings page, repeatedly.
  • Signing out of Railway and back in before retrying.

Impact

Because the repo will not link, my only way to ship is "railway up" from a

local folder. That uploads whatever happens to be on disk rather than a known

commit, and it has already cost me: an out-of-date folder was uploaded over a

good deployment and I lost several days of source. Deploy-on-push from GitHub

is the fix for that, and it is the thing I cannot turn on.

What I am asking

  1. Can you see why the OAuth callback is rejected for my account, and clear

    whatever state is causing it?

  2. If it cannot be fixed from your side, is there another way to attach this

    service to the repo (server-side link, GitHub App reinstall, or a

    deploy-from-GitHub setup done by support)?

$20 Bounty

2 Replies

Railway
BOT

11 days ago

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

Status changed to Open Railway 11 days ago


shuaib-mk
FREE

2 hours ago

hiiii,

This is a known Railway-side bug in the GitHub OAuth callback, not an issue with your account setup or GitHub permissions.

Fix: go to https://railway.com/account → Account Integrations, and click Connect under GitHub there, not from the service's Settings → Connect Source page. Reconnecting GitHub at the account level first clears this exact "Invalid GitHub OAuth callback" error. Once that's connected, go back to your service Settings and link the repo, it should go through.

In the meantime, to stop railway up from overwriting deployments with stale local state: always deploy from a clean checkout of the exact commit (git clone → git checkout into a fresh folder, then railway up from there), or set up a GitHub Actions workflow that runs railway up with a Railway API token on push, that gives you deploy-on-push without needing the native GitHub App connection while this gets sorted.


vihanga-himantha
HOBBY

an hour ago

Hi,

Try this,

1.Revoke Railway on GitHub: Go to your GitHub Settings > Applications > Authorized OAuth Apps, locate Railway, and revoke its access.

2.Uninstall the GitHub App: Switch to the Installed GitHub Apps tab in GitHub settings. Click Configure next to Railway, scroll to the "Danger Zone" at the bottom, and click Uninstall.

3.Clear active sessions: Log out of both your Railway and GitHub accounts.

4.Retry in a clean environment: Crucial for callback issues.Open an Incognito/Private browsing window. Ensure all ad-blockers, tracking protectors, or privacy shields (like Brave Shields) are temporarily disabled, as they frequently block OAuth callback parameters. Log back in and attempt the connection again.


Welcome!

Sign in to your Railway account to join the conversation.

Loading...