Originally created by @gitmotion on GitHub (Jun 24, 2025).
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
🔄 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:Dockerfileplatforms:- linux/amd64- linux/arm64cache_from:- ${DOCKER_REGISTRY:-ghcr.io}/${DOCKER_IMAGE:-arunavo4/gitea-mirror}:${DOCKER_TAG:-latest}container_name:gitea-mirrorrestart:unless-stopped# ports:# - "4321:4321"volumes:- gitea-mirror-data:/app/dataenvironment:- 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:30stimeout:10sretries:5start_period:15snetworks:- anothernetwork- aproxynetworknetworks:anothernetwork:external:trueaproxynetwork:external:true# Define named volumes for database persistencevolumes:gitea-mirror-data:# Database volume
Originally created by @gitmotion on GitHub (Jun 24, 2025).
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
```
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
@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
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
@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
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! 🙏🏻
@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! 🙏🏻
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @gitmotion on GitHub (Jun 24, 2025).
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.docker-compose.ymland runningdocker compose up -dsudo chown -r UID:GID dir-of-volume-mount/thank you in advanced 🙏🏻
error:
example docker compose:
@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
@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
@arunavo4 commented on GitHub (Jul 7, 2025):
Consider testing with this a cut-down version of the docker-compose file docker-compose.alt.yml
@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! 🙏🏻
@arunavo4 commented on GitHub (Jul 10, 2025):
Great, thanks for ur kind words