Thursday, July 25, 2013

Archiva startup error

We started seeing this problem in Archiva:
SQL Exception: An SQL data change is not permitted for a read-only connection, user or database.
The problem ended up being Apache was started as root and so the derby lock file (db.lck) was owned by root. When it was restarted as the proper user it could not update the lock file and so opened the database as read-only.

Solution:

Change the owner of the lock file to the one that owns the process.  NOTE: The lock file was not where I assumed it was but was mentioned in the log file with this error:

org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Failed to start database '/usr/local/maven/db/archiva/users', see the next exception for details.)
I never did find the promised exception with detail, just lots of these errors.

No comments: