Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

py2neo - The client is unauthorized due to authentication failure

I have tried to connect to neo4j from python 3, but I always come across this error:

---------------------------------------------------------------------------
AuthError                                 Traceback (most recent call last)
<ipython-input-20-e407bdc814a1> in <module>
----> 1 graph.create(cloves)

~/.local/lib/python3.6/site-packages/py2neo/database.py in create(self, subgraph)
    353                        :class:`.Subgraph`
    354         """
--> 355         with self.begin() as tx:
    356             tx.create(subgraph)
    357

~/.local/lib/python3.6/site-packages/neobolt/direct.py in on_failure(self, metadata)
    755         message = metadata.get("message", "Connection initialisation failed")
    756         if code == "Neo.ClientError.Security.Unauthorized":
--> 757             raise AuthError(message)
    758         else:
    759             raise ServiceUnavailable(message)

AuthError: The client is unauthorized due to authentication failure.

My code is:

from py2neo import Graph
from py2neo import Node, Relationship

graph = Graph("bolt://localhost:7687", user="neo4j", password="neo4j")
cloves = Node('Person', name='Cloves', born='1989')

graph.create(cloves)

I checked the user I have registered on neo4j by default.

print screen from my neo4j browser

I've tried some approaches like create an architect role. Even so, when I declare the user, I get the same error.

like image 609
Cloves Paiva Avatar asked Feb 27 '19 16:02

Cloves Paiva


1 Answers

I solved the problem, it is necessary to reset the default user password neo4j as it is informed here.

like image 185
Cloves Paiva Avatar answered Oct 14 '22 07:10

Cloves Paiva