Hi Thomas,
Thanks for your mail.
As you have already reported back to us, it seems to be an inconsistency in your database that seems to trigger the exception. It’s true that the INSPECT cannot catch all possible inconsistencies in a database. You can try to…
1. export all files from your database and import them in the new instance, 2. optimize your database 3. fully optimize your database (with the ALL option). Just to be sure, it may be wise to create a backup before the optimization.
If you have some vague idea of when the bug happened first, you could scan the database logs from that period of time and the days before.
I didn’t encounter a similar error in the recent past, so maybe it was caused by a previous version of BaseX. It’s always a good idea to switch to the latest version. Do you remember which version you started with?
Best, Christian
On Wed, Dec 30, 2020 at 2:26 PM Thomas Spitaler tommy.spitaler@gmail.com wrote:
Hi,
in one of our projects we are using BaseX. So far we are very happy with our choice, but recently we got an error that we could not fix. The only solution that worked was to create a new, empty database.
When trying to add a document to the database, we get an exception and a message „lock file does not exist“:
$ open cap10_cap_store_prod Database 'cap10_cap_store_prod' was opened in 219.99 ms.
$ add /home/thomas/tmp/test.xml Improper use? Potential bug? Your feedback is welcome: Contact: basex-talk@mailman.uni-konstanz.de Version: BaseX 9.0.1 Java: Debian, 11.0.9 OS: Linux, amd64 Stack Trace: java.lang.RuntimeException: cap10_cap_store_prod: lock file does not exist. at org.basex.util.Util.notExpected(Util.java:61) at org.basex.data.DiskData.finishUpdate(DiskData.java:246) at org.basex.core.cmd.ACreate.update(ACreate.java:97) at org.basex.core.cmd.Add.run(Add.java:56) at org.basex.core.Command.run(Command.java:257) at org.basex.core.Command.execute(Command.java:93) at org.basex.api.client.LocalSession.execute(LocalSession.java:132) at org.basex.api.client.Session.execute(Session.java:36) at org.basex.core.CLI.execute(CLI.java:92) at org.basex.core.CLI.execute(CLI.java:76) at org.basex.BaseX.console(BaseX.java:196) at org.basex.BaseX.<init>(BaseX.java:171) at org.basex.BaseX.main(BaseX.java:42)
Which lock file is the error referring to? Can we create it manually to make it work again?
The error only happens in the database that we have been using so far (cap10_cap_store_prod). After creating and using a new one (cap10_cap_store_prod2) the problem does not occur. Here is the output of running list on the database:
$ list
Name Resources Size Input Path
cap10_cap_store_prod 233387 1583797639 cap10_cap_store_prod2 241 1912414 testdb 1 4611
3 database(s).
Did we hit a size limit of BaseX? I checked the server and it has enough free disk space and free inodes available.
Some more background info:
The system runs on a cluster of servers. BaseX runs on one of them, bound to port 1984. The other nodes in the cluster connect to the BaseX-Server via the network. In my understanding, this type of concurrency is supported by BaseX.
The software on the nodes is implemented in Elixir. We wrote our own Elixir client library that is a thin wrapper around https://github.com/zadean/basexerl, an existing open source Erlang client library for BaseX.
Our Elixir client library keeps open a pool of connections to the BaseX server. So far and until we encountered the above error everything worked perfectly. Also, after creating a new database everything works fine again.
This error also occurs after shutting down all the nodes that connect to our BaseX instance. We checked using the lsof command and there are no connections open to the database other then the client we use to reproduce the error.
Any help would be greatly appreciated!
Kind regards, Thomas
Kind regards, Thomas