Mirror sync interval time < 10min results in an error "Das Spiegel-Intervall ist ungültig." #3993

Closed
opened 2025-11-02 05:33:20 -06:00 by GiteaMirror · 15 comments
Owner

Originally created by @jayjupdhig on GitHub (Sep 20, 2019).

  • Gitea version (or commit ref): Most current
  • Git version: Most current
  • Operating system: Debian 10 "Buster"
  • Database (use [x]):
    • PostgreSQL
    • [ x] MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • [ x] Not relevant
  • Log gist:

Description

Mirror sync interval time < 10min results in an error "Das Spiegel-Intervall ist ungültig."

Screenshots

htrh

Originally created by @jayjupdhig on GitHub (Sep 20, 2019). <!-- 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): Most current - Git version: Most current - Operating system: Debian 10 "Buster" - Database (use `[x]`): - [ ] PostgreSQL - [ x] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [ x] Not relevant - Log gist: ## Description Mirror sync interval time < 10min results in an error "Das Spiegel-Intervall ist ungültig." ## Screenshots <!-- **If this issue involves the Web Interface, please include a screenshot** --> ![htrh](https://user-images.githubusercontent.com/42765391/65338282-1ee96600-dbca-11e9-89cd-276fde112dc4.png)
Author
Owner

@kolaente commented on GitHub (Sep 21, 2019):

Anything in the logs?

@kolaente commented on GitHub (Sep 21, 2019): Anything in the logs?
Author
Owner

@bwenrich commented on GitHub (Sep 22, 2019):

This message text is defined in locale_de-DE.ini under the key "mirror_interval_invalid". For reference, the matching text for this in English locale is "The mirror interval is not valid"

The code responsible to generate the error message is in ./routers/repo/setting.go

if err != nil || (interval != 0 && interval < setting.Mirror.MinInterval) {
    ctx.Data["Err_Interval"] = true
    ctx.RenderWithErr(ctx.Tr("repo.mirror_interval_invalid"), tplSettingsOptions, &form)

The definition of the MinInterval setting is mentioned in ./modules/setting/setting.go and seems to supply the 10 minute setting default.

Mirror.MinInterval = sec.Key("MIN_INTERVAL").MustDuration(10 * time.Minute)

The MIN_INTERVAL setting in the example app.ini file (./custom/conf/app.ini.sample) shows 10 min & a comment that the minimum is 1 minute.

[mirror]
; Default interval as a duration between each check
DEFAULT_INTERVAL = 8h
; Min interval as a duration must be > 1m
MIN_INTERVAL = 10m

This seems to be done back in https://github.com/go-gitea/gitea/pull/1407 .
I am not sure if any specific settings of MIN_INTERVAL (ex: under 1 min or under 10 min) are at risk of being ineffective.

Can you please confirm if your app.ini file has any setting for MIN_INTERVAL value?

@bwenrich commented on GitHub (Sep 22, 2019): This message text is defined in locale_de-DE.ini under the key "mirror_interval_invalid". For reference, the matching text for this in English locale is "The mirror interval is not valid" The code responsible to generate the error message is in ./routers/repo/setting.go ``` if err != nil || (interval != 0 && interval < setting.Mirror.MinInterval) { ctx.Data["Err_Interval"] = true ctx.RenderWithErr(ctx.Tr("repo.mirror_interval_invalid"), tplSettingsOptions, &form) ``` The definition of the MinInterval setting is mentioned in ./modules/setting/setting.go and seems to supply the 10 minute setting default. ``` Mirror.MinInterval = sec.Key("MIN_INTERVAL").MustDuration(10 * time.Minute) ``` The MIN_INTERVAL setting in the example app.ini file (./custom/conf/app.ini.sample) shows 10 min & a comment that the minimum is 1 minute. ``` [mirror] ; Default interval as a duration between each check DEFAULT_INTERVAL = 8h ; Min interval as a duration must be > 1m MIN_INTERVAL = 10m ``` This seems to be done back in https://github.com/go-gitea/gitea/pull/1407 . I am not sure if any specific settings of MIN_INTERVAL (ex: under 1 min or under 10 min) are at risk of being ineffective. Can you please confirm if your app.ini file has any setting for MIN_INTERVAL value?
Author
Owner

@jayjupdhig commented on GitHub (Sep 23, 2019):

./custom/conf/app.ini.sample -> can you give me the absolute path??

@jayjupdhig commented on GitHub (Sep 23, 2019): ./custom/conf/app.ini.sample -> can you give me the absolute path??
Author
Owner

@bwenrich commented on GitHub (Sep 23, 2019):

Sorry that example app.ini is at https://github.com/go-gitea/gitea/blob/master/custom/conf/app.ini.sample#L722

@bwenrich commented on GitHub (Sep 23, 2019): Sorry that example app.ini is at https://github.com/go-gitea/gitea/blob/master/custom/conf/app.ini.sample#L722
Author
Owner

@jayjupdhig commented on GitHub (Sep 23, 2019):

now i've found it in /etc/gitea/app.ini...

Its content is:

cat /etc/gitea/app.ini
APP_NAME = Gitea: Git with a cup of tea
RUN_USER = git
RUN_MODE = prod

[security]
INTERNAL_TOKEN = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
INSTALL_LOCK   = true
SECRET_KEY     = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

[database]
DB_TYPE  = mysql
HOST     = 192.168.80.20:3306
NAME     = gitea
USER     = gitea
PASSWD   = 123456
SSL_MODE = disable
PATH     = data/gitea.db

[repository]
ROOT = /home/git/gitea-repositories

[server]
SSH_DOMAIN       = 192.168.80.230
DOMAIN           = 192.168.80.230
HTTP_PORT        = 3000
ROOT_URL         = http://192.168.80.230:3000/
DISABLE_SSH      = false
SSH_PORT         = 22
LFS_START_SERVER = true
LFS_CONTENT_PATH = /var/lib/gitea/data/lfs
LFS_JWT_SECRET   = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
OFFLINE_MODE     = false

[mailer]
ENABLED = true
HOST    = smtp.gmail.com
FROM    = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
USER    = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
PASSWD  = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

[service]
REGISTER_EMAIL_CONFIRM            = true
ENABLE_NOTIFY_MAIL                = true
DISABLE_REGISTRATION              = true
ALLOW_ONLY_EXTERNAL_REGISTRATION  = false
ENABLE_CAPTCHA                    = false
REQUIRE_SIGNIN_VIEW               = true
DEFAULT_KEEP_EMAIL_PRIVATE        = false
DEFAULT_ALLOW_CREATE_ORGANIZATION = true
DEFAULT_ENABLE_TIMETRACKING       = true
NO_REPLY_ADDRESS                  = HIDDEN

[picture]
DISABLE_GRAVATAR        = true
ENABLE_FEDERATED_AVATAR = false

[openid]
ENABLE_OPENID_SIGNIN = false
ENABLE_OPENID_SIGNUP = false

[session]
PROVIDER = file

[log]
MODE      = file
LEVEL     = Info
ROOT_PATH = /var/lib/gitea/log

If you need some logs, i can send them to you...

@jayjupdhig commented on GitHub (Sep 23, 2019): now i've found it in /etc/gitea/app.ini... Its content is: ``` cat /etc/gitea/app.ini APP_NAME = Gitea: Git with a cup of tea RUN_USER = git RUN_MODE = prod [security] INTERNAL_TOKEN = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX INSTALL_LOCK = true SECRET_KEY = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX [database] DB_TYPE = mysql HOST = 192.168.80.20:3306 NAME = gitea USER = gitea PASSWD = 123456 SSL_MODE = disable PATH = data/gitea.db [repository] ROOT = /home/git/gitea-repositories [server] SSH_DOMAIN = 192.168.80.230 DOMAIN = 192.168.80.230 HTTP_PORT = 3000 ROOT_URL = http://192.168.80.230:3000/ DISABLE_SSH = false SSH_PORT = 22 LFS_START_SERVER = true LFS_CONTENT_PATH = /var/lib/gitea/data/lfs LFS_JWT_SECRET = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX OFFLINE_MODE = false [mailer] ENABLED = true HOST = smtp.gmail.com FROM = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX USER = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX PASSWD = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX [service] REGISTER_EMAIL_CONFIRM = true ENABLE_NOTIFY_MAIL = true DISABLE_REGISTRATION = true ALLOW_ONLY_EXTERNAL_REGISTRATION = false ENABLE_CAPTCHA = false REQUIRE_SIGNIN_VIEW = true DEFAULT_KEEP_EMAIL_PRIVATE = false DEFAULT_ALLOW_CREATE_ORGANIZATION = true DEFAULT_ENABLE_TIMETRACKING = true NO_REPLY_ADDRESS = HIDDEN [picture] DISABLE_GRAVATAR = true ENABLE_FEDERATED_AVATAR = false [openid] ENABLE_OPENID_SIGNIN = false ENABLE_OPENID_SIGNUP = false [session] PROVIDER = file [log] MODE = file LEVEL = Info ROOT_PATH = /var/lib/gitea/log ``` If you need some logs, i can send them to you...
Author
Owner

@jayjupdhig commented on GitHub (Sep 23, 2019):

So you see, there are not INTERVAL variables set, so it seems to use the default value for minimum "10m0s" ?

Then i can set MIN_INTERVAL = 1m0s (or whatever) in /etc/gitea/app.ini for user-defined minium value?

@jayjupdhig commented on GitHub (Sep 23, 2019): So you see, there are not INTERVAL variables set, so it seems to use the default value for minimum "10m0s" ? Then i can set **`MIN_INTERVAL = 1m0s`** (or whatever) in /etc/gitea/app.ini for user-defined minium value?
Author
Owner

@jayjupdhig commented on GitHub (Sep 23, 2019):

My ini file does also not contain a "mirror" section, so i added one:

[mirror]
MIN_INTERVAL     = 30s
DEFAULT_INTERVAL = 8h

And not it works, now i can defined a value of, e.g., 3m0s with message "Repository-Einstellungen wurden aktualisiert."

:-)

Thank you very much - have a nice day!

@jayjupdhig commented on GitHub (Sep 23, 2019): My ini file does also not contain a "mirror" section, so i added one: ``` [mirror] MIN_INTERVAL = 30s DEFAULT_INTERVAL = 8h ``` And not it works, now i can defined a value of, e.g., `3m0s` with message "Repository-Einstellungen wurden aktualisiert." :-) Thank you very much - have a nice day!
Author
Owner

@jayjupdhig commented on GitHub (Sep 23, 2019):

I can save it and i see "Zuletzt synchronisiert 2019-09-23 15:07:40 +0200 CEST" (=today, that is correct) on the mirroring setings.

But on the front page, i still see "Aktualisiert vor 2 Tagen" (=2 days ago) for last refresh.

So that 2 date values don't match to each other - something seems still to be inconsistent - so the problem is not solved yet...

@jayjupdhig commented on GitHub (Sep 23, 2019): I can save it and i see "Zuletzt synchronisiert 2019-09-23 15:07:40 +0200 CEST" (=today, that is correct) on the mirroring setings. But on the front page, i still see "Aktualisiert vor 2 Tagen" (=2 days ago) for last refresh. So that 2 date values don't match to each other - something seems still to be inconsistent - so the problem is not solved yet...
Author
Owner

@guillep2k commented on GitHub (Sep 23, 2019):

@martijintro You should make your best effort to keep languages other than English from your comments. I have trouble following your problem.
BTW, 30s is an invalid MIN_INTERVAL. 1 minute is the minimum.
I get the feeling that you've solved it already?

@guillep2k commented on GitHub (Sep 23, 2019): @martijintro You should make your best effort to keep languages other than English from your comments. I have trouble following your problem. BTW, 30s is an invalid `MIN_INTERVAL`. 1 minute is the minimum. I get the feeling that you've solved it already?
Author
Owner

@jayjupdhig commented on GitHub (Sep 23, 2019):

""Zuletzt synchronisiert 2019-09-23 15:07:40 +0200 CEST""
=Last synchronized 2019-09-23 15:07:40 +0200 CEST

""Aktualisiert vor 2 Tagen""
=Updated 2 days ago

Now i changed it to:

[mirror]
MIN_INTERVAL     = 1m
DEFAULT_INTERVAL = 8h

And i changed the sync time in the repo mirror settings to 1m. Will look what happens now...

@jayjupdhig commented on GitHub (Sep 23, 2019): ""Zuletzt synchronisiert 2019-09-23 15:07:40 +0200 CEST"" =Last synchronized 2019-09-23 15:07:40 +0200 CEST ""Aktualisiert vor 2 Tagen"" =Updated 2 days ago Now i changed it to: ``` [mirror] MIN_INTERVAL = 1m DEFAULT_INTERVAL = 8h ``` And i changed the sync time in the repo mirror settings to 1m. Will look what happens now...
Author
Owner

@jayjupdhig commented on GitHub (Sep 23, 2019):

The text on the top of the manual sync button (on repo mirror settings) still shows me a different (current) data value - that seems to be correct, synced a few secs ago.

But on the main page, i still see "x days" ago.

So that values don't fit to each other..

@jayjupdhig commented on GitHub (Sep 23, 2019): The text on the top of the manual sync button (on repo mirror settings) still shows me a different (current) data value - that seems to be correct, synced a few secs ago. But on the main page, i still see "x days" ago. So that values don't fit to each other..
Author
Owner

@guillep2k commented on GitHub (Sep 23, 2019):

OK, but that seems to be a different problem. Please close this issue and create another with that description.

@guillep2k commented on GitHub (Sep 23, 2019): OK, but that seems to be a different problem. Please close this issue and create another with that description.
Author
Owner

@jayjupdhig commented on GitHub (Sep 23, 2019):

OK, done, thank you.
-> https://github.com/go-gitea/gitea/issues/8264

So closed.

@jayjupdhig commented on GitHub (Sep 23, 2019): OK, done, thank you. -> https://github.com/go-gitea/gitea/issues/8264 So closed.
Author
Owner

@oscarlofwenhamn commented on GitHub (Sep 24, 2019):

So closed.

You need to click Close issue or close it in another way, it is still open.

@oscarlofwenhamn commented on GitHub (Sep 24, 2019): > So closed. You need to click `Close issue` or close it in another way, it is still open.
Author
Owner

@jayjupdhig commented on GitHub (Sep 24, 2019):

Closed now! ;-)

@jayjupdhig commented on GitHub (Sep 24, 2019): Closed now! ;-)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#3993