Maven package uploads return HTTP 500 on OneDev 16.7.2 with MariaDB due to a JDBC parameter binding error #3135
kobe opened 15 hours ago

Environment

  • OneDev: 1dev/server:16.7.2
  • Database: MariaDB 10.6.18
  • Hibernate dialect: org.hibernate.dialect.MariaDBDialect
  • JDBC driver: mariadb-java-client-2.3.0.jar, included in the image at /app/site/lib/
  • Data directory: /opt/leosys/onedev/data on the host, mounted at /opt/onedev in the container
  • MariaDB SQL mode: NO_BACKSLASH_ESCAPES is absent from both global and session settings.

Steps to reproduce

Use Maven deploy:deploy-file to upload a JAR to a project's Maven registry. For example, upload com.arcsoft.face:arcsoft-sdk-face:4.2.1.0 (approximately 80 KB).

Actual result

The upload returns HTTP 500, and Maven reports that the JAR could not be transferred. The OneDev log reports:

Could not set parameter at position 4 (values was '4.2.1.0')

The error occurs while MavenPackHandler.uploadBlob calls DefaultPackService.findByNameAndVersion.

A larger JAR also fails with HTTP 500. The 80 KB JAR still fails after upgrading OneDev to 16.7.2.

Expected result

The Maven package uploads successfully. If the package is invalid, OneDev returns a clear client error instead of HTTP 500.

Additional information

The unmounted 1dev/server:16.7.2 image contains mariadb-java-client-2.3.0.jar at /app/site/lib/. Replacing the JDBC driver has not been tested, so its version is an investigation lead rather than a confirmed cause.

  • kobe commented 15 hours ago

    Root cause and workaround

    The HTTP 500 error was caused by the MariaDB JDBC driver bundled with the OneDev image. The image includes mariadb-java-client-2.3.0.jar at /app/site/lib/.

    Upgrading OneDev from 16.7.0 to 16.7.2 did not resolve the issue: the same test upload still failed with the JDBC parameter binding error.

    I then replaced the bundled MariaDB JDBC driver with MariaDB Connector/J 3.5.6 and restarted OneDev. The same com.arcsoft.face:arcsoft-sdk-face:4.2.1.0 artifact uploaded successfully. I subsequently uploaded all 33 JARs successfully, with no failures.

    Please consider updating the MariaDB JDBC driver bundled with the official image, or checking compatibility between the bundled driver and the SQL generated by the current Hibernate version.

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