[GH-ISSUE #33] Docker compose internal server error (Error finding interrupted jobs: 5185) #17

Closed
opened 2026-02-27 15:54:34 +03:00 by kerem · 5 comments
Owner

Originally created by @gitmotion on GitHub (Jun 24, 2025).
Original GitHub issue: https://github.com/RayLabsHQ/gitea-mirror/issues/33

Hey there ✌🏻 awesome project!
was able to run this as a test on a templated dokploy instance however im getting an error when trying to do this on a raw docker-compose.yml. Anyone have ideas on how to fix this? Getting internal server error when visiting the endpoint/domain.

  • this is happening after git cloning, updating the docker-compose.yml and running docker compose up -d
  • also happening if i add it to an existing stack
  • also ran into permission issues when trying to mount a volume rather than using a docker volume
    • i've tried sudo chown -r UID:GID dir-of-volume-mount/

thank you in advanced 🙏🏻

error:

🔄 Checking database migrations...
=== Gitea Mirror Startup Recovery ===
Timeout: 30000ms
Force recovery: false

Checking if recovery is needed...
Error finding interrupted jobs: 5185 | async function findInterruptedJobs() {
5186 |   try {
5187 |     const cutoffTime = new Date;
5188 |     cutoffTime.setMinutes(cutoffTime.getMinutes() - 10);
5189 |     const staleCutoffTime = new Date;
5190 |     const interruptedJobs = await db2.select().from(mirrorJobs).where(and(eq(mirrorJobs.inProgress, true), or(or(isNull(mirrorJobs.lastCheckpoint), lt(mirrorJobs.lastCheckpoint, cutoffTime)), lt(mirrorJobs.startedAt, staleCutoffTime))));
                                            ^
TypeError: undefined is not an object (evaluating 'db2.select')
      at findInterruptedJobs (/app/dist/scripts/startup-recovery.js:5190:38)
      at findInterruptedJobs (/app/dist/scripts/startup-recovery.js:5184:36)
      at hasJobsNeedingRecovery (/app/dist/scripts/startup-recovery.js:13955:54)
      at hasJobsNeedingRecovery (/app/dist/scripts/startup-recovery.js:13953:39)
      at runStartupRecovery (/app/dist/scripts/startup-recovery.js:13985:55)
      at runStartupRecovery (/app/dist/scripts/startup-recovery.js:13972:35)
      at /app/dist/scripts/startup-recovery.js:14034:19
      at loadAndEvaluateModule (1:11)

example docker compose:

services:
  gitea-mirror:
    image: ${DOCKER_REGISTRY:-ghcr.io}/${DOCKER_IMAGE:-arunavo4/gitea-mirror}:${DOCKER_TAG:-latest}
    build:
      context: .
      dockerfile: Dockerfile
      platforms:
        - linux/amd64
        - linux/arm64
      cache_from:
        - ${DOCKER_REGISTRY:-ghcr.io}/${DOCKER_IMAGE:-arunavo4/gitea-mirror}:${DOCKER_TAG:-latest}
    container_name: gitea-mirror
    restart: unless-stopped
#    ports:
#      - "4321:4321"
    volumes:
      - gitea-mirror-data:/app/data
    environment:
      - NODE_ENV=production
      - DATABASE_URL=file:data/gitea-mirror.db
      - HOST=0.0.0.0
      - PORT=4321
      - JWT_SECRET=${JWT_SECRET:-your-secret-key-change-this-in-production}
      # Authentication Configuration
      # NOTE: Can be configured via UI during initial setup!
      # These env vars are optional - UI configuration takes precedence
      - AUTH_METHOD=${AUTH_METHOD:-}
      - AUTH_ALLOW_LOCAL_FALLBACK=${AUTH_ALLOW_LOCAL_FALLBACK:-}
      # OIDC Configuration (can be configured via UI)
      - AUTH_OIDC_ISSUER_URL=${AUTH_OIDC_ISSUER_URL:-}
      - AUTH_OIDC_CLIENT_ID=${AUTH_OIDC_CLIENT_ID:-}
      - AUTH_OIDC_CLIENT_SECRET=${AUTH_OIDC_CLIENT_SECRET:-}
      - AUTH_OIDC_REDIRECT_URI=${AUTH_OIDC_REDIRECT_URI:-}
      - AUTH_OIDC_SCOPES=${AUTH_OIDC_SCOPES:-}
      - AUTH_OIDC_AUTO_CREATE=${AUTH_OIDC_AUTO_CREATE:-}
      - AUTH_OIDC_USERNAME_CLAIM=${AUTH_OIDC_USERNAME_CLAIM:-}
      - AUTH_OIDC_EMAIL_CLAIM=${AUTH_OIDC_EMAIL_CLAIM:-}
      - AUTH_OIDC_NAME_CLAIM=${AUTH_OIDC_NAME_CLAIM:-}
      # Forward Auth Configuration (can be configured via UI)
      - AUTH_FORWARD_USER_HEADER=${AUTH_FORWARD_USER_HEADER:-}
      - AUTH_FORWARD_EMAIL_HEADER=${AUTH_FORWARD_EMAIL_HEADER:-}
      - AUTH_FORWARD_NAME_HEADER=${AUTH_FORWARD_NAME_HEADER:-}
      - AUTH_FORWARD_GROUPS_HEADER=${AUTH_FORWARD_GROUPS_HEADER:-}
      - AUTH_FORWARD_TRUSTED_PROXIES=${AUTH_FORWARD_TRUSTED_PROXIES:-}
      - AUTH_FORWARD_AUTO_CREATE=${AUTH_FORWARD_AUTO_CREATE:-}
      # GitHub/Gitea Mirror Config
      - GITHUB_USERNAME=${GITHUB_USERNAME:-}
      - GITHUB_TOKEN=${GITHUB_TOKEN:-}
      - SKIP_FORKS=${SKIP_FORKS:-false}
      - PRIVATE_REPOSITORIES=${PRIVATE_REPOSITORIES:-false}
      - MIRROR_ISSUES=${MIRROR_ISSUES:-false}
      - MIRROR_WIKI=${MIRROR_WIKI:-false}
      - MIRROR_STARRED=${MIRROR_STARRED:-false}
      - MIRROR_ORGANIZATIONS=${MIRROR_ORGANIZATIONS:-false}
      - PRESERVE_ORG_STRUCTURE=${PRESERVE_ORG_STRUCTURE:-false}
      - ONLY_MIRROR_ORGS=${ONLY_MIRROR_ORGS:-false}
      - SKIP_STARRED_ISSUES=${SKIP_STARRED_ISSUES:-false}
      - GITEA_URL=${GITEA_URL:-}
      - GITEA_TOKEN=${GITEA_TOKEN:-}
      - GITEA_USERNAME=${GITEA_USERNAME:-}
      - GITEA_ORGANIZATION=${GITEA_ORGANIZATION:-github-mirrors}
      - GITEA_ORG_VISIBILITY=${GITEA_ORG_VISIBILITY:-public}
      - DELAY=${DELAY:-3600}
    healthcheck:
      test: ["CMD", "wget", "--no-verbose", "--tries=3", "--spider", "http://localhost:4321/api/health"]
      interval: 30s
      timeout: 10s
      retries: 5
      start_period: 15s
    networks:
      - anothernetwork
      - aproxynetwork

networks:
  anothernetwork:
    external: true
  aproxynetwork:
    external: true
# Define named volumes for database persistence
volumes:
  gitea-mirror-data:    # Database volume
Originally created by @gitmotion on GitHub (Jun 24, 2025). Original GitHub issue: https://github.com/RayLabsHQ/gitea-mirror/issues/33 Hey there ✌🏻 awesome project! was able to run this as a test on a templated dokploy instance however im getting an error when trying to do this on a raw `docker-compose.yml`. Anyone have ideas on how to fix this? Getting internal server error when visiting the endpoint/domain. - this is happening after git cloning, updating the `docker-compose.yml` and running `docker compose up -d` - also happening if i add it to an existing stack - also ran into permission issues when trying to mount a volume rather than using a docker volume - i've tried `sudo chown -r UID:GID dir-of-volume-mount/` thank you in advanced 🙏🏻 error: ``` 🔄 Checking database migrations... === Gitea Mirror Startup Recovery === Timeout: 30000ms Force recovery: false Checking if recovery is needed... Error finding interrupted jobs: 5185 | async function findInterruptedJobs() { 5186 | try { 5187 | const cutoffTime = new Date; 5188 | cutoffTime.setMinutes(cutoffTime.getMinutes() - 10); 5189 | const staleCutoffTime = new Date; 5190 | const interruptedJobs = await db2.select().from(mirrorJobs).where(and(eq(mirrorJobs.inProgress, true), or(or(isNull(mirrorJobs.lastCheckpoint), lt(mirrorJobs.lastCheckpoint, cutoffTime)), lt(mirrorJobs.startedAt, staleCutoffTime)))); ^ TypeError: undefined is not an object (evaluating 'db2.select') at findInterruptedJobs (/app/dist/scripts/startup-recovery.js:5190:38) at findInterruptedJobs (/app/dist/scripts/startup-recovery.js:5184:36) at hasJobsNeedingRecovery (/app/dist/scripts/startup-recovery.js:13955:54) at hasJobsNeedingRecovery (/app/dist/scripts/startup-recovery.js:13953:39) at runStartupRecovery (/app/dist/scripts/startup-recovery.js:13985:55) at runStartupRecovery (/app/dist/scripts/startup-recovery.js:13972:35) at /app/dist/scripts/startup-recovery.js:14034:19 at loadAndEvaluateModule (1:11) ``` example docker compose: ```yaml services: gitea-mirror: image: ${DOCKER_REGISTRY:-ghcr.io}/${DOCKER_IMAGE:-arunavo4/gitea-mirror}:${DOCKER_TAG:-latest} build: context: . dockerfile: Dockerfile platforms: - linux/amd64 - linux/arm64 cache_from: - ${DOCKER_REGISTRY:-ghcr.io}/${DOCKER_IMAGE:-arunavo4/gitea-mirror}:${DOCKER_TAG:-latest} container_name: gitea-mirror restart: unless-stopped # ports: # - "4321:4321" volumes: - gitea-mirror-data:/app/data environment: - NODE_ENV=production - DATABASE_URL=file:data/gitea-mirror.db - HOST=0.0.0.0 - PORT=4321 - JWT_SECRET=${JWT_SECRET:-your-secret-key-change-this-in-production} # Authentication Configuration # NOTE: Can be configured via UI during initial setup! # These env vars are optional - UI configuration takes precedence - AUTH_METHOD=${AUTH_METHOD:-} - AUTH_ALLOW_LOCAL_FALLBACK=${AUTH_ALLOW_LOCAL_FALLBACK:-} # OIDC Configuration (can be configured via UI) - AUTH_OIDC_ISSUER_URL=${AUTH_OIDC_ISSUER_URL:-} - AUTH_OIDC_CLIENT_ID=${AUTH_OIDC_CLIENT_ID:-} - AUTH_OIDC_CLIENT_SECRET=${AUTH_OIDC_CLIENT_SECRET:-} - AUTH_OIDC_REDIRECT_URI=${AUTH_OIDC_REDIRECT_URI:-} - AUTH_OIDC_SCOPES=${AUTH_OIDC_SCOPES:-} - AUTH_OIDC_AUTO_CREATE=${AUTH_OIDC_AUTO_CREATE:-} - AUTH_OIDC_USERNAME_CLAIM=${AUTH_OIDC_USERNAME_CLAIM:-} - AUTH_OIDC_EMAIL_CLAIM=${AUTH_OIDC_EMAIL_CLAIM:-} - AUTH_OIDC_NAME_CLAIM=${AUTH_OIDC_NAME_CLAIM:-} # Forward Auth Configuration (can be configured via UI) - AUTH_FORWARD_USER_HEADER=${AUTH_FORWARD_USER_HEADER:-} - AUTH_FORWARD_EMAIL_HEADER=${AUTH_FORWARD_EMAIL_HEADER:-} - AUTH_FORWARD_NAME_HEADER=${AUTH_FORWARD_NAME_HEADER:-} - AUTH_FORWARD_GROUPS_HEADER=${AUTH_FORWARD_GROUPS_HEADER:-} - AUTH_FORWARD_TRUSTED_PROXIES=${AUTH_FORWARD_TRUSTED_PROXIES:-} - AUTH_FORWARD_AUTO_CREATE=${AUTH_FORWARD_AUTO_CREATE:-} # GitHub/Gitea Mirror Config - GITHUB_USERNAME=${GITHUB_USERNAME:-} - GITHUB_TOKEN=${GITHUB_TOKEN:-} - SKIP_FORKS=${SKIP_FORKS:-false} - PRIVATE_REPOSITORIES=${PRIVATE_REPOSITORIES:-false} - MIRROR_ISSUES=${MIRROR_ISSUES:-false} - MIRROR_WIKI=${MIRROR_WIKI:-false} - MIRROR_STARRED=${MIRROR_STARRED:-false} - MIRROR_ORGANIZATIONS=${MIRROR_ORGANIZATIONS:-false} - PRESERVE_ORG_STRUCTURE=${PRESERVE_ORG_STRUCTURE:-false} - ONLY_MIRROR_ORGS=${ONLY_MIRROR_ORGS:-false} - SKIP_STARRED_ISSUES=${SKIP_STARRED_ISSUES:-false} - GITEA_URL=${GITEA_URL:-} - GITEA_TOKEN=${GITEA_TOKEN:-} - GITEA_USERNAME=${GITEA_USERNAME:-} - GITEA_ORGANIZATION=${GITEA_ORGANIZATION:-github-mirrors} - GITEA_ORG_VISIBILITY=${GITEA_ORG_VISIBILITY:-public} - DELAY=${DELAY:-3600} healthcheck: test: ["CMD", "wget", "--no-verbose", "--tries=3", "--spider", "http://localhost:4321/api/health"] interval: 30s timeout: 10s retries: 5 start_period: 15s networks: - anothernetwork - aproxynetwork networks: anothernetwork: external: true aproxynetwork: external: true # Define named volumes for database persistence volumes: gitea-mirror-data: # Database volume ```
kerem closed this issue 2026-02-27 15:54:34 +03:00
Author
Owner

@arunavo4 commented on GitHub (Jul 5, 2025):

Hi @gitmotion I have not updated the dockploy version of the template in awhile so next week i will have it updated. I will organise this whole thing better

<!-- gh-comment-id:3039371552 --> @arunavo4 commented on GitHub (Jul 5, 2025): Hi @gitmotion I have not updated the dockploy version of the template in awhile so next week i will have it updated. I will organise this whole thing better
Author
Owner

@arunavo4 commented on GitHub (Jul 7, 2025):

Hi @gitmotion let me know if you still have issues with the latest release v2.20 and we have move the repo so keep that in mind

<!-- gh-comment-id:3043543521 --> @arunavo4 commented on GitHub (Jul 7, 2025): Hi @gitmotion let me know if you still have issues with the latest release v2.20 and we have move the repo so keep that in mind
Author
Owner

@arunavo4 commented on GitHub (Jul 7, 2025):

Consider testing with this a cut-down version of the docker-compose file docker-compose.alt.yml

# Gitea Mirror alternate deployment configuration
# Standard deployment with host path and minimal environments
services:
  gitea-mirror:
    image: ghcr.io/raylabshq/gitea-mirror:latest
    container_name: gitea-mirror
    restart: unless-stopped
    ports:
      - "${PORT:-4321}:4321"
    user: ${PUID:-1000}:${PGID:-1000}
    volumes:
      - ./data:/app/data
    environment:
      - NODE_ENV=production
      - DATABASE_URL=file:data/gitea-mirror.db
      - HOST=0.0.0.0
      - PORT=4321
      - JWT_SECRET=${JWT_SECRET:-your-secret-key-change-this-in-production}
    healthcheck:
      test: ["CMD", "wget", "--no-verbose", "--tries=3", "--spider", "http://localhost:4321/api/health"]
      interval: 30s
      timeout: 10s
      retries: 5
      start_period: 15s
<!-- gh-comment-id:3044538332 --> @arunavo4 commented on GitHub (Jul 7, 2025): Consider testing with this a cut-down version of the docker-compose file [docker-compose.alt.yml](https://github.com/RayLabsHQ/gitea-mirror/blob/main/docker-compose.alt.yml) ```yml # Gitea Mirror alternate deployment configuration # Standard deployment with host path and minimal environments services: gitea-mirror: image: ghcr.io/raylabshq/gitea-mirror:latest container_name: gitea-mirror restart: unless-stopped ports: - "${PORT:-4321}:4321" user: ${PUID:-1000}:${PGID:-1000} volumes: - ./data:/app/data environment: - NODE_ENV=production - DATABASE_URL=file:data/gitea-mirror.db - HOST=0.0.0.0 - PORT=4321 - JWT_SECRET=${JWT_SECRET:-your-secret-key-change-this-in-production} healthcheck: test: ["CMD", "wget", "--no-verbose", "--tries=3", "--spider", "http://localhost:4321/api/health"] interval: 30s timeout: 10s retries: 5 start_period: 15s ```
Author
Owner

@gitmotion commented on GitHub (Jul 10, 2025):

hey @arunavo4! just tested with the alt docker-compose and i'm able to access and mirror into a gitea instance
first time working with gitea-mirror and it's sick great job on this 👏🏻

thank you! 🙏🏻

<!-- gh-comment-id:3058539434 --> @gitmotion commented on GitHub (Jul 10, 2025): hey @arunavo4! just tested with the alt docker-compose and i'm able to access and mirror into a gitea instance first time working with gitea-mirror and it's sick great job on this 👏🏻 thank you! 🙏🏻
Author
Owner

@arunavo4 commented on GitHub (Jul 10, 2025):

Great, thanks for ur kind words

<!-- gh-comment-id:3058673662 --> @arunavo4 commented on GitHub (Jul 10, 2025): Great, thanks for ur kind words
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/gitea-mirror#17
No description provided.