ArcadeData / arcadedb

ArcadeDB Multi-Model Database, one DBMS that supports SQL, Cypher, Gremlin, HTTP/JSON, MongoDB and Redis. ArcadeDB is a conceptual fork of OrientDB, the first Multi-Model DBMS. ArcadeDB supports Vector Embeddings.
https://arcadedb.com
Apache License 2.0
505 stars 63 forks source link

Cypher queries with a return cause an error in ArcadeDB Studio WebTool #235

Closed rams-services closed 2 years ago

rams-services commented 2 years ago

ArcadeDB Version: ArcadeDB Server v21.11.1-SNAPSHOT

JDK Version: OpenJDK Runtime Environment (build 11.0.13+8)

OS: Arch Linux

Expected behavior

Ability to get results from a cypher query run on the ArcadeDB Studio web tool:

Should result in the Node showing the user returned from the above example

Actual behavior

The query fails with an error message No value present with the actual java dump being <ArcadeDB_0> Error on command execution (PostCommandHandler) java.util.NoSuchElementException: No value present at java.base/java.util.Optional.get(Optional.java:148) at com.arcadedb.server.http.handler.PostCommandHandler.execute(PostCommandHandler.java:102) at com.arcadedb.server.http.handler.DatabaseAbstractHandler.execute(DatabaseAbstractHandler.java:82) at com.arcadedb.server.http.handler.AbstractHandler.handleRequest(AbstractHandler.java:112) at io.undertow.server.RoutingHandler.handleRequest(RoutingHandler.java:93) at io.undertow.server.handlers.PathHandler.handleRequest(PathHandler.java:104) at io.undertow.server.Connectors.executeRootHandler(Connectors.java:387) at io.undertow.server.protocol.http.HttpReadListener.handleEventWithNoRunningRequest(HttpReadListener.java:256) at io.undertow.server.protocol.http.HttpReadListener.handleEvent(HttpReadListener.java:136) at io.undertow.server.protocol.http.HttpOpenListener.handleEvent(HttpOpenListener.java:162) at io.undertow.server.protocol.http.HttpOpenListener.handleEvent(HttpOpenListener.java:100) at io.undertow.server.protocol.http.HttpOpenListener.handleEvent(HttpOpenListener.java:57) at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92) at org.xnio.ChannelListeners$10.handleEvent(ChannelListeners.java:291) at org.xnio.ChannelListeners$10.handleEvent(ChannelListeners.java:286) at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92) at org.xnio.nio.QueuedNioTcpServer2.acceptTask(QueuedNioTcpServer2.java:178) at org.xnio.nio.WorkerThread.safeRun(WorkerThread.java:612) at org.xnio.nio.WorkerThread.run(WorkerThread.java:479)

Steps to reproduce

Simply try to run the above command.

Please note the following that can be helpful in debugging:

  1. Running the SQL command *select from User** will actually provide the correct result
  2. Running the above command through the curl request as shown below would work curl -X POST "http://localhost:2480/api/v1/command/test" -d "{'language': 'cypher', 'command': 'CREATE (p:User {name:\'RAMS\'}) RETURN p'}" --user root:xxxxxxx
  3. However running the same command but with the extra parameter "serializer":"graph" actually causes the same issue as the one mentioned above with response {"exception":"java.util.NoSuchElementException","detail":"No value present","error":"Internal error"}
lvca commented 2 years ago

Reproduced.

lvca commented 2 years ago

Fixed by 8db80d37

lvca commented 2 years ago

Thanks for reporting the issue. It has been fixed on the main branch.

mackram commented 2 years ago

thank you so much for the quick response. keep up the great work