GeezerVison is showing github.com — Database locks up with ArrayIndexOutOfBoundsException (cannot switch between databases) · Issue #1341 · ArcadeData/arcadedb
Database locks up with ArrayIndexOutOfBoundsException (cannot switch between databases) #1341DescriptionReferencing this #1165 (comment)
It seems a database reaches some state where it freezes upon switching databases.
I don't know what causes this state (I am using simple cypher queries, nothing complicated)... however, I am attaching files to reproduce the error.
To reproduce the error
-
Unzip attached database folders (where 'ea' seems to be in the locked state)
databases.zip
-
Start ArcadeDB using unzipped databases...e.g. docker command, but replace YOURPATH
docker run -p 2480:2480 -p 2424:2424 --name arcadedb \
-v /YOURPATH/databases:/home/arcadedb/databases \
-e JAVA_OPTS="-Darcadedb.server.rootPassword=playwithdata" \
arcadedata/arcadedb:latest
- Open ArcadeDB studio...
Querying 'ea' works fine. However switch to "parts' database, then switch back to 'ea' database... it will freeze/crash with ArrayIndexOutOfBoundsException
Activitydominik-bergen-fnt commented on Nov 23, 2023 I encountered the same issue when using multiple databases. I figured out that the problem disappeared after setting database permissions individually for each database: In the config/server-users.jsonl file, change "databases":{"*":["admin"]} to "databases":{"parts":["admin"],"ea":["admin"]}.
Here is the stack trace of the error before changing the server-users.jsonl file:
java.lang.ArrayIndexOutOfBoundsException: Index 457 out of bounds for length 1
at com.arcadedb.server.security.ServerSecurityDatabaseUser.requestAccessOnFile(ServerSecurityDatabaseUser.java:83)
at com.arcadedb.database.EmbeddedDatabase.checkPermissionsOnFile(EmbeddedDatabase.java:590)
at com.arcadedb.engine.Bucket.count(Bucket.java:276)
at com.arcadedb.database.EmbeddedDatabase.lambda$countType$6(EmbeddedDatabase.java:452)
at com.arcadedb.database.EmbeddedDatabase.executeInReadLock(EmbeddedDatabase.java:1401)
at com.arcadedb.database.EmbeddedDatabase.countType(EmbeddedDatabase.java:447)
at com.arcadedb.query.sql.executor.FetchFromSchemaTypesStep.syncPull(FetchFromSchemaTypesStep.java:75)
at com.arcadedb.query.sql.executor.LimitExecutionStep.syncPull(LimitExecutionStep.java:48)
at com.arcadedb.query.sql.executor.SelectExecutionPlan.fetchNext(SelectExecutionPlan.java:44)
at com.arcadedb.query.sql.parser.LocalResultSet.fetchNext(LocalResultSet.java:44)
at com.arcadedb.query.sql.parser.LocalResultSet.(LocalResultSet.java:40)
at com.arcadedb.query.sql.parser.SelectStatement.execute(SelectStatement.java:207)
at com.arcadedb.query.sql.parser.Statement.execute(Statement.java:85)
at com.arcadedb.query.sql.parser.Statement.execute(Statement.java:69)
at com.arcadedb.query.sql.SQLQueryEngine.query(SQLQueryEngine.java:82)
at com.arcadedb.database.EmbeddedDatabase.query(EmbeddedDatabase.java:1364)
at com.arcadedb.server.ServerDatabase.query(ServerDatabase.java:489)
If I'm correct, this is the reason: When using the * wildcard for database access, only one ServerSecurityDatabaseUser instance is created, and the fileAccessMap is overwritten for each database which is present (see method updateFileAccess). But I'm not an ArcadeDB developer, so I'm not really sure if my assumptions are correct. lvca commented on Nov 23, 2023 @dominik-bergen-fnt I can't reproduce the issue wth the latest 23.11.1-SNAPSHOT. What version are you using? lvca commented on Nov 23, 2023 @decentropy I installed your 2 databases, then executed this cypher query MATCH (g:Goal) RETURN g on both switching everytime, but no issues. I'm using 23.11.1-SNAPSHOT where we should be have fixed this issue. decentropy commented on Nov 24, 2023 @lvca
hmm.. I am also trying with 23.11.1 (installed yesterday).
I re-downloaded the zip above to double-check, unzipped over my databases folder, and can replicate the error upon switching databases. I use Ubuntu and $ java -version = openjdk version "11.0.20.1" 2023-08-24
@dominik-bergen-fnt
Thank you for the workaround. Making that change resolved the error.
Perhaps I can find a way to script those permissions... as my app will create & switch DBs frequently.
(just one minor tweak... leave in the * entry in addition to DB entries, so you can access future DBs) Reacted by Dominik Bergen dominik-bergen-fnt commented on Nov 24, 2023 @lvca
I tested it with the official Docker image (23.9.1) and with the Java embedded server on Windows (23.9.1, 23.10.1 and 23.11.1-SNAPSHOT; OpenJDK 17). lvca commented on Nov 24, 2023 @dominik-bergen-fnt The latest version should have fixed the issue, but @decentropy still sees the issue. I'd love to be able to reproduce it so I can fix it. Maybe I'm gonna try a new test case where it continuously switches database and see what happens. topofocus commented on Dec 4, 2023 Perhaps that's related.
I repeatedly observed, (on Version 23.3.1) that the first insert operation after changing the database fails. I attached a screenshot of a recent test (In the ruby adapter, I included this behavior into the error-correction of the post-http-request, it works with a delay of one second). Subsequent inserts into the same database are successful.
 lvca commented on Dec 4, 2023 @topofocus are you able to reproduce the issue with the latest 23.11.1? topofocus commented on Dec 7, 2023 After my experience with 23.9 I will definitively not update my production environment and instead keep on responding to known issues. This walk around works for me (don't change a running system). I merely was very surprised about the cause of this bug and wanted to add additional insights (even if I am not sure, if its related). lvca commented on Dec 12, 2023 I was able to find this issue and reproduce it constantly when switching databases on the same server. Working to a fix. lvca commented on Dec 12, 2023 Ok, fixed! Thanks for the report (and the patient). Reacted by Dominik Bergen
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|