'graph' already exists error when starting Gremlin and creating database at same time for first time
Summary Unable to start ArcadeDB with gremlin plugin and default database arguments
Environment ArcadeDB Version: 25.9.1 Windows and Linux
Expected Behavior Default database is created and gremlin plugin works
Actual Behavior Internal error, does not stop server but it does not function correctly
Reproduce
I take fresh ArcadeDB and run this command:
server.bat "-Darcadedb.server.rootPassword=password" "-Darcadedb.server.plugins=GremlinServer:com.arcadedb.server.gremlin.GremlinServerPlugin" "-Darcadedb.server.defaultDatabases=graph[root]"
It fails with error below as one command already creates database and it attempts that again. We're calling also import with default database, but it is not required to reproduce error. Workaround is to not call gremlin plugin, then stop and start with gremlin but that is extra complication.
`C:\Workspace\Tools\DB\arcadedb-25.9.1\bin>server.bat "-Darcadedb.server.rootPassword=password" "-Darcadedb.server.plugins=GremlinServer:com.arcadedb.server.gremlin.GremlinServerPlugin" "-Darcadedb.server.defaultDatabases=graph[root]" █████╗ ██████╗ ██████╗ █████╗ ██████╗ ███████╗██████╗ ██████╗ ██╔══██╗██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔════╝██╔══██╗██╔══██╗ ███████║██████╔╝██║ ███████║██║ ██║█████╗ ██║ ██║██████╔╝ ██╔══██║██╔══██╗██║ ██╔══██║██║ ██║██╔══╝ ██║ ██║██╔══██╗ ██║ ██║██║ ██║╚██████╗██║ ██║██████╔╝███████╗██████╔╝██████╔╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═════╝ ╚══════╝╚═════╝ ╚═════╝ PLAY WITH DATA https://arcadedb.com
ARCADEDB server script path = C:\Workspace\Tools\DB\arcadedb-25.9.1\bin\server.bat ARCADEDB home directory = C:\Workspace\Tools\DB\arcadedb-25.9.1
2025-11-04 14:51:46.693 INFO [ArcadeDBServer] <ArcadeDB_0> ArcadeDB Server v25.9.1 (build db314cb894441cff5e01d8b09659d3bd135c0136/1760029605772/UNKNOWN) is starting up... 2025-11-04 14:51:46.697 INFO [ArcadeDBServer] <ArcadeDB_0> Running on Windows 11 10.0 - OpenJDK 64-Bit Server VM 21.0.7 (Temurin-21.0.7+6) 2025-11-04 14:51:46.701 INFO [ArcadeDBServer] <ArcadeDB_0> Starting ArcadeDB Server in development mode with plugins [GremlinServer] ... 2025-11-04 14:51:46.760 INFO [ArcadeDBServer] <ArcadeDB_0> - Metrics Collection Started... 2025-11-04 14:51:46.802 INFO [ArcadeDBServer] <ArcadeDB_0> Server root path: . 2025-11-04 14:51:46.804 INFO [ArcadeDBServer] <ArcadeDB_0> Databases directory: ./databases 2025-11-04 14:51:46.805 INFO [ArcadeDBServer] <ArcadeDB_0> Backups directory: ./backups 2025-11-04 14:51:46.821 INFO [ServerSecurity] <ArcadeDB_0> Creating root user with the provided password 2025-11-04 14:51:47.741 INFO [DefaultGraphManager] Graph [graph] was successfully configured via [./config/gremlin-server.properties]. 2025-11-04 14:51:47.741 INFO [ServerGremlinExecutor] Initialized Gremlin thread pool. Threads in pool named with pattern gremlin-* 2025-11-04 14:51:47.751 INFO [ServerGremlinExecutor] Initialized GremlinExecutor and preparing GremlinScriptEngines instances. 2025-11-04 14:51:48.889 INFO [ServerGremlinExecutor] Initialized gremlin-groovy GremlinScriptEngine and registered metrics 2025-11-04 14:51:48.892 INFO [ServerGremlinExecutor] A GraphTraversalSource is now bound to [g] with graphtraversalsource[arcadegraph[./databases/graph], standard] 2025-11-04 14:51:48.893 INFO [ServerGremlinExecutor] A GraphTraversalSource is now bound to [graph] with graphtraversalsource[arcadegraph[./databases/graph], standard] 2025-11-04 14:51:48.900 INFO [OpLoader] Adding the standard OpProcessor. 2025-11-04 14:51:49.034 INFO [OpLoader] Adding the session OpProcessor. 2025-11-04 14:51:49.037 INFO [OpLoader] Adding the traversal OpProcessor. 2025-11-04 14:51:49.064 INFO [GremlinServer] Executing start up LifeCycleHook 2025-11-04 14:51:49.078 INFO [GremlinServer] Executed once at startup of Gremlin Server. 2025-11-04 14:51:49.093 INFO [GremlinServer] idleConnectionTimeout was set to 0 which resolves to 0 seconds when configuring this value - this feature will be disabled 2025-11-04 14:51:49.093 INFO [GremlinServer] keepAliveInterval was set to 0 which resolves to 0 seconds when configuring this value - this feature will be disabled 2025-11-04 14:51:49.125 INFO [AbstractChannelizer] Configured application/vnd.graphbinary-v1.0 with org.apache.tinkerpop.gremlin.util.ser.GraphBinaryMessageSerializerV1 2025-11-04 14:51:49.143 INFO [AbstractChannelizer] Configured application/vnd.gremlin-v3.0+json with org.apache.tinkerpop.gremlin.util.ser.GraphSONMessageSerializerV3 2025-11-04 14:51:49.145 INFO [AbstractChannelizer] Configured application/json with org.apache.tinkerpop.gremlin.util.ser.GraphSONMessageSerializerV3 2025-11-04 14:51:49.148 INFO [AbstractChannelizer] Configured application/vnd.gremlin-v2.0+json with org.apache.tinkerpop.gremlin.util.ser.GraphSONMessageSerializerV2 2025-11-04 14:51:49.149 INFO [AbstractChannelizer] application/json already has org.apache.tinkerpop.gremlin.util.ser.GraphSONMessageSerializerV3 configured - it will not be replaced by org.apache.tinkerpop.gremlin.util.ser.GraphSONMessageSerializerV2, change order of serialization configuration if this is not desired. 2025-11-04 14:51:49.206 INFO [ArcadeDBServer] <ArcadeDB_0> - GremlinServer plugin started 2025-11-04 14:51:49.207 INFO [HttpServer] <ArcadeDB_0> - Starting HTTP Server (host=0.0.0.0 port=[I@6da4feeb httpsPort=[2490, 2499])... 2025-11-04 14:51:49.211 INFO [GremlinServer] Gremlin Server configured with worker thread pool of 1, gremlin pool of 16 and boss thread pool of 1. 2025-11-04 14:51:49.212 INFO [GremlinServer] Channel started at port 8182. 2025-11-04 14:51:49.255 INFO [undertow] starting server: Undertow - 2.3.19.Final 2025-11-04 14:51:49.261 INFO [xnio] XNIO version 3.8.16.Final 2025-11-04 14:51:49.266 INFO [nio] XNIO NIO Implementation Version 3.8.16.Final 2025-11-04 14:51:49.343 INFO [HttpServer] <ArcadeDB_0> - HTTP Server started (host=0.0.0.0 port=2480 httpsPort=2490) 2025-11-04 14:51:49.343 INFO [ArcadeDBServer] <ArcadeDB_0> Creating default database 'graph'...Exception in thread "main" java.lang.IllegalArgumentException: Database 'graph' already exists at com.arcadedb.server.ArcadeDBServer.createDatabase(ArcadeDBServer.java:402) at com.arcadedb.server.ArcadeDBServer.loadDefaultDatabases(ArcadeDBServer.java:626) at com.arcadedb.server.ArcadeDBServer.start(ArcadeDBServer.java:189) at com.arcadedb.server.ArcadeDBServer.main(ArcadeDBServer.java:121)`
I can reproduce this with:
$ bin/server.sh "-Darcadedb.server.rootPassword=arcadedb" "-Darcadedb.server.defaultDatabases=graph[]" "-Darcadedb.server.plugins=GremlinServer:com.arcadedb.server.gremlin.GremlinServerPlugin"
under MacOS.
A quick workaround is to rename the default database in config/gremlin-server.groovy, see also https://github.com/ArcadeData/arcadedb/blob/main/package/src/main/config/gremlin-server.groovy . However, I guess the expected behavior would be that Gremlin reuses an existing database if named graph?
Yes, I use import from file with default database when starting container and I require gremlin access for that database.