Closed
Labels
questionFurther information is requestedFurther information is requested
Milestone
Description
Hello it's me again
ArcadeDB Version:
ArcadeDB Server v24.5.1-SNAPSHOT (build 71472c4c05ae9278d0d5d71a919b31883e1ea767/1713899543605/main) is starting up... creating nodes and reading nodes
OS and JDK Version:
Running on Linux 5.15.0-100-generic - OpenJDK 64-Bit Server VM 11.0.22 for creating nodes and reading nodes
Expected behavior
Query should execute and not fail.
Actual behavior
Error :
{"error":"Cannot execute command","detail":"Query \u0027create vertex type CHUNK\u0027 is not idempotent","exception":"java.lang.IllegalArgumentException"}
mai 10 09:31:51 cfia-IDEXTEND server.sh[1388]: java.lang.IllegalArgumentException: Query 'create vertex type CHUNK' is not idempotent
mai 10 09:31:51 cfia-IDEXTEND server.sh[1388]: at com.arcadedb.query.sql.SQLQueryEngine.query(SQLQueryEngine.java:92)
mai 10 09:31:51 cfia-IDEXTEND server.sh[1388]: at com.arcadedb.database.LocalDatabase.query(LocalDatabase.java:1371)
mai 10 09:31:51 cfia-IDEXTEND server.sh[1388]: at com.arcadedb.server.ServerDatabase.query(ServerDatabase.java:489)
mai 10 09:31:51 cfia-IDEXTEND server.sh[1388]: at com.arcadedb.server.http.handler.GetQueryHandler.execute(GetQueryHandler.java:61)
mai 10 09:31:51 cfia-IDEXTEND server.sh[1388]: at com.arcadedb.server.http.handler.DatabaseAbstractHandler.execute(DatabaseAbstractHandler.java:100)
mai 10 09:31:51 cfia-IDEXTEND server.sh[1388]: at com.arcadedb.server.http.handler.AbstractServerHttpHandler.handleRequest(AbstractServerHttpHandler.java:127)
mai 10 09:31:51 cfia-IDEXTEND server.sh[1388]: at io.undertow.server.RoutingHandler.handleRequest(RoutingHandler.java:93)
mai 10 09:31:51 cfia-IDEXTEND server.sh[1388]: at io.undertow.server.handlers.PathHandler.handleRequest(PathHandler.java:104)
mai 10 09:31:51 cfia-IDEXTEND server.sh[1388]: at io.undertow.server.Connectors.executeRootHandler(Connectors.java:393)
mai 10 09:31:51 cfia-IDEXTEND server.sh[1388]: at io.undertow.server.protocol.http.HttpReadListener.handleEventWithNoRunningRequest(HttpReadListener.java:265)
mai 10 09:31:51 cfia-IDEXTEND server.sh[1388]: at io.undertow.server.protocol.http.HttpReadListener.handleEvent(HttpReadListener.java:136)
mai 10 09:31:51 cfia-IDEXTEND server.sh[1388]: at io.undertow.server.protocol.http.HttpOpenListener.handleEvent(HttpOpenListener.java:162)
mai 10 09:31:51 cfia-IDEXTEND server.sh[1388]: at io.undertow.server.protocol.http.HttpOpenListener.handleEvent(HttpOpenListener.java:100)
mai 10 09:31:51 cfia-IDEXTEND server.sh[1388]: at io.undertow.server.protocol.http.HttpOpenListener.handleEvent(HttpOpenListener.java:57)
mai 10 09:31:51 cfia-IDEXTEND server.sh[1388]: at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
mai 10 09:31:51 cfia-IDEXTEND server.sh[1388]: at org.xnio.ChannelListeners$10.handleEvent(ChannelListeners.java:291)
mai 10 09:31:51 cfia-IDEXTEND server.sh[1388]: at org.xnio.ChannelListeners$10.handleEvent(ChannelListeners.java:286)
mai 10 09:31:51 cfia-IDEXTEND server.sh[1388]: at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
mai 10 09:31:51 cfia-IDEXTEND server.sh[1388]: at org.xnio.nio.QueuedNioTcpServer2.acceptTask(QueuedNioTcpServer2.java:178)
mai 10 09:31:51 cfia-IDEXTEND server.sh[1388]: at org.xnio.nio.WorkerThread.safeRun(WorkerThread.java:612)
mai 10 09:31:51 cfia-IDEXTEND server.sh[1388]: at org.xnio.nio.WorkerThread.run(WorkerThread.java:479)
Steps to reproduce
curl -X GET http://localhost:2480/api/v1/query/test/sql/create%20vertex%20type%20CHUNK --user root:rootroot
Do it using Studio and it works
firefox_zbU8AUz3s5.mp4
Yes I also tried the if not exist, it doesn't help, that was my original query.
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested
Activity
gramian commentedon May 10, 2024
Hi,
this is by design. To send a command (anything that changes the databases, ie adding a vertex type), you need to use the
commandendpoint (see https://docs.arcadedb.com/#HTTP-API ). Thequeryendpoint can only be used to read from a database, neither create, update, nor delete are allowed. The studio always uses thecommandendpoint.ExtReMLapin commentedon May 10, 2024
Alright thanks !
ExtReMLapin commentedon May 10, 2024
Just to be sure @gramian you meant Change the database schema, right ? Because we've been using this same endpoint (
/query) to do everything in cypher, create nodes, relations etc, so technically READ, CREATE and UPDATEReading the documentation :
This command allows executing idempotent commands, like SELECT and MATCH:It sounds like yes, I should be in "READ ONLY" using this endpoint, however we can create nodes and edges using Cypher, sounds like something that was missed in the documentation ? Or do you not have the required functions in OpenCypher to detect idempotency ?
gramian commentedon May 10, 2024
Hmm, that would indeed be a bug. For SQL and SQLscript the
queryendpoint allows only READ operations. I am not using Cypher or Gremlin so I am referring this to @lvca .ExtReMLapin commentedon Jan 14, 2026
Fixed by #3112
chore(deps): bump the github-actions group with 5 updates [skip ci]