Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authentication failed issue #18586

Closed
trains78 opened this issue May 9, 2024 · 56 comments
Closed

Authentication failed issue #18586

trains78 opened this issue May 9, 2024 · 56 comments

Comments

@trains78
Copy link

trains78 commented May 9, 2024

The problem

Github Dekstop updated to 3.3.15 and is now asking for credentials to fetch everytime. We use Azure DevOps repo with Personal access tokens. Anyone on our team with 3.3.14 is not having this issue. We receive the following error everytime even when updating the access token on Azure.
image
image

Release version

3.3.15

Operating system

Windows 11

Steps to reproduce the behavior

Fetch any repo from private repo on Azure Devops

Log files

2024-05-09.desktop.production.log

Screenshots

image
image

Additional context

Have about 20 members on the team and anyone who has version 3.3.15 and up of Github Desktop is having this issue. Anyone with 3.3.14 is not.

@tidy-dev
Copy link
Contributor

tidy-dev commented May 9, 2024

@trains78 Can you please update to the latest (being 3.3.17) and let us know if you are still having issues?

@steveward
Copy link
Member

steveward commented May 9, 2024

Thanks for the issue @trains78. This should be fixed in the latest release of GitHub Desktop.

Could you please try holding down Alt on your keyboard and then clicking on the Check for updates button (it'll change its text to Ensure latest version)? Once the new version has been installed please let us know if you run into any issues.

@steveward steveward added the more-info-needed The submitter needs to provide more information about the issue label May 9, 2024
@trains78
Copy link
Author

trains78 commented May 9, 2024

Thank you for the quick response. We are still having this issue with one of our developers after taking the suggested steps

![image](https://github.com/desktop/desktop/assets/169380912/71903d7e-f633-49be
2024-05-09.desktop.production (1).log
-90d8-c4fc88a04930)

@github-actions github-actions bot removed the more-info-needed The submitter needs to provide more information about the issue label May 9, 2024
@tidy-dev
Copy link
Contributor

tidy-dev commented May 9, 2024

Just to make sure I understand: You have 19 devs that can access the same repositories that is failing for the one on 3.3.17?

If so could you make sure that that user is using a valid PAT and try to authenticate again.

@tidy-dev tidy-dev added the more-info-needed The submitter needs to provide more information about the issue label May 9, 2024
@poblish
Copy link

poblish commented May 9, 2024

I have started to see this today with 3.3.17 when trying to push to a self-hosted Gogs repo on localhost. I've never had any problems doing that until today (multiple years of use, many times per day). I've had to switch to doing Open in Terminal and pushing from there. No auth or PAT is involved here. Using macOS 14.4.1 (23E224)

By contrast, pushing to our private Github repos is all fine.

Looking at the release history, I can't be sure whether I was using 3.3.15 or 3.3.16 before I noticed the upgrade announcement and clicked on it this evening, but I am 100% on 3.3.17 now.

I see this issue has some history, so apologies if I've posted in the wrong place 😊


This might help:

2024-05-09T23:59:16.219Z - info: [ui] askPassHandler: no account found for localhost
2024-05-09T23:59:37.908Z - info: [ui] askPassHandler: user cancelled generic git authentication
2024-05-09T23:59:37.919Z - info: [ui] Executing fetch: git -c credential.helper= fetch --progress --prune --recurse-submodules=on-demand origin (took 21.736s)
2024-05-09T23:59:37.919Z - error: [ui] `git -c credential.helper= fetch --progress --prune --recurse-submodules=on-demand origin` exited with an unexpected code: 128.
stderr:
fatal: Authentication failed for 'http://localhost:3000/aregan/MyRepo.git/'

(The error was parsed as 2: Authentication failed. Some common reasons include:

- You are not logged in to your account: see GitHub Desktop > Settings.
- You may need to log out and log back in to refresh your token.
- You do not have permission to access this repository.
- The repository is archived on GitHub. Check the repository settings to confirm you are still permitted to push commits.
- If you use SSH authentication, check that your key is added to the ssh-agent and associated with your account.
- If you use SSH authentication, ensure the host key verification passes for your repository hosting service.
- If you used username / password authentication, you might need to use a Personal Access Token instead of your account password. Check the documentation of your repository hosting service.)
2024-05-09T23:59:41.986Z - info: [ui] askPassHandler: no account found for localhost

@JoseIvanHernandez

This comment has been minimized.

@herobrinePerssion
Copy link

Is there anyone can fix this ?

@trains78
Copy link
Author

Just to make sure I understand: You have 19 devs that can access the same repositories that is failing for the one on 3.3.17?

If so could you make sure that that user is using a valid PAT and try to authenticate again.

At least one. I haven’t had all update just yet. The ones that have greater than 3.3.14 have this issue. Created new PAT. Uninstalled / Reinstalled. Cloned repo again. Issue remains.
I was able to follow the steps above and do not have an issue. But the folks that were seeing it originally still do after Ensure latest update.

@github-actions github-actions bot removed the more-info-needed The submitter needs to provide more information about the issue label May 10, 2024
@niik
Copy link
Member

niik commented May 10, 2024

@poblish I see that you're using repositories over unencrypted http, we fixed a regression related to this scenario in #18589 and we've released it to our beta channel. Could you please try installing our beta version from https://desktop.github.com/beta/ and try again?

@herobrinePerssion Could you please open a new issue and provide some more details and a log file? Before doing so please make sure you've also updated to the latest beta version from https://desktop.github.com/beta/.

@trains78 We fixed a few bugs in rapid succession in 3.3.16 and 3.3.17. If the issue persist for users on 3.3.17 please have one of them open a new issue and include a log file so that we can investigate. Thanks!

@RoHeck
Copy link

RoHeck commented May 10, 2024

I have the same problem (with Azure DevOps). Is there a way to install/download an older version of github-desktop?

@niik
Copy link
Member

niik commented May 10, 2024

@RoHeck What version of GitHub Desktop are you on right now? If it's 3.3.17 could you please
open a new issue and upload a log file from GitHub Desktop so that I could get some more information about this issue? To access the log files go to the file menu in GitHub Desktop and select Help > Show Logs in Finder (macOS) or Explorer (Windows).

The log files are created daily -- please upload a log file as an attachment from a day where you experienced the issue. Thanks!

@poblish
Copy link

poblish commented May 10, 2024

@niik Just downloaded Version 3.3.18-beta1 (x64) and the situation is unchanged there.

@sergiou87
Copy link
Member

@poblish could you share the new logs with 3.3.18-beta1, please? 🙏 Thank you!

@poblish
Copy link

poblish commented May 10, 2024

@poblish could you share the new logs with 3.3.18-beta1, please? 🙏 Thank you!

Sure - this is from performing a Fetch on my repo:

2024-05-10T09:24:52.893Z - info: [ui] Subscribed 'poblish' to Alive channel
2024-05-10T09:24:52.945Z - info: [ui] [AppStore] loading 173 repositories from store
2024-05-10T09:24:52.946Z - info: [ui] [AppStore] found account: poblish (Andrew Regan)
2024-05-10T09:24:53.670Z - info: [ui] launching: 3.3.18-beta1 (Mac OS 14.4.1)
2024-05-10T09:24:56.491Z - info: [ui] askPassHandler: no account found for localhost
2024-05-10T09:24:57.819Z - info: [ui] askPassHandler: user cancelled generic git authentication
2024-05-10T09:24:57.829Z - info: [ui] Executing fetch: git -c credential.helper= fetch --progress --prune --recurse-submodules=on-demand origin (took 1.390s)
2024-05-10T09:24:57.829Z - error: [ui] `git -c credential.helper= fetch --progress --prune --recurse-submodules=on-demand origin` exited with an unexpected code: 128.
stderr:
fatal: Authentication failed for 'http://localhost:3000/aregan/MyRepo.git/'

(The error was parsed as 2: Authentication failed. Some common reasons include:

- You are not logged in to your account: see GitHub Desktop > Settings.
- You may need to log out and log back in to refresh your token.
- You do not have permission to access this repository.
- The repository is archived on GitHub. Check the repository settings to confirm you are still permitted to push commits.
- If you use SSH authentication, check that your key is added to the ssh-agent and associated with your account.
- If you use SSH authentication, ensure the host key verification passes for your repository hosting service.
- If you used username / password authentication, you might need to use a Personal Access Token instead of your account password. Check the documentation of your repository hosting service.)

git version 2.45.0

@niik
Copy link
Member

niik commented May 10, 2024

@poblish only looking at the log this looks like a legitimate auth failure. I know you said that there's no username involved there but the host at http://localhost:3000 is requesting credentials and that's why Desktop is asking you.

I'm afraid I'm not familiar with Gogs but could you double check your configuration to see if it is set up to require credentials?

@poblish
Copy link

poblish commented May 10, 2024

@poblish only looking at the log this looks like a legitimate auth failure. I know you said that there's no username involved there but the host at http://localhost:3000 is requesting credentials and that's why Desktop is asking you.

I'm afraid I'm not familiar with Gogs but could you double check your configuration to see if it is set up to require credentials?

Well, yes, If I run git -c credential.helper= fetch at the CLI, then I am indeed asked for a username, and with the default creds helper (git fetch) I don't need to, but has there been some change in the app - deliberate or not - to circumvent the default helper or git config, or is this just a coincidence and actually a git change? 2 days ago is the last time I know this was definitely working. I wouldn't mind trying an older Desktop build if one is available.

@niik
Copy link
Member

niik commented May 10, 2024

@poblish GitHub Desktop has never run the default credential helper so there's no change there. What has happened though is that due to a change in how we store credentials (and an oversight related to servers running on non-standard ports) your instance has "forgotten" the credentials previously stored for your Gogs server. If you enter the correct credentials again Desktop will store them and not ask you for them again.

@poblish
Copy link

poblish commented May 10, 2024

@poblish GitHub Desktop has never run the default credential helper so there's no change there. What has happened though is that due to a change in how we store credentials (and an oversight related to servers running on non-standard ports) your instance has "forgotten" the credentials previously stored for your Gogs server. If you enter the correct credentials again Desktop will store them and not ask you for them again.

Thanks @niik. I reauthenticated once in Desktop, and everything is now working as before. I'm back on 3.3.17 and all is well.

@niik
Copy link
Member

niik commented May 10, 2024

@poblish I'm glad to hear that. Thanks for reporting back and sorry for the inconvenience!

@Gabriel-Lacatus
Copy link

Since updating to 3.3.17 today it has complained numerous times about authentication. All for the same repository, in Azure DevOps.
In a few cases I click "Fetch", the login popup appears, I generate new Git credentials in DevOps and put them in, then it starts doing stuff and, before finalizing the Fetch, the login popups appears again...

I did notice it started asking for credentials a lot more frequent in the past couple of months compared to before but today it has happened excessively. I don't think credentials expire in a matter of few hours though...

It is also hard to reproduce "on demand" because it happens randomly and there is nothing special that needs to be done other than doing a simple Fetch.

@trains78
Copy link
Author

Since updating to 3.3.17 today it has complained numerous times about authentication. All for the same repository, in Azure DevOps. In a few cases I click "Fetch", the login popup appears, I generate new Git credentials in DevOps and put them in, then it starts doing stuff and, before finalizing the Fetch, the login popups appears again...

I did notice it started asking for credentials a lot more frequent in the past couple of months compared to before but today it has happened excessively. I don't think credentials expire in a matter of few hours though...

It is also hard to reproduce "on demand" because it happens randomly and there is nothing special that needs to be done other than doing a simple Fetch.

This has been our experience as well. When it happens again, I will post the logs.

@Gabriel-Lacatus
Copy link

Looking at the logs, I can see that the errors do not come from the repository that I'm doing the Fetch on but for the other repos that are cloned locally.

So you do a Fetch on repo X and apparently it just tries to refresh credentials for repo Y and presents you with the popup.
This is what the logs usually show:

error: [ui] `git -c credential.helper= fetch --progress --prune --recurse-submodules=on-demand origin` exited with an unexpected code: 128.
stderr:
fatal: Authentication failed for 'https://dev.azure.com/repo_path_redacted/'

(The error was parsed as 4: Authentication failed. Some common reasons include:
...

@tidy-dev
Copy link
Contributor

So you do a Fetch on repo X and apparently it just tries to refresh credentials for repo Y and presents you with the popup.
This is what the logs usually show:

For context, there is a periodic fetch of all repos that happens on an interval and if authentication fails there it will not show you a popup nor error, but it will log the error. Thus, likely that is what you are seeing in your logs.

@Gabriel-Lacatus
Copy link

No, I'm afraid this is not currently the case. Just a few seconds ago I clicked Fetch on the open repo and the login popup appeared. I opened the log and I found authentication errors for 3 unrelated repos at around the current timestamp.

I smell something here... I think the periodic refresh that's supposed to work in the background somehow "spills" into the UI and is causing the login popup to appear.

@tidy-dev
Copy link
Contributor

Interesting. Any chance you have submodules?

@MatthewSteeples
Copy link

@Gabriel-Lacatus I don't know if this is a helpful mitigation at all, but Azure DevOps ignores the username when authenticating, so you can put whatever you want in there to make it unique for your purposes

@Airell
Copy link

Airell commented May 16, 2024

@trains78 Can you please update to the latest (being 3.3.17) and let us know if you are still having issues?

Still an issue in 3.3.18 (and using the DevOps repository in OCI, GutHub and company hosted Gitea).

@trains78
Copy link
Author

@trains78 Can you please update to the latest (being 3.3.17) and let us know if you are still having issues?

Still an issue in 3.3.18 (and using the DevOps repository in OCI).

My developers and I resolved this issue with updating to the latest version using the altKey and "Ensure Latest Version" For me this updated to 3.3.17. But currently using 3.3.18 without the error.

@WizardJosh
Copy link

Just chiming in as well as this happened to me this morning on 3.3.18 Update. I found GithubDesktop.exe in /Users/MyUsername/AppData/Local/GutHubDesktop -- There are folders starting with app-version # I simply renamed the app-3.3.18 folder to something different and the exe launched the 3.3.17 version. Just FYI if someone needs a quick workaround while this is looked into.

@Gabriel-Lacatus
Copy link

@Gabriel-Lacatus I don't know if this is a helpful mitigation at all, but Azure DevOps ignores the username when authenticating, so you can put whatever you want in there to make it unique for your purposes

Yes, any user name is accepted but the app is very keen on deleting stored credentials for the first Org after I switch to the second Org and get the authentication error. So again a game of whack-a-mole:

  • select Repo 1 on Org A
  • login dialog appears
  • go to Dev Ops in Org A, generate credentials
  • use unique user name but the generated password above
  • Fetch/Pull on Repo 1 works
  • I can see the credentials stored in Credential Manager
  • select Repo 2 on Org B
  • click Fetch, the Authentication Failed error popup appears (not the login dialog!)
  • check in Credential Manager, the credentials for Org A is now deleted
  • dismiss error popup
  • click Fetch Again, now the login dialog appears
  • go to Dev Ops in Org B, generate credentials
  • use unique user name but the generated password above
  • check in Credential Manager and the credential for Org B is stored
  • Fetch/Pull on Repo 2 in Org B now works
  • select Repo 1 in Org A
  • click Fetch... you guessed it... authentication error popup 😡

@hszequel
Copy link

See this comment: #18612 (comment)

@weixihd
Copy link

weixihd commented May 17, 2024

I started with version 3.3.17, and suddenly one day I needed to authenticate every operation. I later updated the version to 3.3.18, but the problem still exists. My colleague does not have this problem. What can I do to solve this problem?

@tilemanrenovations
Copy link

Hello there me. I’m glad to hear you’re doing well now. lol. Well I always say you always laughing or crying and I’d rather laugh. That’s just me though lol.

@tilemanrenovations
Copy link

Sorry for the blog. It’s against the rules you know.

@sergiou87
Copy link
Member

Hello 👋

Please, try the latest beta (3.3.19-beta2) from https://desktop.github.com/beta which includes support for multiple git credentials on the same host based on different repository paths and let us know if it works.

After updating, you might need to re-enter your credentials for your Azure DevOps repositories.

For hosts other than dev.azure.com, you might need to set useHttpPath to true for whatever domain your repos are hosted on. For example, for gitlab:

git config --global credential.https://gitlab.com.useHttpPath true

Thank you for your patience 🙏

@Airell
Copy link

Airell commented May 24, 2024

With 3.3.19-beta2 still unable to connect to OCI DevOps Repository on 'https://devops.scmservice.eu-amsterdam-1.oci.oraclecloud.com' . Works on 3.3.14 with <tenant>/<user-email> + Auth token .

Cleaned my Windows Credentials and have tried git config --global credential.https://devops.scmservice.eu-amsterdam-1.oci.oraclecloud.com.useHttpPath true .

[credential "https://devops.scmservice.eu-amsterdam-1.oci.oraclecloud.com"]
	provider = generic
	useHttpPath = true

@sergiou87
Copy link
Member

@Airell could you share your log files, please? 🙏

@Gabriel-Lacatus
Copy link

so far so good, will keep an eye on this

@Airell
Copy link

Airell commented May 24, 2024

@Airell could you share your log files, please? 🙏

I reverted back to 3.3.14, updated to the 3.3.19-beta2 again to collect logs, but now it seems to work... 🤔

@Woudjee
Copy link

Woudjee commented May 26, 2024

@sergiou87 I just checked out your the comment you referenced in the other thread. So if I understand correctly:

  • It's a known issue
  • In the beta version you mentioned, I will most likely not experience the issue?

If that's the case, I will try it out next week when I'm on my work laptop again :) Thank you!

@sergiou87
Copy link
Member

Yes, that should be the case 🤞🤞🤞

Please, let us know if it works qhen you try it!

Thank you for your patience 💖

@Gabriel-Lacatus
Copy link

so far so good, will keep an eye on this

This is looking good. I've tried many combinations of different repos in the same Org, in different Orgs, etc
I've not seen the login popup after I provided credentials to the new beta version.

Ship it! 🚢🚢🚢

@sergiou87
Copy link
Member

Thank you for your feedback @Gabriel-Lacatus 🙇‍♂

We're still investigating some issues reported on this beta. We think they're not related to the fix we introduced, but we want to be sure before promoting it to production.

@alison985
Copy link

I am having this issue in Github Desktop - Version 3.3.12-linux2 (x64) when trying to clone a Github.com private repo that I own in an organization that I own.

I thought the contractor I had working on it had messed something up, but I made a brand new repo and can't clone that either. It prompts for username and password with a mention of a PAT. My UN/PW doesn't work and my UN/PAT doesn't work.

A previously cloned repo will not accept pushes and gives the authentication failed message with the bulletted list,. not the UN/PW options. Github Desktop is signed into Github.com in the Accounts section of Github Desktop Options. I have tried logging out and back in - no change.

@yechenchao
Copy link

Still an issue for me on 3.3.18 on macos to connect to azure devops, is 3.3.19 coming out soon?

@sergiou87
Copy link
Member

@yechenchao @Gabriel-Lacatus @Airell You can download 3.4.0 now from https://desktop.github.com (auto-updates are rolled out progressively and might take longer)

Closing this now, thank you for your patience 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests