BaseX: Use and Error Questions
Thursday, 20 June 2019 · 3 messages
JC
Jordan Castillo20 Jun 2019 02:08 #
Hello BaseX Staff,
I am a developer who is new to BaseX and am getting stuck sending commands through the basex executable.
My goal is to either open the CLI executable and send a command (through a script), or send the command without the basex CLI opening, as long as the command is run.
In my recent attempt that I thought was close, I received the following error message:
users-MacBook-Pro:Scripts user$ /Users/user/Downloads/basex/bin/basex -c/Users/user/Desktop/O-Lab/Examples/Scripts/commands.bsx
Improper use? Potential bug? Your feedback is welcome:
Contact: basex-talk at mailman.uni-konstanz.de
Version: BaseX 9.2.2
Java: Oracle Corporation, 12.0.1
OS: Mac OS X, x86_64
Stack Trace:
java.lang.RuntimeException: exists: 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.core.CLI.execute(CLI.java:63)
at org.basex.BaseX.<init>(BaseX.java:80)
at org.basex.BaseX.main(BaseX.java:42)
The command file I am trying to have basex accept looks like this:
OPEN exists
ADD
/Users/user/Desktop/O-Lab/Examples/cubesat/BINARIES/BINARY-03abaa7c-18fd-40a4-a26b-4be24089cfe4
With many more "ADD ..." commands to follow.
Any advice on how to perform this operation would be greatly appreciated.
Thanks,
Jordan Castillo
CG
Christian Grün20 Jun 2019 15:28 #
Hi Jordan,
The way you proceeded looks ok to me. Some questions:
1. Did you run any operations in parallel while the script was running (such as checking the progress of the script via the GUI or another CLI instance)?
2. Does the problem always occur after the same ADD operation in your script?
3. Does it work if you create a new database instead of opening an existing one?…
CREATE DB exists
ADD /Users/user/Desktop/O-Lab/Examples/cubesat/BINARIES/BINARY-03abaa7c-18fd-40a4-a26b-4be24089cfe4 ...
Thanks in advance
Christian
Quoted text · Jordan Castillo · 71 lines
On Thu, Jun 20, 2019 at 12:08 AM Jordan Castillo <jordantcastillo1992 at gmail.com> wrote: > > Hello BaseX Staff, > > I am a developer who is new to BaseX and am getting stuck sending commands through the basex executable. > My goal is to either open the CLI executable and send a command (through a script), or send the command without the basex CLI opening, as long as the command is run. > In my recent attempt that I thought was close, I received the following error message: > > users-MacBook-Pro:Scripts user$ /Users/user/Downloads/basex/bin/basex -c/Users/user/Desktop/O-Lab/Examples/Scripts/commands.bsx > > Improper use? Potential bug? Your feedback is welcome: > > Contact: basex-talk at mailman.uni-konstanz.de > > Version: BaseX 9.2.2 > > Java: Oracle Corporation, 12.0.1 > > OS: Mac OS X, x86_64 > > Stack Trace: > > java.lang.RuntimeException: exists: 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.core.CLI.execute(CLI.java:63) > > at org.basex.BaseX.<init>(BaseX.java:80) > > at org.basex.BaseX.main(BaseX.java:42) > > > The command file I am trying to have basex accept looks like this: > > > > OPEN exists > > ADD /Users/user/Desktop/O-Lab/Examples/cubesat/BINARIES/BINARY-03abaa7c-18fd-40a4-a26b-4be24089cfe4 > > > With many more "ADD ..." commands to follow. > > > Any advice on how to perform this operation would be greatly appreciated. > > > Thanks, > > > Jordan Castillo
CG
Christian Grün20 Jun 2019 18:42 #
Hi Jordan,
So that must have been the reason. If you use the GUI, you’ll need to avoid parallel requests on opened databases because there will be no synchronization between these instances (see [1] for more details).
You can run your script inside the GUI; maybe that solves your problems.
Cheers
Christian
[1] http://docs.basex.org/wiki/Startup#Concurrent_Operations
Jordan Castillo <jordantcastillo1992 at gmail.com> schrieb am Do., 20. Juni 2019, 18:36:
Quoted text · Christian Grün · 119 lines
> Hello Christian, > > First, thank you for the speedy reply. > > 1. This was the source of the problem. After closing the GUI I could run > the script that failed previously. > 2. The GUI can remain open if I instead use the CREATE DB or CHECK > commands rather than the OPEN command. > > Hope you have a great day. > > Jordan Castillo > > On Thu, Jun 20, 2019 at 6:28 AM Christian Grün <christian.gruen at gmail.com> > wrote: > >> Hi Jordan, >> >> The way you proceeded looks ok to me. Some questions: >> >> 1. Did you run any operations in parallel while the script was running >> (such as checking the progress of the script via the GUI or another >> CLI instance)? >> 2. Does the problem always occur after the same ADD operation in your >> script? >> 3. Does it work if you create a new database instead of opening an >> existing one?… >> >> CREATE DB exists >> ADD >> /Users/user/Desktop/O-Lab/Examples/cubesat/BINARIES/BINARY-03abaa7c-18fd-40a4-a26b-4be24089cfe4 >> ... >> >> Thanks in advance >> Christian >> >> >> >> >> On Thu, Jun 20, 2019 at 12:08 AM Jordan Castillo >> <jordantcastillo1992 at gmail.com> wrote: >> > >> > Hello BaseX Staff, >> > >> > I am a developer who is new to BaseX and am getting stuck sending >> commands through the basex executable. >> > My goal is to either open the CLI executable and send a command >> (through a script), or send the command without the basex CLI opening, as >> long as the command is run. >> > In my recent attempt that I thought was close, I received the following >> error message: >> > >> > users-MacBook-Pro:Scripts user$ /Users/user/Downloads/basex/bin/basex >> -c/Users/user/Desktop/O-Lab/Examples/Scripts/commands.bsx >> > >> > Improper use? Potential bug? Your feedback is welcome: >> > >> > Contact: basex-talk at mailman.uni-konstanz.de >> > >> > Version: BaseX 9.2.2 >> > >> > Java: Oracle Corporation, 12.0.1 >> > >> > OS: Mac OS X, x86_64 >> > >> > Stack Trace: >> > >> > java.lang.RuntimeException: exists: 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.core.CLI.execute(CLI.java:63) >> > >> > at org.basex.BaseX.<init>(BaseX.java:80) >> > >> > at org.basex.BaseX.main(BaseX.java:42) >> > >> > >> > The command file I am trying to have basex accept looks like this: >> > >> > >> > >> > OPEN exists >> > >> > ADD >> /Users/user/Desktop/O-Lab/Examples/cubesat/BINARIES/BINARY-03abaa7c-18fd-40a4-a26b-4be24089cfe4 >> > >> > >> > With many more "ADD ..." commands to follow. >> > >> > >> > Any advice on how to perform this operation would be greatly >> appreciated. >> > >> > >> > Thanks, >> > >> > >> > Jordan Castillo >> >
Written for BaseX 9.2. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery