Hi Christian,
we could solve the issue: a machine was cloned for test purposes without me knowing about it. We’re using NFS to mount the storage that hosts the BaseX data directly, so there were two BaseX server processes accessing the same files.
Thanks for your help!
Kind regards, Thomas
On 8 Jan 2021, at 9:24, Christian Grün wrote:
Hi Thomas,
$ xquery db:optimize("cap10_cap_store_prod") [db:lock] Database 'cap10_cap_store_prod' is currently opened by another process.
I did not found any upd.basex file in the data directory, so I assume it is a database lock.
Exactly. Usually, this error occurs only if you have multiple independent BaseX instances accessing the data at the same time (independent means that the instances are no clients who communicate with a single database server). If the error does not disappear after a restart of your system, and if you have ensured that no other BaseX/Java process is running simultaneously, you could…
- download a fresh and most recent version of BaseX,
- copy the challenging database into that instance,
- start BaseX in debugging mode in the console (basex -d),
- call OPTIMIZE and, if it fails,
- share the command-line output with us.
We have to assume that this could possibly happen again and need a strategy to deal with it.
I hope it doesn’t (I didn’t encounter similar problems in our productive environments so far). If a server is shut down ungracefully, we cannot promise that your data will remain to be intact, though. Do you have some more information on what happened that particular day?
It’s generally advisable to back up your data in regular intervals. You can e.g. register Job Services for that [1].
Hope this helps Christian