Vinelab / NeoEloquent

The Neo4j OGM for Laravel
MIT License
633 stars 197 forks source link

Unable to retrieve server info [404] #341

Closed jenya87 closed 2 years ago

jenya87 commented 3 years ago

Hello! I use Laravel 5.6.30 with php 7.4.13, 1.4.6 version of package, Neo4j Community 4.04. hosted on Centos 7 server.

I try do get some data from Neo server and have an error:

Unable to retrieve server info [404]: Headers: Array ( [Date] => Sat, 19 Dec 2020 12:08:56 GMT [Access-Control-Allow-Origin] => * [Cache-Control] => must-revalidate,no-cache,no-store [Content-Length] => 0 ) Body: Array ( )

my model is

use Vinelab\NeoEloquent\Eloquent\Model as NeoEloquent;
class Test extends NeoEloquent
{
    protected $connection = 'neo4j';
    protected $label = 'Movie';
}

database.php config file:

 'default' => 'neo4j',
 'connections' => [
     .....................
    'neo4j' => [
                    'driver' => 'neo4j',
                    'host'   => env('DB_HOST'),
                    'port'   => env('DB_PORT'),
                    'username' => env('DB_USERNAME'),
                    'password' => env('DB_PASSWORD'),
            ],

I try to get data as usual with eloquent in my contoller

use Vinelab\NeoEloquent\Eloquent\Model;
......
dd(Test::all());

Credentials are correct, because if I change password config value to wrong, I get 401 error

Unable to retrieve server info [401]: Headers: Array ( [Date] => Sat, 19 Dec 2020 12:20:38 GMT [Access-Control-Allow-Origin] => * [Content-Type] => application/json;charset=utf-8 [WWW-Authenticate] => Basic realm="Neo4j" [Content-Length] => 128 ) Body: Array ( [errors] => Array ( [0] => Array ( [code] => Neo.ClientError.Security.Unauthorized [message] => Invalid username or password. ) ) )
Mulkave commented 3 years ago

@jenya87 it seems that NE isn't able to connect to Neo4j. Can you please confirm that the connection configuration values are correct?

jenya87 commented 3 years ago

@Mulkave , I 'm sure credentials are correct, because I use them in neo4j browser utility and in another laravel app, but if I change username, or password, only in this case I have invalid credentials error:

Unable to retrieve server info [401]: Headers: Array ( [Date] => Sat, 19 Dec 2020 12:20:38 GMT [Access-Control-Allow-Origin] => * [Content-Type] => application/json;charset=utf-8 [WWW-Authenticate] => Basic realm="Neo4j" [Content-Length] => 128 ) Body: Array ( [errors] => Array ( [0] => Array ( [code] => **Neo.ClientError.Security.Unauthorized** [message] => **Invalid username or password**. ) ) )
kiranupadhyak commented 3 years ago

I'm also getting the same error. Any updates?

jenya87 commented 3 years ago

Unfortunatelly, no

cedvict commented 3 years ago

I'm also getting the same error. Any updates?

wkasem commented 3 years ago

make sure when you re creating new neo4j database to select version < 4 in new versions of neo4j they changed the way to get server info still an issue though with NeoEloquent package , it should be compatible with new versions of neo4j

MWL91 commented 2 years ago

I have the same issue - this package works with API from neo4j <4, so it may be consider as legacy i supposed, until new version working with some other lib will be not available.

You can read more about it here: https://neo4j.com/docs/rest-docs/current/

The API described in this manual been deprecated and will be removed in Neo4j 4.0. Cypher and procedures should be used instead, either via the HTTP API, or via Bolt using the official drivers.

Mulkave commented 2 years ago

With the most recent versions (1.5 for Laravel 5 and 1.8 for Laravel 8), we've worked on integrating the official Neo4j-php driver that is now available and will support a wide range of Neo4j versions along with its protocols. Please update your installations that may get you rid of these issues.