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

UpdateExternalUser failed: external login user link does not exists #21202

Closed
danieldietsch opened this issue Sep 18, 2022 · 3 comments · Fixed by #21504
Closed

UpdateExternalUser failed: external login user link does not exists #21202

danieldietsch opened this issue Sep 18, 2022 · 3 comments · Fixed by #21504
Labels
Milestone

Comments

@danieldietsch
Copy link

Description

I just updated our staging environment from 1.16.9 to 1.17.2. Everything seems fine, but I receive
...rs/web/auth/oauth.go:1045:handleOAuth2SignIn() [E] [6326e27a-2] UpdateExternalUser failed: external login user link does not exists [userID: 3, loginSourceID: 1] in the logs whenever I login via OAuth2. The login itself works as expected, but I fear this may cause issues down the road.
My OAuth2 provider is OpenID Connect via Keycloak.
gitea doctor --all says everythings fine.

The debug log for such a sign-in looks like this:

2022/09/18 11:18:46 ...s/context/context.go:219:HTML() [D] [6326e276] Template: user/auth/signin
2022/09/18 11:18:46 [6326e276] router: completed GET /user/login?redirect_to=%2f for <IP:PORT>, 200 OK in 2.6ms @ auth/auth.go:149(auth.SignIn)
2022/09/18 11:18:50 [6326e27a] router: completed GET /user/oauth2/keycloak for <IP:PORT>, 307 Temporary Redirect in 2.0ms @ auth/oauth.go:775(auth.SignInOAuth)
2022/09/18 11:18:50 ...rs/web/auth/oauth.go:1045:handleOAuth2SignIn() [E] [6326e27a-2] UpdateExternalUser failed: external login user link does not exists [userID: 3, loginSourceID: 1]
2022/09/18 11:18:50 [6326e27a-2] router: completed GET /user/oauth2/keycloak/callback?state=...&session_state=...&code=... for <IP:PORT>, 303 See Other in 15.1ms @ auth/oauth.go:809(auth.SignInOAuthCallback)
2022/09/18 11:18:50 ...s/context/context.go:219:HTML() [D] [6326e27a-3] Template: user/dashboard/dashboard
2022/09/18 11:18:50 [6326e27a-3] router: completed GET / for <IP:PORT>, 200 OK in 4.3ms @ web/home.go:26(web.Home)
2022/09/18 11:18:50 [6326e27a-4] router: completed GET /repo/search?count_only=1&uid=3&team_id=0&q=&page=1&mode= for <IP:PORT>, 0  in 2.7ms @ repo/repo.go:468(repo.SearchRepo)
2022/09/18 11:18:50 [6326e27a-6] router: completed GET /repo/search?sort=updated&order=desc&uid=3&team_id=0&q=&page=1&limit=15&mode=&archived=false for <IP2:PORT>, 200 OK in 1.8ms @ repo/repo.go:468(repo.SearchRepo)
2022/09/18 11:18:52 [6326e27c] router: completed GET / for <IP2:PORT>, 200 OK in 1.1ms @ web/home.go:26(web.Home)
2022/09/18 11:18:52 ...s/context/context.go:219:HTML() [D] [6326e27c] Template: home

Gitea Version

1.17.2

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

I am running Gitea as docker image gitea/gitea:1.17.2. The DB is mariadb:10.9.2.

Database

MySQL

@flier268
Copy link

I had same issue, too.
Version: 1.17.1 & 1.17.2
Database: Sqlite

gitea | 2022/09/22 05:15:24 [632bef6c] router: completed GET /login/oauth/authorize?client_id=e403e45a-acd9-4f75-bf74-38ad9c607e42&redirect_uri=http%3A%2F%2F192.168.2.16%3A3080%2Flogin&response_type=code&state=d5104dc76695721d for 172.18.0.1:52614, 303 See Other in 178.1ms @ auth/oauth.go:356(auth.AuthorizeOAuth)

@emwgit
Copy link

emwgit commented Sep 25, 2022

Hi all, same here.
Versions: 1.16.9 & 1.17.2
Database: sqlite
oauth2 Provider: Nextcloud

@wolfogre
Copy link
Member

wolfogre commented Sep 27, 2022

Don't worry. It does not affect functionality, and there are no security concerns. It will be fixed ASAP.

@6543 6543 modified the milestones: 1.17.3, 1.17.4 Oct 13, 2022
zeripath pushed a commit that referenced this issue Oct 19, 2022
Fixes #21202
Closes #21276

An `ExternalLoginUser` is not mandatory if the current user account was
created with/by the external login source.
KN4CK3R added a commit to KN4CK3R/gitea that referenced this issue Oct 24, 2022
Fixes go-gitea#21202
Closes go-gitea#21276

An `ExternalLoginUser` is not mandatory if the current user account was
created with/by the external login source.
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants