go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
43.55k stars 5.35k forks source link

No mirror syncs (already in queue), cannot flush queues #28919

Closed stevesbrain closed 6 months ago

stevesbrain commented 6 months ago

Description

Using the official docker image.

I noted that some of my mirrored repositories had not updated in 3 months.

I can clone new mirror repositories from the same provider no issues.

Manually running a sync provides the following in gitea.log:

...ices/mirror/queue.go:59:func1() [E] Unable to push sync request for to the queue for pull mirror repo[112]. Error: already in queue

Web interface shows queue empty:

image

Tried to flush queues anyway via command line, but this also resulted in an error:

26beeea78e51:/$ gitea manager flush-queues
2024/01/25 09:37:08 .../setting/security.go:168:loadSecurityFrom() [W] Enabling Query API Auth tokens is not recommended. DISABLE_QUERY_AUTH_TOKEN will default to true in gitea 1.23 and will be removed in gitea 1.24.
context deadline exceeded
internal API error response, status=408

This generated the following error in the gitea.log: ...eb/routing/logger.go:102:func1() [I] router: completed POST /api/internal/manager/flush-queues for 127.0.0.1:0, 408 Request Timeout in 60458.1ms @ private/manager.go:35(private.FlushQueues)

Any clues where I might be going wrong?

docker-compose.yml:

version: "3"

networks:
  gitea:
    external: false

services:
  server:
    image: gitea/gitea:latest
    container_name: gitea
    environment:
      - USER_UID=1000
      - USER_GID=1000
    restart: always
    networks:
      - gitea
    volumes:
      - ./data:/data
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    ports:
      - "127.0.0.1:3000:3000"
      - "127.0.0.1:2224:2224"

app.ini:

APP_NAME = Git
RUN_MODE = prod
RUN_USER = git
WORK_PATH = /data/gitea

[repository]
ROOT = /data/git/repositories

[repository.upload]
TEMP_PATH = /data/gitea/uploads

[server]
PROTOCOL = http
APP_DATA_PATH = /data/gitea
SSH_DOMAIN = git.domain.com
HTTP_PORT = 3000
ROOT_URL = https://git.domain.com
DISABLE_SSH = false
START_SSH_SERVER = true
SSH_PORT = 2224
DOMAIN = git.domain.com
LFS_START_SERVER = true
LFS_JWT_SECRET = REMOVED
OFFLINE_MODE = true
ENABLE_GZIP = true

[lfs]
PATH = /data/gitea/lfs

[database]
PATH = /data/gitea/gitea.db
DB_TYPE = sqlite3
HOST = localhost:3306
NAME = gitea
USER = root
PASSWD = REMOVED
SSL_MODE = disable

[session]
PROVIDER_CONFIG = /data/gitea/sessions
PROVIDER = file

[picture]
AVATAR_UPLOAD_PATH = /data/gitea/avatars
DISABLE_GRAVATAR = false
ENABLE_FEDERATED_AVATAR = false

[attachment]
PATH = /data/gitea/attachments

[log]
ROOT_PATH = /data/gitea/log
MODE = file
LEVEL = Info

[security]
INSTALL_LOCK = true
SECRET_KEY = REMOVED
INTERNAL_TOKEN = REMOVED
LOGIN_REMEMBER_DAYS = 14
COOKIE_USERNAME = REMOVED
COOKIE_REMEMBER_NAME = REMOVED

[mailer]
ENABLED = false
HOST = mail.domain.com:465
FROM = "REMOVED" <REMOVED@domain.com>
USER = git@domain.com
PASSWD = REMOVED

[service]
REGISTER_EMAIL_CONFIRM = true
ENABLE_NOTIFY_MAIL = true
DISABLE_REGISTRATION = false
ENABLE_CAPTCHA = true
REQUIRE_SIGNIN_VIEW = false
DEFAULT_KEEP_EMAIL_PRIVATE = true
DEFAULT_ALLOW_CREATE_ORGANIZATION = true
DEFAULT_ENABLE_TIMETRACKING = true
NO_REPLY_ADDRESS = noreply.domain.com

[openid]
ENABLE_OPENID_SIGNIN = false
ENABLE_OPENID_SIGNUP = false

[oauth2]
JWT_SECRET = REMOVED

[cron.update_mirrors]
SCHEDULE = @every 10m
ENABLED = true
RUN_AT_START = true
PULL_LIMIT=100
PUSH_LIMIT=100

[mirror]
ENABLED = true
DEFAULT_INTERVAL = 8h

Gitea Version

1.21.4

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

2.40.1

Operating System

Official gitea image, which appears to be Alpine Linux 3.18

How are you running Gitea?

Docker (as per description details)

Database

SQLite

wxiaoguang commented 6 months ago

Could you try to "Remove all" queue items and retry? Maybe it's related to levelqueue corruption.

image

stevesbrain commented 6 months ago

Thank you - didn't know about that feature. It is working now - is this just likely random corruption, or is there some misconfiguration I've made that's likely contributed to this?

wxiaoguang commented 6 months ago

It might be a levelqueue bug (not misconfiguration)

Just a guess, more details: Help to recover from corrupted levelqueue #24912

stevesbrain commented 6 months ago

Sure, thank you - I'll keep an eye on it to see, but will close it off for now. Have a great night/day!

github-actions[bot] commented 5 months ago

Automatically locked because of our CONTRIBUTING guidelines