Aghilan B
Aghilan B

Reputation: 553

Not able to connect AuraDB via PHP GraphAware

I'm trying to connect Aura DB via PHP GraphAware. I was able to connect to the local Neo4j DB via both http, bolt.

But when I try to connect to my AuraDB. I was not able to connect.

<?php
require __DIR__ . '../../vendor/autoload.php';
use GraphAware\Neo4j\Client\ClientBuilder;
$config = \GraphAware\Bolt\Configuration::newInstance()
    ->withCredentials('myusername', 'mypassword')
    ->withTLSMode(\GraphAware\Bolt\Configuration::TLSMODE_REQUIRED);

$client = ClientBuilder::create()
    ->addConnection('aura', 'bolt+routing://my_database:7687', $config)
    ->build();

    $result = $client->run('MATCH (n:Person) RETURN n');

I'm getting an error

Fatal error: Uncaught exception 'GraphAware\Bolt\Exception\HandshakeException' with message 'Error receiving data' in E:\xampp\htdocs\lrl_dev\slim\vendor\graphaware\neo4j-bolt\src\Driver.php:165 Stack trace: #0 E:\xampp\htdocs\lrl_dev\slim\vendor\graphaware\neo4j-bolt\src\Driver.php(156): GraphAware\Bolt\Driver->throwHandshakeException('Error receiving...') #1 E:\xampp\htdocs\lrl_dev\slim\vendor\graphaware\neo4j-bolt\src\Driver.php(115): GraphAware\Bolt\Driver->handshake() #2 E:\xampp\htdocs\lrl_dev\slim\vendor\graphaware\neo4j-php-client\src\Connection\Connection.php(192): GraphAware\Bolt\Driver->session() #3 E:\xampp\htdocs\lrl_dev\slim\vendor\graphaware\neo4j-php-client\src\Connection\Connection.php(109): GraphAware\Neo4j\Client\Connection\Connection->checkSession() #4 E:\xampp\htdocs\lrl_dev\slim\vendor\graphaware\neo4j-php-client\src\Client.php(67): GraphAware\Neo4j\Client\Connection\Connection->run('CREATE (n:Perso...', NULL, NULL) #5 E:\xampp\htdocs\lrl_dev\slim\public\graph.php(25): GraphAware\Neo4j\Client\Client- in E:\xampp\htdocs\lrl_dev\slim\vendor\graphaware\neo4j-bolt\src\Driver.php on line 165 "

Am I doing anything wrong here?

Upvotes: 0

Views: 149

Answers (1)

Aghilan B
Aghilan B

Reputation: 553

Reply from graphaware

In Neo4j Aura, all connections to Aura must use either bolt+routing or neo4j as the connection protocol; connections using just bolt will fail. As far as I can tell from their Github repo, GraphAware does not support bolt+routing yet. There's a discussion thread about it from September, but I don't see any PRs related to it.

Upvotes: 0

Related Questions