[GH-ISSUE #110] Using latest container build but installed old version #55

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

Originally created by @anasfanani on GitHub (Oct 2, 2025).
Original GitHub issue: https://github.com/RayLabsHQ/gitea-mirror/issues/110

Notice this build log Setting application version: 3.7.1

Web UI also show installed with 3.7.1

Image

This my deploy configuration using dokku.

dokku apps:create gitea-mirror
dokku ports:set gitea-mirror http:443:4321
dokku config:set gitea-mirror NODE_ENV=production \
  HOST=0.0.0.0 \
  PORT=4321 \
  BETTER_AUTH_SECRET="5nugYaJ5PFLvhx915ysYNoUey63fBxlYjVCewgaYik0=" \
  BETTER_AUTH_URL=http://localhost:4321 \
  PUBLIC_BETTER_AUTH_URL=https://gitea-mirror.example.com

dokku postgres:create gitea-mirror
dokku postgres:link gitea-mirror gitea-mirror


mkdir -p /var/lib/dokku/data/storage/gitea-mirror/app/data
chown -R 1001:1001 /var/lib/dokku/data/storage/gitea-mirror/
dokku storage:mount gitea-mirror /var/lib/dokku/data/storage/gitea-mirror/app/data:/app/data

dokku git:from-image gitea-mirror ghcr.io/raylabshq/gitea-mirror:v3.8.1
# or 
# dokku git:from-image gitea-mirror ghcr.io/raylabshq/gitea-mirror:latest

Build log:

-----> Generating build context
-----> Pulling image
v3.8.1: Pulling from raylabshq/gitea-mirror
Digest: sha256:adb2076c97d2c199d2332a38db325402d39e7f3f3d8c29321c649103c6684f82
Status: Downloaded newer image for ghcr.io/raylabshq/gitea-mirror:v3.8.1
ghcr.io/raylabshq/gitea-mirror:v3.8.1
-----> Updating git repository with specified build context
remote: Enumerating objects: 5, done.
remote: Counting objects: 100% (5/5), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 1), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), 266 bytes | 266.00 KiB/s, done.
From /tmp/dokku-472981-trigger-git-git-from-directory.In2LnI
   d39fb16..c2a35bd  master     -> master
-----> Cleaning up...
-----> Building gitea-mirror from Dockerfile
[+] Building 0.1s (5/5) FINISHED                                                                                        docker:default
 => [internal] load build definition from Dockerfile                                                                              0.0s
 => => transferring dockerfile: 178B                                                                                              0.0s
 => [internal] load metadata for ghcr.io/raylabshq/gitea-mirror:v3.8.1                                                            0.0s
 => [internal] load .dockerignore                                                                                                 0.0s
 => => transferring context: 2B                                                                                                   0.0s
 => CACHED [1/1] FROM ghcr.io/raylabshq/gitea-mirror:v3.8.1                                                                       0.0s
 => exporting to image                                                                                                            0.0s
 => => exporting layers                                                                                                           0.0s
 => => writing image sha256:d51eb6a8c80494e0bc5a1b2ea52591f44d607105a60670081b55f1621f281050                                      0.0s
 => => naming to docker.io/dokku/gitea-mirror:latest                                                                              0.0s
-----> Releasing gitea-mirror...
-----> Checking for predeploy task
       No predeploy task found, skipping
-----> Checking for release task
       No release task found, skipping
=====> Processing deployment checks
 !     No healthchecks found in app.json for web process type
       No web healthchecks found in app.json. Simple container checks will be performed.
       For more efficient zero downtime deployments, add healthchecks to your app.json. See https://dokku.com/docs/deployment/zero-downtime-deploys/ for examples
-----> Deploying gitea-mirror via the docker-local scheduler...
-----> Deploying web (count=1)
       Attempting pre-flight checks (web.1)
-----> Executing 2 healthchecks
       Running healthcheck name='port listening check' attempts=3 port=4321 retries=2 timeout=5 type='listening' wait=5
       Running healthcheck name='default' type='uptime' uptime=10
       Healthcheck succeeded name='port listening check'
       Healthcheck succeeded name='default'
       All checks successful (web.1)
=====> Start of gitea-mirror container output (87c63a6f5d29 web.1)
       No custom CA certificates found in /app/certs
       System CA bundle mounted, configuring Node.js to use it...
       NODE_EXTRA_CA_CERTS set to: /etc/ssl/certs/ca-certificates.crt
       Using previously generated ENCRYPTION_SECRET
       ENCRYPTION_SECRET has been set to a secure random value
       Database already exists, Drizzle will check for pending migrations on startup...
       Setting application version: 3.7.1
       Checking for environment configuration...
       Loading configuration from environment variables...
       Successfully connected to SQLite database using Bun's native driver
       🔄 Checking for pending migrations...
       ✅ Database migrations completed successfully
       === Gitea Mirror Environment Configuration ===
       Loading configuration from environment variables...
       [ENV Config Loader] No environment configuration found, skipping initialization
       ✅ Environment configuration loaded successfully in 3ms
       ✅ Environment configuration loaded successfully
       Running startup recovery...
       Running startup recovery using compiled script...
       Successfully connected to SQLite database using Bun's native driver
       🔄 Checking for pending migrations...
       ✅ Database migrations completed successfully
       === Gitea Mirror Startup Recovery ===
       Timeout: 30000ms
       Force recovery: false
       Checking if recovery is needed...
       ✅ No jobs need recovery. Startup can proceed.
       ✅ Startup recovery completed successfully
       Running repository status repair...
       Running repository repair using compiled script...
       Successfully connected to SQLite database using Bun's native driver
       🔄 Checking for pending migrations...
       ✅ Database migrations completed successfully
       Repair process complete.
       ✅ Repository status repair completed successfully
       Starting Gitea Mirror...
       09:25:09 [@astrojs/node] Server listening on 
         local: https://localhost:4321 
         network: https://172.17.0.8:4321
       Successfully connected to SQLite database using Bun's native driver
       🔄 Checking for pending migrations...
       ✅ Database migrations completed successfully
       Using BETTER_AUTH_URL: http://localhost:4321
       Trusted origins: [ "http://localhost:4321", "http://localhost:8080" ]
       🔧 Initializing shutdown manager and signal handlers...
       🔧 Initializing shutdown manager...
       ✅ Shutdown manager initialized
       🔧 Setting up signal handlers for graceful shutdown...
       ✅ Signal handlers registered successfully
       ✅ Shutdown manager and signal handlers initialized
       [ENV Config Loader] No environment configuration found, skipping initialization
       ✅ Environment configuration loaded after user creation
       ✅ No recovery needed (startup script likely handled it)
       Starting automatic database cleanup service...
       Starting background cleanup service...
       ✅ Cleanup service started. Will run every 60 minutes.
       Starting automatic mirror scheduler service...
       [Scheduler] Starting scheduler service
       Starting repository cleanup service...
       [Repository Cleanup] Starting repository cleanup service
       [Repository Cleanup] Service started, checking every 6 hours
       [Scheduler] Auto-start conditions met for user GLebI56ILKAPa7ojskrPyoqA54igWsEg (scheduleEnabled=true, hasMirrorInterval=true)
       [Repository Cleanup] Processing 1 configurations
       [Repository Cleanup] Starting repository cleanup for user GLebI56ILKAPa7ojskrPyoqA54igWsEg
       [Repository Cleanup] Warning: CLEANUP_DELETE_FROM_GITEA is false but CLEANUP_DELETE_IF_NOT_IN_GITHUB is true. Proceeding with cleanup.
       [Scheduler] Auto-start detected from environment variables, triggering initial import and mirror...
       [Repository Cleanup] Error identifying orphaned repositories for user GLebI56ILKAPa7ojskrPyoqA54igWsEg: 16 |   }
       17 |   return decryptedConfig;
       18 | }
       19 | function getDecryptedGitHubToken(config) {
       20 |   if (!config.githubConfig?.token) {
       21 |     throw new Error("GitHub token not found in config");
                          ^
       error: GitHub token not found in config
             at getDecryptedGitHubToken (/app/dist/server/chunks/config-encryption_CA2-qgg5.mjs:21:15)
             at identifyOrphanedRepositories (/app/dist/server/chunks/repository-cleanup-service_BNxO38f9.mjs:13:28)
             at identifyOrphanedRepositories (/app/dist/server/chunks/repository-cleanup-service_BNxO38f9.mjs:10:45)
             at runRepositoryCleanup (/app/dist/server/chunks/repository-cleanup-service_BNxO38f9.mjs:156:33)
             at runRepositoryCleanup (/app/dist/server/chunks/repository-cleanup-service_BNxO38f9.mjs:134:37)
             at repositoryCleanupLoop (/app/dist/server/chunks/repository-cleanup-service_BNxO38f9.mjs:223:13)
       [Scheduler] Performing initial auto-start...
       [Repository Cleanup] No orphaned repositories found for user GLebI56ILKAPa7ojskrPyoqA54igWsEg
       [Scheduler] Skipping auto-start for user GLebI56ILKAPa7ojskrPyoqA54igWsEg: tokens not configured
       [Scheduler] Initial auto-start completed
       [Scheduler] Scheduler service started, checking every 1m for scheduled tasks
       [Scheduler] To trigger manual sync, check your configuration intervals and ensure SCHEDULE_ENABLED=true or use GITEA_MIRROR_INTERVAL
       [Scheduler] User GLebI56ILKAPa7ojskrPyoqA54igWsEg: Scheduling enabled but tokens missing (GitHub: false, Gitea: false)
       [Scheduler] 1 config(s) have scheduling enabled but lack required tokens
=====> End of gitea-mirror container output (87c63a6f5d29 web.1)
       Scheduling old container shutdown in 60 seconds (web.1)
=====> Triggering early nginx proxy rebuild
-----> Ensuring network configuration is in sync for gitea-mirror
-----> Configuring gitea-mirror.example.com...(using built-in template)
-----> Creating http nginx.conf
       Reloading nginx
-----> Running post-deploy
-----> Ensuring network configuration is in sync for gitea-mirror
-----> Configuring gitea-mirror.example.com...(using built-in template)
-----> Creating http nginx.conf
       Reloading nginx
-----> Renaming containers
       Renaming container gitea-mirror.web.1.upcoming-5295 (87c63a6f5d29) to gitea-mirror.web.1
-----> Checking for postdeploy task
       No postdeploy task found, skipping
-----> Shutting down old containers in 60 seconds
Originally created by @anasfanani on GitHub (Oct 2, 2025). Original GitHub issue: https://github.com/RayLabsHQ/gitea-mirror/issues/110 Notice this build log `Setting application version: 3.7.1` Web UI also show installed with 3.7.1 <img width="238" height="77" alt="Image" src="https://github.com/user-attachments/assets/d4f196ec-f5ac-4ad9-83b3-3d950a7e9901" /> This my deploy configuration using dokku. ```shell dokku apps:create gitea-mirror dokku ports:set gitea-mirror http:443:4321 dokku config:set gitea-mirror NODE_ENV=production \ HOST=0.0.0.0 \ PORT=4321 \ BETTER_AUTH_SECRET="5nugYaJ5PFLvhx915ysYNoUey63fBxlYjVCewgaYik0=" \ BETTER_AUTH_URL=http://localhost:4321 \ PUBLIC_BETTER_AUTH_URL=https://gitea-mirror.example.com dokku postgres:create gitea-mirror dokku postgres:link gitea-mirror gitea-mirror mkdir -p /var/lib/dokku/data/storage/gitea-mirror/app/data chown -R 1001:1001 /var/lib/dokku/data/storage/gitea-mirror/ dokku storage:mount gitea-mirror /var/lib/dokku/data/storage/gitea-mirror/app/data:/app/data dokku git:from-image gitea-mirror ghcr.io/raylabshq/gitea-mirror:v3.8.1 # or # dokku git:from-image gitea-mirror ghcr.io/raylabshq/gitea-mirror:latest ``` Build log: ```log -----> Generating build context -----> Pulling image v3.8.1: Pulling from raylabshq/gitea-mirror Digest: sha256:adb2076c97d2c199d2332a38db325402d39e7f3f3d8c29321c649103c6684f82 Status: Downloaded newer image for ghcr.io/raylabshq/gitea-mirror:v3.8.1 ghcr.io/raylabshq/gitea-mirror:v3.8.1 -----> Updating git repository with specified build context remote: Enumerating objects: 5, done. remote: Counting objects: 100% (5/5), done. remote: Compressing objects: 100% (2/2), done. remote: Total 3 (delta 1), reused 0 (delta 0), pack-reused 0 Unpacking objects: 100% (3/3), 266 bytes | 266.00 KiB/s, done. From /tmp/dokku-472981-trigger-git-git-from-directory.In2LnI d39fb16..c2a35bd master -> master -----> Cleaning up... -----> Building gitea-mirror from Dockerfile [+] Building 0.1s (5/5) FINISHED docker:default => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 178B 0.0s => [internal] load metadata for ghcr.io/raylabshq/gitea-mirror:v3.8.1 0.0s => [internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => CACHED [1/1] FROM ghcr.io/raylabshq/gitea-mirror:v3.8.1 0.0s => exporting to image 0.0s => => exporting layers 0.0s => => writing image sha256:d51eb6a8c80494e0bc5a1b2ea52591f44d607105a60670081b55f1621f281050 0.0s => => naming to docker.io/dokku/gitea-mirror:latest 0.0s -----> Releasing gitea-mirror... -----> Checking for predeploy task No predeploy task found, skipping -----> Checking for release task No release task found, skipping =====> Processing deployment checks ! No healthchecks found in app.json for web process type No web healthchecks found in app.json. Simple container checks will be performed. For more efficient zero downtime deployments, add healthchecks to your app.json. See https://dokku.com/docs/deployment/zero-downtime-deploys/ for examples -----> Deploying gitea-mirror via the docker-local scheduler... -----> Deploying web (count=1) Attempting pre-flight checks (web.1) -----> Executing 2 healthchecks Running healthcheck name='port listening check' attempts=3 port=4321 retries=2 timeout=5 type='listening' wait=5 Running healthcheck name='default' type='uptime' uptime=10 Healthcheck succeeded name='port listening check' Healthcheck succeeded name='default' All checks successful (web.1) =====> Start of gitea-mirror container output (87c63a6f5d29 web.1) No custom CA certificates found in /app/certs System CA bundle mounted, configuring Node.js to use it... NODE_EXTRA_CA_CERTS set to: /etc/ssl/certs/ca-certificates.crt Using previously generated ENCRYPTION_SECRET ENCRYPTION_SECRET has been set to a secure random value Database already exists, Drizzle will check for pending migrations on startup... Setting application version: 3.7.1 Checking for environment configuration... Loading configuration from environment variables... Successfully connected to SQLite database using Bun's native driver 🔄 Checking for pending migrations... ✅ Database migrations completed successfully === Gitea Mirror Environment Configuration === Loading configuration from environment variables... [ENV Config Loader] No environment configuration found, skipping initialization ✅ Environment configuration loaded successfully in 3ms ✅ Environment configuration loaded successfully Running startup recovery... Running startup recovery using compiled script... Successfully connected to SQLite database using Bun's native driver 🔄 Checking for pending migrations... ✅ Database migrations completed successfully === Gitea Mirror Startup Recovery === Timeout: 30000ms Force recovery: false Checking if recovery is needed... ✅ No jobs need recovery. Startup can proceed. ✅ Startup recovery completed successfully Running repository status repair... Running repository repair using compiled script... Successfully connected to SQLite database using Bun's native driver 🔄 Checking for pending migrations... ✅ Database migrations completed successfully Repair process complete. ✅ Repository status repair completed successfully Starting Gitea Mirror... 09:25:09 [@astrojs/node] Server listening on local: https://localhost:4321 network: https://172.17.0.8:4321 Successfully connected to SQLite database using Bun's native driver 🔄 Checking for pending migrations... ✅ Database migrations completed successfully Using BETTER_AUTH_URL: http://localhost:4321 Trusted origins: [ "http://localhost:4321", "http://localhost:8080" ] 🔧 Initializing shutdown manager and signal handlers... 🔧 Initializing shutdown manager... ✅ Shutdown manager initialized 🔧 Setting up signal handlers for graceful shutdown... ✅ Signal handlers registered successfully ✅ Shutdown manager and signal handlers initialized [ENV Config Loader] No environment configuration found, skipping initialization ✅ Environment configuration loaded after user creation ✅ No recovery needed (startup script likely handled it) Starting automatic database cleanup service... Starting background cleanup service... ✅ Cleanup service started. Will run every 60 minutes. Starting automatic mirror scheduler service... [Scheduler] Starting scheduler service Starting repository cleanup service... [Repository Cleanup] Starting repository cleanup service [Repository Cleanup] Service started, checking every 6 hours [Scheduler] Auto-start conditions met for user GLebI56ILKAPa7ojskrPyoqA54igWsEg (scheduleEnabled=true, hasMirrorInterval=true) [Repository Cleanup] Processing 1 configurations [Repository Cleanup] Starting repository cleanup for user GLebI56ILKAPa7ojskrPyoqA54igWsEg [Repository Cleanup] Warning: CLEANUP_DELETE_FROM_GITEA is false but CLEANUP_DELETE_IF_NOT_IN_GITHUB is true. Proceeding with cleanup. [Scheduler] Auto-start detected from environment variables, triggering initial import and mirror... [Repository Cleanup] Error identifying orphaned repositories for user GLebI56ILKAPa7ojskrPyoqA54igWsEg: 16 | } 17 | return decryptedConfig; 18 | } 19 | function getDecryptedGitHubToken(config) { 20 | if (!config.githubConfig?.token) { 21 | throw new Error("GitHub token not found in config"); ^ error: GitHub token not found in config at getDecryptedGitHubToken (/app/dist/server/chunks/config-encryption_CA2-qgg5.mjs:21:15) at identifyOrphanedRepositories (/app/dist/server/chunks/repository-cleanup-service_BNxO38f9.mjs:13:28) at identifyOrphanedRepositories (/app/dist/server/chunks/repository-cleanup-service_BNxO38f9.mjs:10:45) at runRepositoryCleanup (/app/dist/server/chunks/repository-cleanup-service_BNxO38f9.mjs:156:33) at runRepositoryCleanup (/app/dist/server/chunks/repository-cleanup-service_BNxO38f9.mjs:134:37) at repositoryCleanupLoop (/app/dist/server/chunks/repository-cleanup-service_BNxO38f9.mjs:223:13) [Scheduler] Performing initial auto-start... [Repository Cleanup] No orphaned repositories found for user GLebI56ILKAPa7ojskrPyoqA54igWsEg [Scheduler] Skipping auto-start for user GLebI56ILKAPa7ojskrPyoqA54igWsEg: tokens not configured [Scheduler] Initial auto-start completed [Scheduler] Scheduler service started, checking every 1m for scheduled tasks [Scheduler] To trigger manual sync, check your configuration intervals and ensure SCHEDULE_ENABLED=true or use GITEA_MIRROR_INTERVAL [Scheduler] User GLebI56ILKAPa7ojskrPyoqA54igWsEg: Scheduling enabled but tokens missing (GitHub: false, Gitea: false) [Scheduler] 1 config(s) have scheduling enabled but lack required tokens =====> End of gitea-mirror container output (87c63a6f5d29 web.1) Scheduling old container shutdown in 60 seconds (web.1) =====> Triggering early nginx proxy rebuild -----> Ensuring network configuration is in sync for gitea-mirror -----> Configuring gitea-mirror.example.com...(using built-in template) -----> Creating http nginx.conf Reloading nginx -----> Running post-deploy -----> Ensuring network configuration is in sync for gitea-mirror -----> Configuring gitea-mirror.example.com...(using built-in template) -----> Creating http nginx.conf Reloading nginx -----> Renaming containers Renaming container gitea-mirror.web.1.upcoming-5295 (87c63a6f5d29) to gitea-mirror.web.1 -----> Checking for postdeploy task No postdeploy task found, skipping -----> Shutting down old containers in 60 seconds ```
kerem closed this issue 2026-02-27 15:54:50 +03:00
Author
Owner

@arunavo4 commented on GitHub (Oct 2, 2025):

Hey this is caused by a release that's there but I have not marked it latest as we need to test it for a specific thing

<!-- gh-comment-id:3360172869 --> @arunavo4 commented on GitHub (Oct 2, 2025): Hey this is caused by a release that's there but I have not marked it latest as we need to test it for a specific thing
Author
Owner

@anasfanani commented on GitHub (Oct 2, 2025):

I also test build my own docker image with this.

dokku git:from-archive --archive-type zip gitea-mirror https://github.com/RayLabsHQ/gitea-mirror/archive/refs/tags/v3.8.0.zip "Camila" "camila@example.com"

And still show 3.7.1, if this is not a latest release why not mark it as v3.8.0-pre

<!-- gh-comment-id:3360238113 --> @anasfanani commented on GitHub (Oct 2, 2025): I also test build my own docker image with this. ```bash dokku git:from-archive --archive-type zip gitea-mirror https://github.com/RayLabsHQ/gitea-mirror/archive/refs/tags/v3.8.0.zip "Camila" "camila@example.com" ``` And still show `3.7.1`, if this is not a latest release why not mark it as `v3.8.0-pre`
Author
Owner

@arunavo4 commented on GitHub (Oct 2, 2025):

Heyy @anasfanani my bad i forgot to change the version number on package.json github.com/RayLabsHQ/gitea-mirror@b39d7a2179/package.json (L4)

<!-- gh-comment-id:3361625941 --> @arunavo4 commented on GitHub (Oct 2, 2025): Heyy @anasfanani my bad i forgot to change the version number on `package.json` https://github.com/RayLabsHQ/gitea-mirror/blob/b39d7a21791f22751e13da01f814e3fa89cfa8ff/package.json#L4
Author
Owner

@anasfanani commented on GitHub (Oct 2, 2025):

Heyy @anasfanani my bad i forgot to change the version number on package.json

gitea-mirror/package.json

Line 4 in b39d7a2

"version": "3.7.1",

I recomend to create scripts helper to manage version without manual edit file each time, example https://github.com/coder/registry/blob/main/.github/scripts/version-bump.sh

Me also trying follow versioning best practice like this https://github.com/coder/registry/blob/main/CONTRIBUTING.md#versioning-guidelines

<!-- gh-comment-id:3361653204 --> @anasfanani commented on GitHub (Oct 2, 2025): > Heyy [@anasfanani](https://github.com/anasfanani) my bad i forgot to change the version number on `package.json` > > [gitea-mirror/package.json](https://github.com/RayLabsHQ/gitea-mirror/blob/b39d7a21791f22751e13da01f814e3fa89cfa8ff/package.json#L4) > > Line 4 in [b39d7a2](/RayLabsHQ/gitea-mirror/commit/b39d7a21791f22751e13da01f814e3fa89cfa8ff) > > "version": "3.7.1", I recomend to create scripts helper to manage version without manual edit file each time, example https://github.com/coder/registry/blob/main/.github/scripts/version-bump.sh Me also trying follow versioning best practice like this https://github.com/coder/registry/blob/main/CONTRIBUTING.md#versioning-guidelines
Author
Owner

@arunavo4 commented on GitHub (Oct 2, 2025):

@anasfanani for now use the latest v3.8.2 and I will look into integrating the scripts

<!-- gh-comment-id:3362134291 --> @arunavo4 commented on GitHub (Oct 2, 2025): @anasfanani for now use the latest `v3.8.2` and I will look into integrating the scripts
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#55
No description provided.