Built-in container registry returns 500 on HEAD /v2/<repo>/manifests/<tag> with MariaDB backend #3216
maregg91 opened 4 days ago

Pushing (and pulling) an image to the built-in container registry fails when OneDev uses an external MariaDB database.

14:16:06 Running step "Build framework Docker Image"...
14:16:07 #0 building with "onedev" instance using docker-container driver
14:16:07 
14:16:07 #1 [internal] load build definition from Dockerfile
14:16:07 #1 transferring dockerfile:
14:16:07 #1 transferring dockerfile: 357B done
14:16:07 #1 DONE 0.2s
14:16:07 
14:16:07 #2 [internal] load metadata for docker.io/library/python:3.12
14:16:08 #2 DONE 0.4s
14:16:08 
14:16:08 #3 [internal] load .dockerignore
14:16:08 #3 transferring context:
14:16:08 #3 transferring context: 2B done
14:16:08 #3 DONE 0.2s
14:16:08 
14:16:08 #4 [internal] load build context
14:16:08 #4 transferring context: 29.77kB 0.0s done
14:16:08 #4 DONE 0.3s
14:16:08 
14:16:08 #5 [1/7] FROM docker.io/library/python:3.12@sha256:17b9724493d916f56565c131f389faff2597f46dec6ce09516f95125bc9f519f
14:16:08 #5 resolve docker.io/library/python:3.12@sha256:17b9724493d916f56565c131f389faff2597f46dec6ce09516f95125bc9f519f 0.2s done
14:16:08 #5 DONE 0.2s
14:16:08 
14:16:08 #6 [5/7] ADD framework_yapf_format.style.yapf /common_files/framework_yapf_format.style.yapf
14:16:08 #6 CACHED
14:16:08 
14:16:08 #7 [6/7] ADD tools/yapf_code_climate /usr/bin/yapf_code_climate
14:16:08 #7 CACHED
14:16:08 
14:16:08 #8 [2/7] RUN apt update
14:16:08 #8 CACHED
14:16:08 
14:16:08 #9 [3/7] RUN apt install -y iputils-ping yapf3 python3-yapf
14:16:08 #9 CACHED
14:16:08 
14:16:08 #10 [4/7] ADD pylintrc /common_files/pylintrc
14:16:08 #10 CACHED
14:16:08 
14:16:08 #11 [7/7] ADD tools/yapf_code_climate_onedev /usr/bin/yapf_code_climate_onedev
14:16:08 #11 CACHED
14:16:08 
14:16:08 #12 exporting to image
14:16:08 #12 exporting layers done
14:16:08 #12 exporting manifest sha256:632a7eb4cfe45e9db782472926a7d1616594765a305b2e8a5da5ab677b358483 0.0s done
14:16:08 #12 exporting config sha256:dd3a54c501e7485c9f9d5574d260f93ef35efbec0d25307172666febe888c44b 0.0s done
14:16:08 #12 exporting attestation manifest sha256:a5be191c43c532d826b2582ba833367ae326a4ea393a174b0fc91d23984e8e0b
14:16:09 #12 exporting attestation manifest sha256:a5be191c43c532d826b2582ba833367ae326a4ea393a174b0fc91d23984e8e0b 0.5s done
14:16:09 #12 exporting manifest list sha256:9720ea236471f89619654c29daa2d471b50de170afb08014c7933b744e2cf8e5
14:16:09 #12 exporting manifest list sha256:9720ea236471f89619654c29daa2d471b50de170afb08014c7933b744e2cf8e5 0.2s done
14:16:09 #12 ...
14:16:09 
14:16:09 #13 [auth] *:: framework/setup/setup:pull,push token for one.domain.com
14:16:09 #13 DONE 0.0s
14:16:09 
14:16:09 #12 exporting to image
14:16:09 #12 pushing layers
14:16:11 #12 pushing layers 1.6s done
14:16:11 #12 pushing manifest for one.domain.com/framework/setup/setup:latest@sha256:9720ea236471f89619654c29daa2d471b50de170afb08014c7933b744e2cf8e5
14:16:12 #12 3.525 error: unexpected status from HEAD request to https://one.domain.com/v2/framework/setup/setup/manifests/latest: 500 Server Error
14:16:12 #12 3.525 retrying in 1s
14:16:13 #12 4.795 error: unexpected status from HEAD request to https://one.domain.com/v2/framework/setup/setup/manifests/latest: 500 Server Error
14:16:13 #12 4.795 retrying in 2s
14:16:15 #12 7.071 error: unexpected status from HEAD request to https://one.domain.com/v2/framework/setup/setup/manifests/latest: 500 Server Error
14:16:15 #12 7.071 retrying in 4s
14:16:20 #12 pushing manifest for one.domain.com/framework/setup/setup:latest@sha256:9720ea236471f89619654c29daa2d471b50de170afb08014c7933b744e2cf8e5 8.8s done
14:16:20 #12 11.32 error: unexpected status from HEAD request to https://one.domain.com/v2/framework/setup/setup/manifests/latest: 500 Server Error
14:16:20 #12 ERROR: failed to push one.domain.com/framework/setup/setup:latest: unexpected status from HEAD request to https://one.domain.com/v2/framework/setup/setup/manifests/latest: 500 Server Error
14:16:21 ------
14:16:21  > exporting to image:
14:16:21 3.525 error: unexpected status from HEAD request to https://one.domain.com/v2/framework/setup/setup/manifests/latest: 500 Server Error
14:16:21 3.525 retrying in 1s
14:16:21 4.795 error: unexpected status from HEAD request to https://one.domain.com/v2/framework/setup/setup/manifests/latest: 500 Server Error
14:16:21 4.795 retrying in 2s
14:16:21 7.071 error: unexpected status from HEAD request to https://one.domain.com/v2/framework/setup/setup/manifests/latest: 500 Server Error
14:16:21 7.071 retrying in 4s
14:16:21 11.32 error: unexpected status from HEAD request to https://one.domain.com/v2/framework/setup/setup/manifests/latest: 500 Server Error
14:16:21 ------
14:16:21 ERROR: failed to build: failed to solve: failed to push one.domain.com/framework/setup/setup:latest: unexpected status from HEAD request to https://one.domain.com/v2/framework/setup/setup/manifests/latest: 500 Server Error
14:16:21 Command execution failed (command: docker buildx build --builder onedev --pull . --push -t one.domain.com/framework/setup/setup:latest, exit code: 1)
14:16:21 Step "Build framework Docker Image" is failed

The server log is attached onedev_error_mariadb_2.txt

Environment / what I’ve ruled out:

Reproduces on MariaDB 10.11 and MariaDB 13 → not a server-version issue; it’s at the driver/query level.

sql_mode does not contain NO_BACKSLASH_ESCAPES (default: STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION).

Blob uploads and manifest-by-digest PUTs succeed; only the by-tag HEAD/lookup fails.

  • Robin Shen commented 3 days ago

    The attached stack trace points to an old MariaDB JDBC driver. I reproduced the parsing failure using the exact SQL from the attachment: mariadb-java-client-2.3.0.jar recognizes only 3 of its 6 parameter placeholders, so binding parameter 4 (latest) fails. The currently bundled mariadb-java-client-3.5.10.jar correctly recognizes all 6. The old driver's exception location also matches the attached stack trace.

    The bundled driver was already updated for issue #3135 in commit a52c35ef163eee83a0a460303fcedc9b2ccb99e5. However, OneDev upgrades preserve the existing site/lib directory, so upgrading OneDev can leave the old driver in use.

    Please stop OneDev, replace the old MariaDB JDBC JAR in the installation's site/lib directory with mariadb-java-client-3.5.10.jar from the current OneDev distribution, and restart. Remove the old MariaDB JDBC JAR from that directory so only one version remains. For the official Docker image, the active installation uses /opt/onedev/site/lib; the bundled replacement is in /app/site/lib.

    This was verified at the JDBC SQL-parser level; an end-to-end container push/pull against the affected installation has not been run. No source change is needed for the reported driver parsing failure on the current branch.

  • Robin Shen changed state to 'Closed' 3 days ago
    Previous Value Current Value
    Open
    Closed
  • maregg91 commented 3 days ago

    Worked. Thank you!

1/1
Type
Bug
Priority
Normal
Assignee
Affected Versions
17.0.1
Labels
No labels
Issue Votes (0)
Watchers (2)
Reference
OD-3216
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover