Upgrade to 3.78.2-04 from 3.72.0-04 fails with "The database is read only"

First of all, there’s a mistake made in the install-nexus-service.bat file: KARAF_BASE is not set, making the installation routine fail because the base directory is missing for “NEXUS_JAVA_HOME=%KARAF_BASE%\jdk\temurin_17.0.13_11_windows_x86_64\jdk-17.0.13+11”.

The main issue: After the service is installed and started, it stops. The stdout log is filled with errors for each database insert or update it tries to do. The errors contains “The database is read only”. One example:

Error updating database. Cause: org.h2.jdbc.JdbcSQLNonTransientException: The database is read only; SQL statement:

ALTER TABLE helm_component ADD COLUMN IF NOT EXISTS normalized_version VARCHAR [90097-232]

This is on Windows Server 2016. The old service was uninstalled as per normal routine for older versions. And I even rebooted the machine to be sure there was nothing else locking the database.

Any tips on what I might have done wrong here? Or should I wait for a new version?

It sounds like potentially a permissions issue for the service as its able to open the database but as read-only

Looks like you are right! 3.72 service runs as local system account. And as far as I can remember, it was set as Local Service after I installed the 3.78 service. I must have missed the breaking changes notice in the documentation.

Thank you!

Finally managed to upgrade to 3.78.2.

  • Had to add the missing path %KARAF_BASE% in install-nexus-service.bat
  • Added write permissions to the data-folder for user Local Service before running the batch file.

Thanks a lot for pointing me in the right direction!

@Tor_Inge_Johannessen Can you list the changes you have made?

Hi, it was listed in my latest post. But to be specific:

Changed line 37 in install-nexus-service.bat to:

set “NEXUS_JAVA_HOME=E:\Nexus\nexus-3.78.2-04\jdk\temurin_17.0.13_11_windows_x86_64\jdk-17.0.13+11”

Gave “Local Service” full access to E:\Nexus\sonatype-work and all subfolders. (Write permissions may be sufficient. But the service ran as local system in previous versions and therefore had full access.)