neo4j-php / neo4j-php-client

Php client and driver for neo4j database
https://neo4j.com/developer/php/
MIT License
160 stars 40 forks source link

Unable to decipher error #57

Closed dataskills closed 3 years ago

dataskills commented 3 years ago

I am trying out this library with a neo4j aura instance. I can't get it working and I have not been able to understand the error I am getting, any insight would be much appreciated, this is what I am getting:

Exception 'Laudis\Neo4j\Exception\Neo4jException' with message 'Neo4j errors detected. First one with code "" and message "Read error"'

in /Users/dataskills/Sites/localhost/myApp/vendor/laudis/neo4j-php-client/src/Bolt/Session.php:125

Stack trace:
#0 /Users/dataskills/Sites/localhost/myApp/vendor/laudis/neo4j-php-client/src/Bolt/Session.php(78): Laudis\Neo4j\Bolt\Session->beginTransaction(NULL, NULL)
#1 /Users/dataskills/Sites/localhost/myApp/vendor/laudis/neo4j-php-client/src/Bolt/Session.php(73): Laudis\Neo4j\Bolt\Session->openTransaction()
#2 /Users/dataskills/Sites/localhost/myApp/vendor/laudis/neo4j-php-client/src/Bolt/Session.php(83): Laudis\Neo4j\Bolt\Session->runStatements(Array)
#3 /Users/dataskills/Sites/localhost/myApp/vendor/laudis/neo4j-php-client/src/Bolt/Session.php(88): Laudis\Neo4j\Bolt\Session->runStatement(Object(Laudis\Neo4j\Databags\Statement))
#4 /Users/dataskills/Sites/localhost/myApp/vendor/laudis/neo4j-php-client/src/Client.php(74): Laudis\Neo4j\Bolt\Session->run('CREATE (n:Perso...', Array)
#5 /Users/dataskills/Sites/localhost/myApp/commands/Neo4jController.php(83): Laudis\Neo4j\Client->run('CREATE (n:Perso...')
...

I am just trying to run a simple CREATE statement to test things out and I am getting the exception with no code and a "Read Error". The error does not contain any useful description. The node was not created (I checked using the browser), so I don't even know what it's tryig to read.

dataskills commented 3 years ago

After further review, I can see that the function unpackProtocolVersion() is failing at line 161 when it is trying to read the protocol version from the connection during the handshake process (I think). I don't know enough about the bolt protocol to know for sure. Has anyone tried to connect with Neo4j Aura before?

transistive commented 3 years ago

Hello @dataskills,

Thank you for posting this issue. It looks like a more complex issue. I will first have to acquire access to an aura instance. Forgive me, but this issue might take me a few days to fix.

In the meantime, can you check if the HTTP protocol works at least?

Kind regards,

Ghlen

fbiville commented 3 years ago

@dataskills Are you using Aura Free, Aura Professional or Aura Enterprise? @transistive HTTP is not available with Aura at the moment.

fbiville commented 3 years ago

Also, what connection URI (scheme) are you using, @dataskills?

dataskills commented 3 years ago

I am using Aura Free to test the service. Forgive me if I am mistaken but it looks like the only scheme I can use is the neo4j scheme, correct? See connection URI in the image:

Screen Shot 2021-07-01 at 8 26 37 AM

Is this type of connection not supported? My goal is to find a hosting service, if neo4j aura is not viable can you suggest an alternative? I appreciate your responses @fbiville and @transistive .

fbiville commented 3 years ago

It's not completely supported as of now, but I know @transistive is actively working on it. I'll let him give a more definitive answer.

dataskills commented 3 years ago

Ok, thank you. I hope @transistive can shed some more light on this when he has time. In the meantime can you suggest an alternative to neo4j aura for hosting?

transistive commented 3 years ago

Hi @dataskills. We have been working the entire day to find the issue and am happy to report we have found the culprit! It was due to some complex SSL configuration which only aura needed to function correctly.

You can expect the bugfix within a few hours. :+1:

Thanks again for bringing this to our attention.

dataskills commented 3 years ago

Very cool, I appreciate it. I look forward to the fix. Cheers.

transistive commented 3 years ago

The bug is fixed! Feel free to update to version 2.0.4 to enjoy neo4j aura and php

dataskills commented 3 years ago

The fix works! Thank you @transistive, great work!