Garbage-Collection not working #4865

Closed
opened 2025-11-02 06:05:19 -06:00 by GiteaMirror · 10 comments
Owner

Originally created by @somera on GitHub (Feb 16, 2020).

  • Gitea version (or commit ref): 1.11.0+10-gf9e66e5a4
  • Git version: 2.20.1
  • Operating system: Linux pi-manager 4.19.97-v7l+ #1294 SMP Thu Jan 30 13:21:14 GMT 2020 armv7l GNU/Linux
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

Im starting GC in the admin dashboard ("Garbage-Collection auf Repositories ausführen"). I'm hosting 929 repositories. After start this operation I see on the monitoring page, that GC is running. But after some time the admin dashboard shows

Repository garbage collection failed: Error: context deadline exceeded

...

Screenshots

image

Originally created by @somera on GitHub (Feb 16, 2020). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): 1.11.0+10-gf9e66e5a4 - Git version: 2.20.1 - Operating system: Linux pi-manager 4.19.97-v7l+ #1294 SMP Thu Jan 30 13:21:14 GMT 2020 armv7l GNU/Linux - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [x] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x] No - [ ] Not relevant - Log gist: ## Description Im starting GC in the admin dashboard ("Garbage-Collection auf Repositories ausführen"). I'm hosting 929 repositories. After start this operation I see on the monitoring page, that GC is running. But after some time the admin dashboard shows `Repository garbage collection failed: Error: context deadline exceeded` ... ## Screenshots <!-- **If this issue involves the Web Interface, please include a screenshot** --> ![image](https://user-images.githubusercontent.com/8334250/74608796-7392fd80-50e4-11ea-9b15-c358c9268c27.png)
GiteaMirror added the type/enhancementissue/stale labels 2025-11-02 06:05:19 -06:00
Author
Owner

@lunny commented on GitHub (Feb 17, 2020):

We should give a different context from the default so that it has a longer timeout.

@lunny commented on GitHub (Feb 17, 2020): We should give a different context from the default so that it has a longer timeout.
Author
Owner

@somera commented on GitHub (Feb 17, 2020):

Or run it in background withot any timeout.

@somera commented on GitHub (Feb 17, 2020): Or run it in background withot any timeout.
Author
Owner

@aswild commented on GitHub (Feb 29, 2020):

git gc and git fsck can take a very long time to run, often several minutes, and they should be done in the background rather than between page loads.

I've done a basic implementation on my fork (7db9db3cd3) though it could be enhanced by firing a System Notice when complete.

@aswild commented on GitHub (Feb 29, 2020): `git gc` and `git fsck` can take a very long time to run, often several minutes, and they should be done in the background rather than between page loads. I've done a basic implementation on my fork (https://github.com/aswild/gitea/commit/7db9db3cd3fbb538fe3c4f62a5b2520187b7854c) though it could be enhanced by firing a System Notice when complete.
Author
Owner

@stale[bot] commented on GitHub (Apr 29, 2020):

This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.

@stale[bot] commented on GitHub (Apr 29, 2020): This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.
Author
Owner

@stale[bot] commented on GitHub (May 13, 2020):

This issue has been automatically closed because of inactivity. You can re-open it if needed.

@stale[bot] commented on GitHub (May 13, 2020): This issue has been automatically closed because of inactivity. You can re-open it if needed.
Author
Owner

@somera commented on GitHub (Jun 18, 2020):

How is the status here? My hope was to get this in 1.12.0.

@somera commented on GitHub (Jun 18, 2020): How is the status here? My hope was to get this in 1.12.0.
Author
Owner

@jolheiser commented on GitHub (Jun 18, 2020):

This was reported as fixed by https://github.com/go-gitea/gitea/pull/10745

@jolheiser commented on GitHub (Jun 18, 2020): This was reported as fixed by https://github.com/go-gitea/gitea/pull/10745
Author
Owner

@somera commented on GitHub (Jun 18, 2020):

I've tested it with 1.12.0

2020/06/18 23:16:11 .../repository/check.go:87:func1() [E] Repository garbage collection failed for &{6 1 gitea_admin <nil> darktable darktable   0  master 1 1 0 0 0 0 0 0 0 0 0 0 false false false true <nil> 0 map[] map[] [] <nil> false 0 <nil> false 0 <nil> 805148937 <nil> <nil> true false []  1568914924 1592466363}. Stdout:
        Error: context deadline exceeded
2020/06/18 23:16:11 ...m.io/xorm/core/db.go:277:ExecContext() [I] [SQL] INSERT INTO `notice` (`type`,`description`,`created_unix`) VALUES (?, ?, ?) [1 Repository garbage collection failed for /home/git/gitea-repositories/gitea_admin/darktable.git. Stdout:
        Error: context deadline exceeded 1592514971] - 57.066786ms
2020/06/18 23:16:11 ...m.io/xorm/core/db.go:277:ExecContext() [I] [SQL] INSERT INTO `notice` (`type`,`description`,`created_unix`) VALUES (?, ?, ?) [2 Error in Task: Garbage collect all repositories: Repository garbage collection failed in repo: gitea_admin/darktable: Error: <nil> 1592514971] - 12.903651ms
@somera commented on GitHub (Jun 18, 2020): I've tested it with 1.12.0 ``` 2020/06/18 23:16:11 .../repository/check.go:87:func1() [E] Repository garbage collection failed for &{6 1 gitea_admin <nil> darktable darktable 0 master 1 1 0 0 0 0 0 0 0 0 0 0 false false false true <nil> 0 map[] map[] [] <nil> false 0 <nil> false 0 <nil> 805148937 <nil> <nil> true false [] 1568914924 1592466363}. Stdout: Error: context deadline exceeded 2020/06/18 23:16:11 ...m.io/xorm/core/db.go:277:ExecContext() [I] [SQL] INSERT INTO `notice` (`type`,`description`,`created_unix`) VALUES (?, ?, ?) [1 Repository garbage collection failed for /home/git/gitea-repositories/gitea_admin/darktable.git. Stdout: Error: context deadline exceeded 1592514971] - 57.066786ms 2020/06/18 23:16:11 ...m.io/xorm/core/db.go:277:ExecContext() [I] [SQL] INSERT INTO `notice` (`type`,`description`,`created_unix`) VALUES (?, ?, ?) [2 Error in Task: Garbage collect all repositories: Repository garbage collection failed in repo: gitea_admin/darktable: Error: <nil> 1592514971] - 12.903651ms ```
Author
Owner

@zeripath commented on GitHub (Jun 23, 2020):

@somera did you adjust the settings in https://docs.gitea.io/en-us/config-cheat-sheet/#cron---repository-health-check-cronrepo_health_check

@zeripath commented on GitHub (Jun 23, 2020): @somera did you adjust the settings in https://docs.gitea.io/en-us/config-cheat-sheet/#cron---repository-health-check-cronrepo_health_check
Author
Owner

@somera commented on GitHub (Jun 23, 2020):

@somera did you adjust the settings in https://docs.gitea.io/en-us/config-cheat-sheet/#cron---repository-health-check-cronrepo_health_check

I tested this in 1.12.x. And it works if I set the timeout higher. Thx!

@somera commented on GitHub (Jun 23, 2020): > @somera did you adjust the settings in https://docs.gitea.io/en-us/config-cheat-sheet/#cron---repository-health-check-cronrepo_health_check I tested this in 1.12.x. And it works if I set the timeout higher. Thx!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#4865