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

Gitea 1.17.0 mirror update cron error #20667

Closed
vcsmartdata opened this issue Aug 4, 2022 · 3 comments · Fixed by #20837
Closed

Gitea 1.17.0 mirror update cron error #20667

vcsmartdata opened this issue Aug 4, 2022 · 3 comments · Fixed by #20837
Labels
Milestone

Comments

@vcsmartdata
Copy link

vcsmartdata commented Aug 4, 2022

Description

"Update mirrors" cron does not finish due to a SQL query error as reported in system notices and in logs:

Screen Shot 2022-08-04 at 15 40 32

Aug  4 15:36:59 git gitea[980518]: 2022/08/04 15:36:59 ...s/repo/pushmirror.go:103:PushMirrorsIterate() [I] [62ebbd6b] [SQL] SELECT `id`, `repo_id`, `remote_name`, `interval`, `created_unix`, `last_update`, `last_error` FROM `push_mirror` WHERE (last_update + (`interval` / ?) <= ?) AND (`interval` != 0) ORDER BY last_update ASC LIMIT -1 [1s 1659616619] - 1.073849ms
Aug  4 15:36:59 git gitea[980518]: 2022/08/04 15:36:59 ...ces/mirror/mirror.go:135:Update() [E] [62ebbd6b] PushMirrorsIterate: Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1' at line 1

Gitea Version

1.17.0

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

2.25.1

Operating System

Ubuntu 20.04.4

How are you running Gitea?

Running a Gitea binary downloaded from https://gitea.io/ as a systemd service on Ubuntu 20.04.

MySQL version is: 8.0.30

Database

MySQL

@lunny lunny added this to the 1.17.1 milestone Aug 4, 2022
@zeripath
Copy link
Contributor

What version of MySQL are you running?

zeripath added a commit to zeripath/gitea that referenced this issue Aug 17, 2022
…set it

The documentation allows the mirror update queue to add all potential mirrors to
the queue by setting the limits negative. Unfortunately a change to the iterator code
has missed this subtly and resulted in passing negative numbers to the LIMIT SQL
statement. This causes bugs on some DB systems.

Fix go-gitea#20667

Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath
Copy link
Contributor

Aha I see the issue.

Workaround for the moment is to remove your settings on [cron.update_mirrors]

https://docs.gitea.io/en-us/config-cheat-sheet/#cron---update-mirrors-cronupdate_mirrors

I would strongly recommend that you re-review your settings related to this - the cron code has changed to make the queue limits work much better.

@zeripath zeripath modified the milestones: 1.17.1, 1.17.2 Aug 17, 2022
@vcsmartdata
Copy link
Author

vcsmartdata commented Aug 18, 2022

yeah I figured it out too a couple of days ago, just had no time to update the issue here
I had a custom configuration for cron and after changing cron.update_mirrors SCHEDULE to @every 2m it started to work again

thank you for the update

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants