Suddenly unable to login to Gitea via the web interface ONLY, ssh is fine. #13564

Closed
opened 2025-11-02 10:46:10 -06:00 by GiteaMirror · 6 comments
Owner

Originally created by @MarioGalea31 on GitHub (Oct 4, 2024).

Description

Hi there,

I've had my instance up for about 14 months now (in docker), and everything was just perfect until last night, I attempted to log into the web interface to check something. When I log in (with the correct credentials) I am redirected back to the homepage, and not logged in. I can attempt to log in using invalid credentials, and I am warned that the credentials are incorrect, so I don't see this as a fundamental problem. The current running version I have is; 1.22.2.

In testing, there is very little being logged except for;
2024/10/04 10:21:42 ...eb/routing/logger.go:102:func1() [I] router: completed GET / for MY-IP:56012, 200 OK in 4.5ms @ web/home.go:32(web.Home)
2024/10/04 10:21:47 ...eb/routing/logger.go:102:func1() [I] router: completed GET /user/login?redirect_to=%2f for MY-IP:56012, 200 OK in 3.9ms @ auth/auth.go:164(auth.SignIn)
2024/10/04 10:21:50 ...eb/routing/logger.go:102:func1() [I] router: completed POST /user/login for MY-IP:56012, 303 See Other in 94.4ms @ auth/auth.go:196(auth.SignInPost)
2024/10/04 10:21:50 ...eb/routing/logger.go:102:func1() [I] router: completed GET / for MY-IP:56012, 200 OK in 6.5ms @ web/home.go:32(web.Home)

I last logged into the front end on 03/09/2024.

As part of troubleshooting I've rolled back my docker VM to the most recent backup I have available (13/09/24) and the problem persists.

I've also set the version of gitea that the docker container runs to various combinations of older 1.22.x builds and the most recent nightly builds.

I tended to have set up Gitea and not needed to intervene before so I quite happily left it running and updating.

I saw various similar posts here and elsewhere over the years whilst I googled, but nothiing recently or any suggestions that have worked for me in this instance.

Any idea of any changes in the last month that I need to be aware of?

Gitea Version

1.22.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

Docker 26.1.4, on Ubuntu 24.04.1 LTS

How are you running Gitea?

Docker 26.1.4, on Ubuntu 24.04.1 LTS

Database

MySQL/MariaDB

Originally created by @MarioGalea31 on GitHub (Oct 4, 2024). ### Description Hi there, I've had my instance up for about 14 months now (in docker), and everything was just perfect until last night, I attempted to log into the web interface to check something. When I log in (with the correct credentials) I am redirected back to the homepage, and not logged in. I can attempt to log in using invalid credentials, and I am warned that the credentials are incorrect, so I don't see this as a fundamental problem. The current running version I have is; 1.22.2. In testing, there is very little being logged except for; 2024/10/04 10:21:42 ...eb/routing/logger.go:102:func1() [I] router: completed GET / for MY-IP:56012, 200 OK in 4.5ms @ web/home.go:32(web.Home) 2024/10/04 10:21:47 ...eb/routing/logger.go:102:func1() [I] router: completed GET /user/login?redirect_to=%2f for MY-IP:56012, 200 OK in 3.9ms @ auth/auth.go:164(auth.SignIn) 2024/10/04 10:21:50 ...eb/routing/logger.go:102:func1() [I] router: completed POST /user/login for MY-IP:56012, 303 See Other in 94.4ms @ auth/auth.go:196(auth.SignInPost) 2024/10/04 10:21:50 ...eb/routing/logger.go:102:func1() [I] router: completed GET / for MY-IP:56012, 200 OK in 6.5ms @ web/home.go:32(web.Home) I last logged into the front end on 03/09/2024. As part of troubleshooting I've rolled back my docker VM to the most recent backup I have available (13/09/24) and the problem persists. I've also set the version of gitea that the docker container runs to various combinations of older 1.22.x builds and the most recent nightly builds. I tended to have set up Gitea and not needed to intervene before so I quite happily left it running and updating. I saw various similar posts here and elsewhere over the years whilst I googled, but nothiing recently or any suggestions that have worked for me in this instance. Any idea of any changes in the last month that I need to be aware of? ### Gitea Version 1.22.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 Docker 26.1.4, on Ubuntu 24.04.1 LTS ### How are you running Gitea? Docker 26.1.4, on Ubuntu 24.04.1 LTS ### Database MySQL/MariaDB
GiteaMirror added the issue/needs-feedback label 2025-11-02 10:46:10 -06:00
Author
Owner

@lunny commented on GitHub (Oct 4, 2024):

Can you try clean your web browser cache and try again?

@lunny commented on GitHub (Oct 4, 2024): Can you try clean your web browser cache and try again?
Author
Owner

@MarioGalea31 commented on GitHub (Oct 4, 2024):

I've done that, used two different browsers on two machines and a mobile phone :( in incognito mode too :(

@MarioGalea31 commented on GitHub (Oct 4, 2024): I've done that, used two different browsers on two machines and a mobile phone :( in incognito mode too :(
Author
Owner

@charles7668 commented on GitHub (Oct 16, 2024):

Based on the description, is your issue the same as #29451?

@charles7668 commented on GitHub (Oct 16, 2024): Based on the description, is your issue the same as #29451?
Author
Owner

@wxiaoguang commented on GitHub (Oct 16, 2024):

"Unable to login" usually means some cookie problems (>99% cases)

For example, as charles7668 said, using "https" means "https-only cookie", then it doesn't work with http (config option: COOKIE_SECURE)

So you could try to figure out what happens to the login procedure by using browser's console, whether all necessary cookies are correctly handled.

@wxiaoguang commented on GitHub (Oct 16, 2024): "Unable to login" usually means some cookie problems (>99% cases) For example, as charles7668 said, using "https" means "https-only cookie", then it doesn't work with http (config option: COOKIE_SECURE) So you could try to figure out what happens to the login procedure by using browser's console, whether all necessary cookies are correctly handled.
Author
Owner

@wxiaoguang commented on GitHub (Oct 16, 2024):

-> Warn users when they try to use a non-root-url to sign in/up #32272
-> Warn users when they try to use a non-root-url to sign in/up (#32272) #32273

@wxiaoguang commented on GitHub (Oct 16, 2024): -> Warn users when they try to use a non-root-url to sign in/up #32272 -> Warn users when they try to use a non-root-url to sign in/up (#32272) #32273
Author
Owner

@MarioGalea31 commented on GitHub (Oct 16, 2024):

https://github.com/go-gitea/gitea/issues/29451?

No it wasn't this one, I did look at it when searching. Mine refused to work via IP or DNS name.

I got it working again, but I'm not entirely sure. There are two possibilities, the first and more unlikely one, is permissions on the directory of the data for the container. The second and most likely (and I will check this if it comes up again) is that I'd previously specified an email server. I took this email server out of service. Luckily, it was a Poste docker container so I re-instate it, and the associated DNS record for it. Gitea worked. I've since shut down the container, but kept the DNS records, it's all good.

I intend, at some point, to remove the email configuration from Gitea's config, but for now, I'm just happy it's working.

@MarioGalea31 commented on GitHub (Oct 16, 2024): https://github.com/go-gitea/gitea/issues/29451? No it wasn't this one, I did look at it when searching. Mine refused to work via IP or DNS name. I got it working again, but I'm not entirely sure. There are two possibilities, the first and more unlikely one, is permissions on the directory of the data for the container. The second and most likely (and I will check this if it comes up again) is that I'd previously specified an email server. I took this email server out of service. Luckily, it was a Poste docker container so I re-instate it, and the associated DNS record for it. Gitea worked. I've since shut down the container, but kept the DNS records, it's all good. I intend, at some point, to remove the email configuration from Gitea's config, but for now, I'm just happy it's working.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#13564