neo4j-examples / movies-python-bolt

Neo4j Movies Example application with Flask backend using the neo4j-python-driver
401 stars 186 forks source link

Database access is not allowed for user 'movies' with roles [PUBLIC, movies] #37

Closed ghost closed 3 years ago

ghost commented 3 years ago

This web application doesn't work either using the database on demo.neo4jlabs.com or the local database. When using the database on demo.neo4jlabs.com, following exception is raised:

Traceback (most recent call last):                                                                                                                                                                                                                                               File "C:\Program Files\Python37\lib\site-packages\flask\app.py", line 2070, in wsgi_app
response = self.full_dispatch_request()                                                                                                                                                                                                                                      File "C:\Program Files\Python37\lib\site-packages\flask\app.py", line 1515, in full_dispatch_request
rv = self.handle_user_exception(e)
File "C:\Program Files\Python37\lib\site-packages\flask\app.py", line 1513, in full_dispatch_request
rv = self.dispatch_request()                                                                                                                                                                                                                                                 File "C:\Program Files\Python37\lib\site-packages\flask\app.py", line 1499, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "movies.py", line 65, in get_graph
results = db.read_transaction(lambda tx: list(tx.run("MATCH (m:Movie)<-[:ACTED_IN]-(a:Person) "
File "C:\Program Files\Python37\lib\site-packages\neo4j\work\simple.py", line 409, in read_transaction
return self._run_transaction(READ_ACCESS, transaction_function, *args, **kwargs)
File "C:\Program Files\Python37\lib\site-packages\neo4j\work\simple.py", line 338, in _run_transaction 
result = transaction_function(tx, *args, **kwargs)
File "movies.py", line 69, in <lambda>
100)}))) 
File "C:\Program Files\Python37\lib\site-packages\neo4j\work\transaction.py", line 130, in run
result._tx_ready_run(query, parameters, **kwparameters)
File "C:\Program Files\Python37\lib\site-packages\neo4j\work\result.py", line 100, in _tx_ready_run
self._run(query, parameters, None, None, None, **kwparameters)
File "C:\Program Files\Python37\lib\site-packages\neo4j\work\result.py", line 144, in _run
self._attach()
File "C:\Program Files\Python37\lib\site-packages\neo4j\work\result.py", line 245, in _attach
self._connection.fetch_message()
File "C:\Program Files\Python37\lib\site-packages\neo4j\work\result.py", line 62, in inner
func(*args, **kwargs)
File "C:\Program Files\Python37\lib\site-packages\neo4j\io\_bolt4.py", line 271, in fetch_message
response.on_failure(summary_metadata or {})
File "C:\Program Files\Python37\lib\site-packages\neo4j\io\_common.py", line 183, in on_failure
raise Neo4jError.hydrate(**metadata)
neo4j.exceptions.Forbidden: {code: Neo.ClientError.Security.Forbidden} {message: Database access is not allowed for user
'movies' with roles [PUBLIC, movies].}

When using the local database, when doing a search, there is no content displayed on the website.

ghost commented 3 years ago

I solved the problem. The reason for all of that is just that I did not set neo4jVersion.

Just use

neo4jVersion = os.getenv("NEO4J_VERSION", "4")
fbiville commented 3 years ago

Neo4j version 4 should be assumed, let me fix that.

fbiville commented 3 years ago

Now fixed, sorry for the inconvenience @waynon and thanks for the report!