Hi Christian,

Thank you very much.
The function helped me to find the solution to my problem, and to solve it

Now I'll look into upgrading to the new version.

Best regards,
Philippe

Le 13/12/2022 à 17:42, Christian Grün a écrit :
Hi Philippe,

I remember we’ve fixed a bug like this 2, 3 years ago. BaseX 9.2.1 is
pretty old now; do you have a chance to upgrade to BaseX 10.4 or at
least BaseX 9.6.4?

I guess the problem should disappear if you run OPTIMIZE ALL or
db:optimize(..., true()) and switch to the new version.

Hope this helps, cordiales salutations,
Christian


On Tue, Dec 13, 2022 at 11:04 AM Philippe Pons
<philippe.pons@college-de-france.fr> wrote:
Hi all,

I tried to replace a database in the BaseX Database Administration (dba). A simple task that I often do.
But this time, I get this message:


Unexpected error: Improper use? Potential bug? Your feedback is welcome:
Contact: basex-talk@mailman.uni-konstanz.de
Version: BaseX 9.2.1
Java: Oracle Corporation, 1.8.0_231
OS: Linux, amd64
Stack Trace:
java.lang.ArrayIndexOutOfBoundsException: 1
at org.basex.io.random.TableDiskAccess.fpre(TableDiskAccess.java:507)
at org.basex.io.random.TableDiskAccess.cursor(TableDiskAccess.java:468)
at org.basex.io.random.TableDiskAccess.read1(TableDiskAccess.java:156)
at org.basex.data.Data.kind(Data.java:304)
at org.basex.query.value.node.DBNode.<init>(DBNode.java:50)
at org.basex.query.value.seq.DBNodeSeq.get(DBNodeSeq.java:139)
at org.basex.query.value.seq.DBNodeSeq.get(DBNodeSeq.java:164)
at org.basex.query.func.db.DbOpen.value(DbOpen.java:19)
at org.basex.query.func.StandardFunc.optimize(StandardFunc.java:82)
at org.basex.query.expr.Arr.compile(Arr.java:43)
at org.basex.query.expr.path.Path.compile(Path.java:129)
at org.basex.query.expr.If.compile(If.java:58)
at org.basex.query.func.StaticFunc.comp(StaticFunc.java:69)
at org.basex.query.QueryCompiler.compile(QueryCompiler.java:114)
at org.basex.query.QueryCompiler.compile(QueryCompiler.java:105)
at org.basex.query.QueryContext.compile(QueryContext.java:312)
at org.basex.query.QueryContext.iter(QueryContext.java:331)
at org.basex.http.restxq.RestXqResponse.serialize(RestXqResponse.java:73)
at org.basex.http.web.WebResponse.create(WebResponse.java:56)
at org.basex.http.restxq.RestXqServlet.run(RestXqServlet.java:54)
at org.basex.http.BaseXServlet.service(BaseXServlet.java:62)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:865)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:542)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1700)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1345)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:480)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1667)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1247)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.Server.handle(Server.java:505)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:370)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:267)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:786)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:743)
at java.lang.Thread.run(Thread.java:748)



Could you help me to find a solution?

Many thanks,
Philippe