Netlify thinks Github is not connected

Same error as Build failed -- failed during stage 'preparing repo': error checking for ref: fatal: could not read Username for 'https://github.com': No such device or address

Removing Netlify app on Github then reconnecting with Netlify does not fix the problem.

App ID: c6a61f93-e92a-4afb-b0bb-c057afb74a0d
Site name: kellymiyashiro

For some reason, Netlify does not think Github is connected to my account. It was working fine for a few years and suddenly stopped on July 4.

I have tried disconnecting Github and reconnecting, which makes the “Install the new GitHub App” card go away, but upon refresh it comes back. I see Netlify is correctly setup on Github under Applications, it has access to all my repos.

When trying to deploy manually, I get:

5:22:07 PM: Failed during stage 'preparing repo': error checking for ref: fatal: could not read Username for 'https://github.com': No such device or address

Things I’ve tried:

  • Disconnect and reconnect Netlify to Github
  • Logout and log back in to both Netlify and Github
  • Give access to only certain repos vs all repos
  • Turn off adblockers

Hey @kmiyashiro,

Very strange but not unheard of! So, from our end, we can’t see the site linked to the repo. It may seem tedious but can you please give it another go (remove the Netlify App and try again)?

@Scott just tried removing and adding again, same result.

I’ve tried removing and reconnecting using Firefox as well, just to be sure it’s not any of my extensions somehow blocking the a call somewhere. Same result.

The Github card disappears when I try to connect, but reappears after refreshing/navigating away. This leads me to believe that at least the frontend is getting confirmation that installation succeeded, why would the backend fail to update?

I finally figured it out. Instead of just re-connecting the GitHub app, I had to reconnect the repo, which apparently installs a different kind of GitHub Netlify app.

In the app settings, go to Build & Deploy > Build Settings > Edit Settings > Link to a different repository and select the same repo. This finally reconnected GitHub, which makes me wonder what the “Install the GitHub” card does.