[E] UserSignIn: not in 2FA session #12634

Closed
opened 2025-11-02 10:16:35 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @ghnp5 on GitHub (Mar 13, 2024).

Description

I updated the docker container (gitea/gitea:latest) to 1.21.8, and now I don't seem to be able to login.
I put username/password, and instead of seeing the 2FA wall, I get a 500 error in the URL: (subdomain.mydomain.com/path)/user/two_factor

Docker logs:

Server listening on :: port 22.
Server listening on 0.0.0.0 port 22.
2024/03/13 05:46:17 cmd/web.go:242:runWeb() [I] Starting Gitea on PID: 16
2024/03/13 05:46:17 cmd/web.go:111:showWebStartupMessage() [I] Gitea version: 1.21.8 built with GNU Make 4.4.1, go1.21.8 : bindata, timetzdata, sqlite, sqlite_unlock_notify
2024/03/13 05:46:17 cmd/web.go:112:showWebStartupMessage() [I] * RunMode: prod
2024/03/13 05:46:17 cmd/web.go:113:showWebStartupMessage() [I] * AppPath: /usr/local/bin/gitea
2024/03/13 05:46:17 cmd/web.go:114:showWebStartupMessage() [I] * WorkPath: /data/gitea
2024/03/13 05:46:17 cmd/web.go:115:showWebStartupMessage() [I] * CustomPath: /data/gitea
2024/03/13 05:46:17 cmd/web.go:116:showWebStartupMessage() [I] * ConfigFile: /data/gitea/conf/app.ini
2024/03/13 05:46:17 cmd/web.go:117:showWebStartupMessage() [I] Prepare to run web server
2024/03/13 05:46:17 routers/init.go:112:InitWebInstalled() [I] Git version: 2.40.1, Wire Protocol Version 2 Enabled (home: /data/gitea/home)
2024/03/13 05:46:17 cmd/web.go:194:serveInstalled() [W] Table session has column created_unix but struct has not related field
2024/03/13 05:46:17 cmd/web.go:194:serveInstalled() [W] Table system_setting Column version db default is , struct default is 1
2024/03/13 05:46:17 cmd/web.go:194:serveInstalled() [W] Table email_address Column lower_email db nullable is true, struct nullable is false
2024/03/13 05:46:17 cmd/web.go:194:serveInstalled() [W] Table user Column keep_activity_private db default is , struct default is false
2024/03/13 05:46:17 cmd/web.go:194:serveInstalled() [W] Table user Column keep_activity_private db nullable is true, struct nullable is false
2024/03/13 05:46:17 cmd/web.go:194:serveInstalled() [W] Table language_stat Column language db nullable is true, struct nullable is false
2024/03/13 05:46:17 cmd/web.go:194:serveInstalled() [W] Table repository Column original_service_type db default is 0, struct default is
2024/03/13 05:46:17 cmd/web.go:194:serveInstalled() [W] Table gpg_key Column content db nullable is true, struct nullable is false
2024/03/13 05:46:17 cmd/web.go:194:serveInstalled() [W] Table gpg_key_import Column content db nullable is true, struct nullable is false
2024/03/13 05:46:17 cmd/web.go:194:serveInstalled() [W] Table public_key Column content db nullable is true, struct nullable is false
2024/03/13 05:46:17 cmd/web.go:194:serveInstalled() [W] Table project column board_type db type is INT, struct type is INT UNSIGNED
2024/03/13 05:46:17 cmd/web.go:194:serveInstalled() [W] Table project column card_type db type is INT, struct type is INT UNSIGNED
2024/03/13 05:46:17 cmd/web.go:194:serveInstalled() [W] Table project Column card_type db default is 0, struct default is
2024/03/13 05:46:17 cmd/web.go:194:serveInstalled() [W] Table project Column card_type db nullable is false, struct nullable is true
2024/03/13 05:46:17 cmd/web.go:194:serveInstalled() [W] Table project column type db type is INT, struct type is INT UNSIGNED
2024/03/13 05:46:17 cmd/web.go:194:serveInstalled() [W] Table label Column archived_unix db default is , struct default is NULL
2024/03/13 05:46:17 cmd/web.go:194:serveInstalled() [W] Table tracked_time Column time db nullable is true, struct nullable is false
2024/03/13 05:46:17 cmd/web.go:194:serveInstalled() [W] Table hook_task has column repo_id but struct has not related field
2024/03/13 05:46:17 cmd/web.go:194:serveInstalled() [W] Table webhook Column is_system_webhook db default is 0, struct default is
2024/03/13 05:46:17 cmd/web.go:194:serveInstalled() [W] Table webhook Column is_system_webhook db nullable is false, struct nullable is true
2024/03/13 05:46:39 ...ters/web/auth/2fa.go:36:TwoFactor() [E] UserSignIn: not in 2FA session
2024/03/13 05:46:50 ...ters/web/auth/2fa.go:36:TwoFactor() [E] UserSignIn: not in 2FA session

Gitea Version

1.21.8

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

2.40.1

Operating System

No response

How are you running Gitea?

Docker: gitea/gitea:latest

docker-compose.yml:

  gitea:
    container_name: gitea
    image: gitea/gitea:latest
    environment:
      - USER_UID=1000
      - USER_GID=1000
      - DB_TYPE=mysql
      - DB_HOST=db:3306
      - RUN_MODE=prod
      - ROOT_URL="https://subdomain.mydomain.com/path/"
    env_file:
      - ./db.env
    restart: always
    networks:
      - gitea
    volumes:
      - /gitea/data:/data
    ports:
      - "127.0.0.1:xxxx:3000"
    depends_on:
      - gitea-db

Database

MySQL/MariaDB

Originally created by @ghnp5 on GitHub (Mar 13, 2024). ### Description I updated the docker container (`gitea/gitea:latest`) to 1.21.8, and now I don't seem to be able to login. I put username/password, and instead of seeing the 2FA wall, I get a 500 error in the URL: (_subdomain.mydomain.com/path_)`/user/two_factor` Docker logs: > Server listening on :: port 22. > Server listening on 0.0.0.0 port 22. > 2024/03/13 05:46:17 cmd/web.go:242:runWeb() [I] Starting Gitea on PID: 16 > 2024/03/13 05:46:17 cmd/web.go:111:showWebStartupMessage() [I] Gitea version: 1.21.8 built with GNU Make 4.4.1, go1.21.8 : bindata, timetzdata, sqlite, sqlite_unlock_notify > 2024/03/13 05:46:17 cmd/web.go:112:showWebStartupMessage() [I] * RunMode: prod > 2024/03/13 05:46:17 cmd/web.go:113:showWebStartupMessage() [I] * AppPath: /usr/local/bin/gitea > 2024/03/13 05:46:17 cmd/web.go:114:showWebStartupMessage() [I] * WorkPath: /data/gitea > 2024/03/13 05:46:17 cmd/web.go:115:showWebStartupMessage() [I] * CustomPath: /data/gitea > 2024/03/13 05:46:17 cmd/web.go:116:showWebStartupMessage() [I] * ConfigFile: /data/gitea/conf/app.ini > 2024/03/13 05:46:17 cmd/web.go:117:showWebStartupMessage() [I] Prepare to run web server > 2024/03/13 05:46:17 routers/init.go:112:InitWebInstalled() [I] Git version: 2.40.1, Wire Protocol Version 2 Enabled (home: /data/gitea/home) > 2024/03/13 05:46:17 cmd/web.go:194:serveInstalled() [W] Table session has column created_unix but struct has not related field > 2024/03/13 05:46:17 cmd/web.go:194:serveInstalled() [W] Table system_setting Column version db default is , struct default is 1 > 2024/03/13 05:46:17 cmd/web.go:194:serveInstalled() [W] Table email_address Column lower_email db nullable is true, struct nullable is false > 2024/03/13 05:46:17 cmd/web.go:194:serveInstalled() [W] Table user Column keep_activity_private db default is , struct default is false > 2024/03/13 05:46:17 cmd/web.go:194:serveInstalled() [W] Table user Column keep_activity_private db nullable is true, struct nullable is false > 2024/03/13 05:46:17 cmd/web.go:194:serveInstalled() [W] Table language_stat Column language db nullable is true, struct nullable is false > 2024/03/13 05:46:17 cmd/web.go:194:serveInstalled() [W] Table repository Column original_service_type db default is 0, struct default is > 2024/03/13 05:46:17 cmd/web.go:194:serveInstalled() [W] Table gpg_key Column content db nullable is true, struct nullable is false > 2024/03/13 05:46:17 cmd/web.go:194:serveInstalled() [W] Table gpg_key_import Column content db nullable is true, struct nullable is false > 2024/03/13 05:46:17 cmd/web.go:194:serveInstalled() [W] Table public_key Column content db nullable is true, struct nullable is false > 2024/03/13 05:46:17 cmd/web.go:194:serveInstalled() [W] Table project column board_type db type is INT, struct type is INT UNSIGNED > 2024/03/13 05:46:17 cmd/web.go:194:serveInstalled() [W] Table project column card_type db type is INT, struct type is INT UNSIGNED > 2024/03/13 05:46:17 cmd/web.go:194:serveInstalled() [W] Table project Column card_type db default is 0, struct default is > 2024/03/13 05:46:17 cmd/web.go:194:serveInstalled() [W] Table project Column card_type db nullable is false, struct nullable is true > 2024/03/13 05:46:17 cmd/web.go:194:serveInstalled() [W] Table project column type db type is INT, struct type is INT UNSIGNED > 2024/03/13 05:46:17 cmd/web.go:194:serveInstalled() [W] Table label Column archived_unix db default is , struct default is NULL > 2024/03/13 05:46:17 cmd/web.go:194:serveInstalled() [W] Table tracked_time Column time db nullable is true, struct nullable is false > 2024/03/13 05:46:17 cmd/web.go:194:serveInstalled() [W] Table hook_task has column repo_id but struct has not related field > 2024/03/13 05:46:17 cmd/web.go:194:serveInstalled() [W] Table webhook Column is_system_webhook db default is 0, struct default is > 2024/03/13 05:46:17 cmd/web.go:194:serveInstalled() [W] Table webhook Column is_system_webhook db nullable is false, struct nullable is true > 2024/03/13 05:46:39 ...ters/web/auth/2fa.go:36:TwoFactor() [E] UserSignIn: not in 2FA session > 2024/03/13 05:46:50 ...ters/web/auth/2fa.go:36:TwoFactor() [E] UserSignIn: not in 2FA session ### Gitea Version 1.21.8 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version 2.40.1 ### Operating System _No response_ ### How are you running Gitea? Docker: `gitea/gitea:latest` docker-compose.yml: ``` gitea: container_name: gitea image: gitea/gitea:latest environment: - USER_UID=1000 - USER_GID=1000 - DB_TYPE=mysql - DB_HOST=db:3306 - RUN_MODE=prod - ROOT_URL="https://subdomain.mydomain.com/path/" env_file: - ./db.env restart: always networks: - gitea volumes: - /gitea/data:/data ports: - "127.0.0.1:xxxx:3000" depends_on: - gitea-db ``` ### Database MySQL/MariaDB
GiteaMirror added the issue/needs-feedbacktype/bug labels 2025-11-02 10:16:35 -06:00
Author
Owner

@wxiaoguang commented on GitHub (Mar 13, 2024):

If you change image to 1.21.7, does it work again? Or does browser's "Private Window" (without any existing cookie) help?

@wxiaoguang commented on GitHub (Mar 13, 2024): If you change `image` to 1.21.7, does it work again? Or does browser's "Private Window" (without any existing cookie) help?
Author
Owner

@ghnp5 commented on GitHub (Mar 13, 2024):

Thank you. Clearing the cookies for the site fixed it.

@ghnp5 commented on GitHub (Mar 13, 2024): Thank you. Clearing the cookies for the site fixed it.
Author
Owner

@wxiaoguang commented on GitHub (Mar 15, 2024):

Thank you for your feedback. Is there still any other problem? 🙏

@wxiaoguang commented on GitHub (Mar 15, 2024): Thank you for your feedback. Is there still any other problem? 🙏
Author
Owner

@ghnp5 commented on GitHub (Mar 15, 2024):

I haven't had a problem since. However, I wonder if there's anything that can be done to prevent anyone from ever getting this in the future? :)

Otherwise, this Issue can be closed.

Thanks!

@ghnp5 commented on GitHub (Mar 15, 2024): I haven't had a problem since. However, I wonder if there's anything that can be done to prevent anyone from ever getting this in the future? :) Otherwise, this Issue can be closed. Thanks!
Author
Owner

@wxiaoguang commented on GitHub (Mar 15, 2024):

I wonder if there's anything that can be done to prevent anyone from ever getting this in the future? :)

I guess this issue is caused by #29534 , the cookies are different on /subpath and /subpath/.

So I think it won't happen in the future because the cookie path should be correct now.

@wxiaoguang commented on GitHub (Mar 15, 2024): > I wonder if there's anything that can be done to prevent anyone from ever getting this in the future? :) I guess this issue is caused by #29534 , the cookies are different on `/subpath` and `/subpath/`. So I think it won't happen in the future because the cookie path should be correct now.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#12634