Reputation: 133
Hello trying simple example for graphware .throwing me below error.
Handshake Exception. Unable to negotiate a version to use. Proposed versions were [1,0,0,0]
sample code is given below. point to notable is the server is not ssl enabled to requests are http
<?php
require_once 'vendor/autoload.php';
use GraphAware\Neo4j\Client\ClientBuilder;
$client = ClientBuilder::create()
->addConnection('bolt', 'bolt://neo4j:[email protected]:7687')
->build();
$query = "MATCH (n) RETURN n LIMIT 1";
try {
$result = $client->run($query);
foreach ($result->getRecords() as $record) {
print_r($record);
exit();
}
} catch (\Exception $e) {
var_dump($e->getMessage());
}
Upvotes: 2
Views: 311
Reputation: 4580
GraphAware Neo4j driver can only be used with old version of Neo4j. During Handshake, the client first sends a magic four byte preamble (6060 B017) followed by four protocol versions it supports, in order of preference. The GraphAware Neo4j PHP driver sent the only one version it understands : 1.0.
The 4.0 and 4.1 servers are no more compliant with bolt protocol 1.0. So handshake failed because servers and client can find a compatible version. It's very difficult for PHP and Python developers to build a driver for Neo4j 4.0, Neo4j 4.1 because Neo4j team do not publish any documentation of new versions of bolt. This task seems to havea low priority. I'm surprised, because I don't understand how their teams can develop their driver in java, javascript without this documentation. (I'm currently developing a solution for Neo4j 4.0 and neo4j 4.1, but it take times without doc, because I have to analyze TCP Stream with wireshark)
So, at this time, you have two solutions: Try the Open Native Graph Database in version 3.6 or use Neo4j 3.
Upvotes: 0