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

Repeated Queue "code_indexer" failed to handle batch of 1 items error logs #31884

Closed
MattSG opened this issue Aug 20, 2024 · 3 comments · Fixed by #31903
Closed

Repeated Queue "code_indexer" failed to handle batch of 1 items error logs #31884

MattSG opened this issue Aug 20, 2024 · 3 comments · Fixed by #31903
Labels

Comments

@MattSG
Copy link

MattSG commented Aug 20, 2024

Description

Error logs appear every couple seconds constantly as app is running, appears to come with a memory leak

Setting REPO_INDEXER_ENABLED = false stops the errors

Unaware of RAM usage at the time on the machine but after thousands of these logs, the service appeared to stop itself without reason. The shutdown may not be related to this

Edit: Found these logs in the event viewer that align with the time gitea stopped

Windows successfully diagnosed a low virtual memory condition. The following programs consumed the most virtual memory: gitea.exe (8476) consumed 11716718592 bytes, MsMpEng.exe (8008) consumed 459538432 bytes, and MsSense.exe (3024) consumed 256311296 bytes.
The gitea service terminated unexpectedly.  It has done this 1 time(s).

Maybe this is related to #31565?

2024/08/20 10:52:43 cmd/web.go:355:listen() [I] HTTP Listener: 0.0.0.0:3000 Closed
2024/08/20 10:52:43 .../graceful/manager.go:168:doHammerTime() [W] Setting Hammer condition
2024/08/20 10:52:44 .../graceful/manager.go:184:doTerminate() [W] Terminating
2024/08/20 10:52:44 ...er/issues/indexer.go:120:2() [I] PID: 8940 Issue Indexer closed
2024/08/20 10:52:44 ...exer/code/indexer.go:112:func1() [I] PID: 8940 Repository Indexer closed
2024/08/20 10:52:44 cmd/web.go:214:serveInstalled() [I] PID: 8940 Gitea Web Finished

Indexer config

[indexer]
; ...
REPO_INDEXER_ENABLED = true
REPO_INDEXER_PATH = indexers/repos.bleve
MAX_FILE_SIZE = 1048576
REPO_INDEXER_INCLUDE = 
REPO_INDEXER_EXCLUDE = resources/bin/**

Error log:

2024/08/20 00:00:01 ...s/actions/cleanup.go:60:cleanNeedDeleteArtifacts() [I] Found 0 artifacts pending deletion
2024/08/20 00:00:03 ...eb/routing/logger.go:102:func1() [I] router: completed POST /api/actions/runner.v1.RunnerService/FetchTask for 127.0.0.1:51052, 200 OK in 75.8ms @ <autogenerated>:1(http.Handler.ServeHTTP-fm)
2024/08/20 00:00:03 ...exer/code/indexer.go:128:func2() [E] Codes indexer handler: index error for repo 78: fork/exec C:\Program Files\Git\cmd\git.exe: The filename or extension is too long.
2024/08/20 00:00:03 ...queue/workergroup.go:107:doWorkerHandle() [E] Queue "code_indexer" failed to handle batch of 1 items, backoff for a few seconds
2024/08/20 00:00:05 ...eb/routing/logger.go:102:func1() [I] router: completed POST /api/actions/runner.v1.RunnerService/FetchTask for 127.0.0.1:51052, 200 OK in 30.1ms @ <autogenerated>:1(http.Handler.ServeHTTP-fm)
2024/08/20 00:00:07 ...eb/routing/logger.go:102:func1() [I] router: completed POST /api/actions/runner.v1.RunnerService/FetchTask for 127.0.0.1:51052, 200 OK in 28.4ms @ <autogenerated>:1(http.Handler.ServeHTTP-fm)
2024/08/20 00:00:09 ...eb/routing/logger.go:102:func1() [I] router: completed POST /api/actions/runner.v1.RunnerService/FetchTask for 127.0.0.1:51052, 200 OK in 28.8ms @ <autogenerated>:1(http.Handler.ServeHTTP-fm)
2024/08/20 00:00:10 ...exer/code/indexer.go:128:func2() [E] Codes indexer handler: index error for repo 78: fork/exec C:\Program Files\Git\cmd\git.exe: The filename or extension is too long.
2024/08/20 00:00:10 ...queue/workergroup.go:107:doWorkerHandle() [E] Queue "code_indexer" failed to handle batch of 1 items, backoff for a few seconds
2024/08/20 00:00:11 ...eb/routing/logger.go:102:func1() [I] router: completed POST /api/actions/runner.v1.RunnerService/FetchTask for 127.0.0.1:51052, 200 OK in 36.6ms @ <autogenerated>:1(http.Handler.ServeHTTP-fm)
2024/08/20 00:00:13 ...eb/routing/logger.go:102:func1() [I] router: completed POST /api/actions/runner.v1.RunnerService/FetchTask for 127.0.0.1:51052, 200 OK in 62.5ms @ <autogenerated>:1(http.Handler.ServeHTTP-fm)
2024/08/20 00:00:15 ...eb/routing/logger.go:102:func1() [I] router: completed POST /api/actions/runner.v1.RunnerService/FetchTask for 127.0.0.1:51052, 200 OK in 84.1ms @ <autogenerated>:1(http.Handler.ServeHTTP-fm)
2024/08/20 00:00:17 ...eb/routing/logger.go:102:func1() [I] router: completed POST /api/actions/runner.v1.RunnerService/FetchTask for 127.0.0.1:51052, 200 OK in 58.0ms @ <autogenerated>:1(http.Handler.ServeHTTP-fm)
2024/08/20 00:00:17 ...exer/code/indexer.go:128:func2() [E] Codes indexer handler: index error for repo 78: fork/exec C:\Program Files\Git\cmd\git.exe: The filename or extension is too long.
2024/08/20 00:00:17 ...queue/workergroup.go:107:doWorkerHandle() [E] Queue "code_indexer" failed to handle batch of 1 items, backoff for a few seconds
2024/08/20 00:00:19 ...eb/routing/logger.go:102:func1() [I] router: completed POST /api/actions/runner.v1.RunnerService/FetchTask for 127.0.0.1:51052, 200 OK in 312.0ms @ <autogenerated>:1(http.Handler.ServeHTTP-fm)
2024/08/20 00:00:21 ...eb/routing/logger.go:102:func1() [I] router: completed POST /api/actions/runner.v1.RunnerService/FetchTask for 127.0.0.1:51052, 200 OK in 85.3ms @ <autogenerated>:1(http.Handler.ServeHTTP-fm)
2024/08/20 00:00:23 ...eb/routing/logger.go:102:func1() [I] router: completed POST /api/actions/runner.v1.RunnerService/FetchTask for 127.0.0.1:51052, 200 OK in 72.6ms @ <autogenerated>:1(http.Handler.ServeHTTP-fm)
2024/08/20 00:00:25 ...exer/code/indexer.go:128:func2() [E] Codes indexer handler: index error for repo 78: fork/exec C:\Program Files\Git\cmd\git.exe: The filename or extension is too long.
2024/08/20 00:00:25 ...queue/workergroup.go:107:doWorkerHandle() [E] Queue "code_indexer" failed to handle batch of 1 items, backoff for a few seconds
2024/08/20 00:00:25 ...eb/routing/logger.go:102:func1() [I] router: completed POST /api/actions/runner.v1.RunnerService/FetchTask for 127.0.0.1:51052, 200 OK in 299.5ms @ <autogenerated>:1(http.Handler.ServeHTTP-fm)
2024/08/20 00:00:27 ...eb/routing/logger.go:102:func1() [I] router: completed POST /api/actions/runner.v1.RunnerService/FetchTask for 127.0.0.1:51052, 200 OK in 60.5ms @ <autogenerated>:1(http.Handler.ServeHTTP-fm)
2024/08/20 00:00:30 ...eb/routing/logger.go:102:func1() [I] router: completed POST /api/actions/runner.v1.RunnerService/FetchTask for 127.0.0.1:51052, 200 OK in 1177.9ms @ <autogenerated>:1(http.Handler.ServeHTTP-fm)
2024/08/20 00:00:31 ...eb/routing/logger.go:102:func1() [I] router: completed POST /api/actions/runner.v1.RunnerService/FetchTask for 127.0.0.1:51052, 200 OK in 122.9ms @ <autogenerated>:1(http.Handler.ServeHTTP-fm)
2024/08/20 00:00:32 ...exer/code/indexer.go:128:func2() [E] Codes indexer handler: index error for repo 78: fork/exec C:\Program Files\Git\cmd\git.exe: The filename or extension is too long.
2024/08/20 00:00:32 ...queue/workergroup.go:107:doWorkerHandle() [E] Queue "code_indexer" failed to handle batch of 1 items, backoff for a few seconds
2024/08/20 00:00:33 ...eb/routing/logger.go:102:func1() [I] router: completed POST /api/actions/runner.v1.RunnerService/FetchTask for 127.0.0.1:51052, 200 OK in 110.7ms @ <autogenerated>:1(http.Handler.ServeHTTP-fm)
2024/08/20 00:00:35 ...eb/routing/logger.go:102:func1() [I] router: completed POST /api/actions/runner.v1.RunnerService/FetchTask for 127.0.0.1:51052, 200 OK in 639.7ms @ <autogenerated>:1(http.Handler.ServeHTTP-fm)
2024/08/20 00:00:37 ...eb/routing/logger.go:102:func1() [I] router: completed POST /api/actions/runner.v1.RunnerService/FetchTask for 127.0.0.1:51052, 200 OK in 364.4ms @ <autogenerated>:1(http.Handler.ServeHTTP-fm)
2024/08/20 00:00:39 ...eb/routing/logger.go:102:func1() [I] router: completed POST /api/actions/runner.v1.RunnerService/FetchTask for 127.0.0.1:51052, 200 OK in 277.2ms @ <autogenerated>:1(http.Handler.ServeHTTP-fm)
2024/08/20 00:00:39 ...exer/code/indexer.go:128:func2() [E] Codes indexer handler: index error for repo 78: fork/exec C:\Program Files\Git\cmd\git.exe: The filename or extension is too long.

Gitea Version

1.22.1 go-git

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

2.45.2.windows.1

Operating System

Windows Server 2016

How are you running Gitea?

Windows gogit exe on prem running a service

Database

SQLite

@yp05327
Copy link
Contributor

yp05327 commented Aug 22, 2024

[E] Codes indexer handler: index error for repo 78: fork/exec C:\Program Files\Git\cmd\git.exe: The filename or extension is too long.

This error maybe similar to #29907 (comment)
Windows has maximum path length limitation which is too short in sometimes.

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Aug 22, 2024

Nope, the root problem is this:

-> search indexer broken: ...exer/code/indexer.go:128:func2() [E] Codes indexer handler: index error for repo 29: fork/exec /usr/bin/git: argument list too long #28584

See my comment #28584 (comment)

Gitea reads the full file list into memory.

Another related problem is the builtin bleve indexer, it sometimes consumes a lot of memory.

@lunny
Copy link
Member

lunny commented Aug 22, 2024

I sent a PR to try to fix #28584

@lunny lunny closed this as completed in 286ede4 Sep 1, 2024
lunny added a commit to lunny/gitea that referenced this issue Sep 2, 2024
lunny added a commit that referenced this issue Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants