Deploy Error — Request failed with status code 401

Title: Deploy Error — Request failed with status code 401

Hello,

I am trying to deploy my app on Streamlit Community Cloud and I keep getting this error when clicking the Deploy button:

Error
Request failed with status code 401

App details:

Streamlit version: 1.38
Python version: 3.12

What I tried so far:

  1. Entered the full GitHub URL in the deployment form
  2. Used the interactive picker to select the repository
  3. Cleared browser cache and tried in Incognito mode
  4. Signed out and signed back in with GitHub
  5. Checked GitHub Settings → Applications → Streamlit OAuth — it shows as authorized
  6. Also encountered Error Code 1ST on a previous attempt before this 401 error

The error appears immediately when clicking Deploy — no build log is shown at all.

requirements.txt is present in the repository with all dependencies listed.

Is this a GitHub OAuth permissions issue? Does Streamlit need specific repository access grants? Any help is appreciated.

Thank you.

Welcome to the Streamlit community and thanks for the detailed info! :blush: A 401 error during deployment on Streamlit Community Cloud almost always points to an authentication or GitHub OAuth permissions issue—specifically, Streamlit doesn’t have the right access to your repo or your GitHub session has expired. This can happen even if the Streamlit OAuth app appears as authorized in your GitHub settings.

To resolve this, try the following steps (in order):

  1. Go to your GitHub account settings → Applications → Authorized OAuth Apps, find “Streamlit”, and click “Revoke”.
  2. Sign out of Streamlit Community Cloud completely.
  3. Sign back in to Streamlit Community Cloud and reconnect your GitHub account, making sure to grant access to all necessary repositories (especially if your repo is private or under an organization).
  4. Try deploying again.

If your repo is under a GitHub organization, ensure the organization owner has granted Streamlit access to the org (see the “Organization access” section in the official docs). You must have admin permissions on the repo to deploy. If you see a “pending” or “denied” status for org access, follow up with the org owner to approve it.

For more details, see:

If you’re still stuck, please share a minimum reproducible example or your repo link so others can help debug. Community members, feel free to jump in with your experiences!

Sources: