gogs / gogs

Gogs is a painless self-hosted Git service
https://gogs.io
MIT License
45.05k stars 4.86k forks source link

重启gogs后无法使用了 #7790

Open houk0632 opened 2 months ago

houk0632 commented 2 months ago

Gogs version

gogs/gogs:0.13.0

Git version

Operating system

CentOS 7

Database

mysql

Describe the bug

在docker中安装了gogs,初始配置完成后,能够正常网页登录。当服务器重启或是重启gogs容器后,gogs无法登录网页,git提交失败,发现3000端口启动失败。

To reproduce

2024-08-23 19:52:28 usermod: no changes 2024-08-23 19:52:28 Aug 23 11:52:28 syslogd started: BusyBox v1.33.1 2024-08-23 19:52:28 2024/08/23 11:52:28 [ WARN] Custom config "/data/gogs/conf/app.ini" not found. Ignore this warning if you're running for the first time 2024-08-23 19:52:28 2024/08/23 11:52:28 [TRACE] Log mode: Console (Trace) 2024-08-23 19:52:28 2024/08/23 11:52:28 [ INFO] Gogs 0.12.11 2024-08-23 19:52:28 2024/08/23 11:52:28 [TRACE] Work directory: /app/gogs 2024-08-23 19:52:28 2024/08/23 11:52:28 [TRACE] Custom path: /data/gogs 2024-08-23 19:52:28 2024/08/23 11:52:28 [TRACE] Custom config: /data/gogs/conf/app.ini 2024-08-23 19:52:28 2024/08/23 11:52:28 [TRACE] Log path: /app/gogs/log 2024-08-23 19:52:28 2024/08/23 11:52:28 [TRACE] Build time: 2023-02-25 06:55:24 UTC 2024-08-23 19:52:28 2024/08/23 11:52:28 [TRACE] Build commit: c9fba3cb30af0789fcf89098dfcb8f2286ee7d3b 2024-08-23 19:52:28 2024/08/23 11:52:28 [ INFO] Run mode: Development 2024-08-23 19:52:28 Aug 23 11:52:28 sshd[65]: Server listening on :: port 22. 2024-08-23 19:52:28 Aug 23 11:52:28 sshd[65]: Server listening on 0.0.0.0 port 22. 2024-08-23 19:52:28 2024/08/23 11:52:28 [ INFO] Listen on http://0.0.0.0:3000 2024-08-23 19:52:33 2024/08/23 11:52:33 [TRACE] Session ID: 3f85434aeb24f021 2024-08-23 19:52:33 2024/08/23 11:52:33 [TRACE] CSRF Token: 3LPMqgmfLJczKV814hS7NmmCsYE6MTcyNDQxMzk1MzA4NjQwMzczNA 2024-08-23 19:52:33 2024/08/23 11:52:33 [TRACE] Session ID: 3f85434aeb24f021 2024-08-23 19:52:33 2024/08/23 11:52:33 [TRACE] CSRF Token: z55YN40KwlZNtG882XcHOKxtr3Y6MTcyNDQxMzk1MzA5MDMwOTcxMQ 2024-08-23 19:52:33 2024/08/23 11:52:33 [TRACE] Template: install 2024-08-23 19:52:40 Aug 23 11:52:40 syslogd exiting 2024-08-23 19:52:41 usermod: no changes 2024-08-23 19:52:41 Aug 23 11:52:41 syslogd started: BusyBox v1.33.1 2024-08-23 19:52:41 2024/08/23 11:52:41 [ WARN] Custom config "/data/gogs/conf/app.ini" not found. Ignore this warning if you're running for the first time 2024-08-23 19:52:41 2024/08/23 11:52:41 [TRACE] Log mode: Console (Trace) 2024-08-23 19:52:41 2024/08/23 11:52:41 [ INFO] Gogs 0.12.11 2024-08-23 19:52:41 2024/08/23 11:52:41 [TRACE] Work directory: /app/gogs 2024-08-23 19:52:41 2024/08/23 11:52:41 [TRACE] Custom path: /data/gogs 2024-08-23 19:52:41 2024/08/23 11:52:41 [TRACE] Custom config: /data/gogs/conf/app.ini 2024-08-23 19:52:41 2024/08/23 11:52:41 [TRACE] Log path: /app/gogs/log 2024-08-23 19:52:41 2024/08/23 11:52:41 [TRACE] Build time: 2023-02-25 06:55:24 UTC 2024-08-23 19:52:41 2024/08/23 11:52:41 [TRACE] Build commit: c9fba3cb30af0789fcf89098dfcb8f2286ee7d3b 2024-08-23 19:52:41 2024/08/23 11:52:41 [ INFO] Run mode: Development 2024-08-23 19:52:41 Aug 23 11:52:41 sshd[29]: Server listening on :: port 22. 2024-08-23 19:52:41 Aug 23 11:52:41 sshd[29]: Server listening on 0.0.0.0 port 22. 2024-08-23 19:52:41 2024/08/23 11:52:41 [ INFO] Listen on http://0.0.0.0:3000 2024-08-23 19:52:43 2024/08/23 11:52:43 [TRACE] Session ID: e1d416e4379e6e87 2024-08-23 19:52:43 2024/08/23 11:52:43 [TRACE] CSRF Token: ioFrNtWs1fieEB0nZqyt301H3346MTcyNDQxMzk2MzkwNjUxNjY3OA 2024-08-23 19:52:43 2024/08/23 11:52:43 [TRACE] Template: install 2024-08-23 19:52:44 2024/08/23 11:52:44 [TRACE] Session ID: e1d416e4379e6e87 2024-08-23 19:52:44 2024/08/23 11:52:44 [TRACE] CSRF Token: gcemwaWDMIskv1PIpOaY8m40pRU6MTcyNDQxMzk2NDY1Mjc3MzgwMA 2024-08-23 19:52:44 2024/08/23 11:52:44 [TRACE] Template: install 2024-08-23 19:54:00 2024/08/23 11:54:00 [TRACE] Session ID: e1d416e4379e6e87 2024-08-23 19:54:00 2024/08/23 11:54:00 [TRACE] CSRF Token: Kddlyt4Q6EaqoTLeH-buLW95t1E6MTcyNDQxNDA0MDkxNDUxMDM0Nw 2024-08-23 19:54:00 2024/08/23 11:54:00 [TRACE] Template: install 2024-08-23 19:54:06 2024/08/23 11:54:06 [TRACE] Session ID: e1d416e4379e6e87 2024-08-23 19:54:06 2024/08/23 11:54:06 [TRACE] CSRF Token: a8LNpMNpW9uANJV3DWkWFE_zpPM6MTcyNDQxNDA0NjgxMjMzMjg5Nw 2024-08-23 19:54:06 [xorm] [warn] 2024/08/23 11:54:06.840610 Table repository has column is_unlisted but struct has not related field 2024-08-23 19:54:06 [xorm] [warn] 2024/08/23 11:54:06.853530 Table access Column user_id db nullable is false, struct nullable is true 2024-08-23 19:54:06 [xorm] [warn] 2024/08/23 11:54:06.853544 Table access Column repo_id db nullable is false, struct nullable is true 2024-08-23 19:54:06 [xorm] [warn] 2024/08/23 11:54:06.853545 Table access column mode db type is BIGINT(20), struct type is INT 2024-08-23 19:54:06 [xorm] [warn] 2024/08/23 11:54:06.853545 Table access Column mode db nullable is false, struct nullable is true 2024-08-23 19:54:06 [xorm] [warn] 2024/08/23 11:54:06.867453 Table follow Column user_id db nullable is false, struct nullable is true 2024-08-23 19:54:06 [xorm] [warn] 2024/08/23 11:54:06.867467 Table follow Column follow_id db nullable is false, struct nullable is true 2024-08-23 19:54:06 [xorm] [warn] 2024/08/23 11:54:06.872093 Table action column op_type db type is BIGINT(20), struct type is INT 2024-08-23 19:54:06 [xorm] [warn] 2024/08/23 11:54:06.872105 Table action column act_user_name db type is LONGTEXT, struct type is VARCHAR(255) 2024-08-23 19:54:06 [xorm] [warn] 2024/08/23 11:54:06.872106 Table action column repo_user_name db type is LONGTEXT, struct type is VARCHAR(255) 2024-08-23 19:54:06 [xorm] [warn] 2024/08/23 11:54:06.872108 Table action column repo_name db type is LONGTEXT, struct type is VARCHAR(255) 2024-08-23 19:54:06 [xorm] [warn] 2024/08/23 11:54:06.872108 Table action column ref_name db type is LONGTEXT, struct type is VARCHAR(255) 2024-08-23 19:54:06 [xorm] [warn] 2024/08/23 11:54:06.872110 Table action column content db type is LONGTEXT, struct type is TEXT 2024-08-23 19:54:06 2024/08/23 11:54:06 [TRACE] Log mode: File (Info) 2024-08-23 19:54:07 [git-module] [timeout: 1m0s] git version 2024-08-23 19:54:07 git version 2.32.6 2024-08-23 19:54:07 2024-08-23 19:55:03 Aug 23 11:55:03 sshd[29]: Received signal 15; terminating. 2024-08-23 19:55:03 Aug 23 11:55:03 syslogd exiting 2024-08-23 19:55:04 usermod: no changes 2024-08-23 19:55:04 Aug 23 11:55:04 syslogd started: BusyBox v1.33.1 2024-08-23 19:55:04 2024/08/23 11:55:04 [TRACE] Log mode: File (Info) 2024-08-23 19:55:04 Aug 23 11:55:04 sshd[29]: Server listening on :: port 22. 2024-08-23 19:55:04 Aug 23 11:55:04 sshd[29]: Server listening on 0.0.0.0 port 22.

Expected behavior

重启gogs容器后,无法使用,3000端口启动失败。

Additional context

No response

Code of Conduct

houk0632 commented 2 months ago

2024-08-23 19:52:28 2024/08/23 11:52:28 是初次登录的时间点,能够正常启动3000端口和22端口。 在 2024-08-23 19:55:04 重启后无法启动3000端口,只启动了22端口,导致无法正常登录网页和提交git。

houk0632 commented 2 months ago

Snipaste_2024-08-23_20-04-08

FYKANG commented 3 weeks ago

2024-08-23 19:52:28 2024/08/23 11:52:28 是初次登录的时间点,能够正常启动3000端口和22端口。 在 2024-08-23 19:55:04 重启后无法启动3000端口,只启动了22端口,导致无法正常登录网页和提交git。

遇到了相同问题,发现原因是,初始化的时候 默认端口是3000,应用重启后他会根据你在初始化页面填写的应用url网页的端口,保存在conf/app.ini中,打开app.ini发现HTTP_PORT值变了,不是3000,这里改一下改把他改回3000就可以了,shh端口也同理也改回去映射的端口 image