Skip to content
This repository has been archived by the owner on Nov 16, 2021. It is now read-only.

Exception ignored in: <bound method Connection.del of <neo4j.bolt.connection.Connection object #10

Open
johanlundberg opened this issue May 10, 2017 · 15 comments

Comments

@johanlundberg
Copy link
Owner

@brajaram Was there no more output, like a traceback?

@brajaram
Copy link

Below is the traceback:

Exception ignored in: <bound method Driver.del of <neo4j.v1.direct.DirectDriver object at 0x1084784a8>>
Traceback (most recent call last):
File "/home/lib/python3.6/site-packages/neo4j/v1/api.py", line 139, in del
File "/home/lib/python3.6/site-packages/neo4j/v1/api.py", line 170, in close
File "/home/lib/python3.6/site-packages/neo4j/bolt/connection.py", line 427, in close
File "/home/lib/python3.6/site-packages/neo4j/bolt/connection.py", line 416, in remove
File "/home/lib/python3.6/site-packages/neo4j/bolt/connection.py", line 334, in close
File "/home/lib/python3.6/logging/init.py", line 1305, in info
File "/home/lib/python3.6/logging/init.py", line 1546, in isEnabledFor
TypeError: '>=' not supported between instances of 'int' and 'NoneType'
Exception ignored in: <bound method Connection.del of <neo4j.bolt.connection.Connection object at 0x109217588>>
Traceback (most recent call last):
File "/home/lib/python3.6/site-packages/neo4j/bolt/connection.py", line 181, in del
File "/home/lib/python3.6/site-packages/neo4j/bolt/connection.py", line 334, in close
File "/home/lib/python3.6/logging/init.py", line 1305, in info
File "/home/lib/python3.6/logging/init.py", line 1546, in isEnabledFor
TypeError: '>=' not supported between instances of 'int' and 'NoneType'

@johanlundberg
Copy link
Owner Author

Thank you for the traceback.

I think that looks very much like a bug in the neo4j-driver module. I will look in to it if I find the time.

@zupd
Copy link

zupd commented Jun 29, 2017

When using migrate command:
Exception TypeError: "'NoneType' object is not callable" in <bound method DirectDriver.__del__ of <neo4j.v1.direct.DirectDriver object at 0x7f3b249a6bd0>> ignored

@johanlundberg
Copy link
Owner Author

From what I have been able to find this is an exception thrown from the neo4j driver when the connection is already closed. The migration is successful anyway, right?

@zupd
Copy link

zupd commented Jun 29, 2017

Im not sure. When bootstrapping I get this error:

Traceback (most recent call last):
  File "neo4jtut/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/user/tutorials/neo4j-django-tutorial/tutorialenv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 363, in execute_from_command_line
    utility.execute()
  File "/home/user/tutorials/neo4j-django-tutorial/tutorialenv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 355, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/user/tutorials/neo4j-django-tutorial/tutorialenv/local/lib/python2.7/site-packages/django/core/management/base.py", line 283, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/user/tutorials/neo4j-django-tutorial/tutorialenv/local/lib/python2.7/site-packages/django/core/management/base.py", line 330, in execute
    output = self.handle(*args, **options)
  File "/home/user/tutorials/neo4j-django-tutorial/neo4jtut/neo4japp/management/commands/bootstrap.py", line 51, in handle
    raise e
  File "/usr/lib/python2.7/contextlib.py", line 24, in __exit__
    self.gen.next()
  File "/home/user/tutorials/neo4j-django-tutorial/neo4jtut/neo4jtut/contextmanager.py", line 54, in _transaction
    session.commit_transaction()
  File "/home/user/tutorials/neo4j-django-tutorial/tutorialenv/local/lib/python2.7/site-packages/neo4j/v1/api.py", line 446, in commit_transaction
    result.consume()
  File "/home/user/tutorials/neo4j-django-tutorial/tutorialenv/local/lib/python2.7/site-packages/neo4j/v1/api.py", line 740, in consume
    list(self)
  File "/home/user/tutorials/neo4j-django-tutorial/tutorialenv/local/lib/python2.7/site-packages/neo4j/v1/api.py", line 708, in records
    keys = self.keys()
  File "/home/user/tutorials/neo4j-django-tutorial/tutorialenv/local/lib/python2.7/site-packages/neo4j/v1/api.py", line 698, in keys
    self._session.fetch()
  File "/home/user/tutorials/neo4j-django-tutorial/tutorialenv/local/lib/python2.7/site-packages/neo4j/v1/api.py", line 356, in fetch
    detail_count, _ = self._connection.fetch()
  File "/home/user/tutorials/neo4j-django-tutorial/tutorialenv/local/lib/python2.7/site-packages/neo4j/bolt/connection.py", line 287, in fetch
    response.on_failure(summary_metadata or {})
  File "/home/user/tutorials/neo4j-django-tutorial/tutorialenv/local/lib/python2.7/site-packages/neo4j/v1/result.py", line 69, in on_failure
    raise CypherError.hydrate(**metadata)
neo4j.exceptions.DatabaseError: 0 (of class java.lang.Long)
Exception TypeError: "'NoneType' object is not callable" in <bound method DirectDriver.__del__ of <neo4j.v1.direct.DirectDriver object at 0x7fa166ac6bd0>> ignored

So its not working at least

@johanlundberg
Copy link
Owner Author

Ok, you need to change cypher.default_language_version to 3.1 in neo4j.conf, please see #11.

@johanlundberg
Copy link
Owner Author

I found a usage of the now deprecated START cypher statement. So now the above comment can be disregarded.

I still see the Exception TypeError: "'NoneType' object is not callable" in <bound method DirectDriver.del of <neo4j.v1.direct.DirectDriver object at 0x7f3b249a6bd0>> ignored error but the app works as expected,

@zupd
Copy link

zupd commented Jun 30, 2017

I am using Docker though, I can't change the neo4j.conf then, right?

@johanlundberg
Copy link
Owner Author

Well you can mount a config file from the outside, but that is beside the point now after my last update.
Just do a git pull and try the bootstrap again.

@zupd
Copy link

zupd commented Jun 30, 2017

I just ran another docker container with version 3.1 so working now

@zupd
Copy link

zupd commented Jun 30, 2017

However the website is really slow, and cant load the movies or persons page at all. loads forever. does it work for you?

@johanlundberg
Copy link
Owner Author

Yes, it works for me. I just ran through the tutorial with a new clone of the repo and the latest Neo4j docker image (3.2.1).

@zupd
Copy link

zupd commented Jun 30, 2017

cloned new repo and ran it just like you, but I still cant get into the movies or persons page on the website. The homepage and admin page works fine though

@johanlundberg
Copy link
Owner Author

Can you open a new issue to discuss this problem?

@jasonnet
Copy link

jasonnet commented Aug 7, 2017

Looking at the __del__ logging exception error messages generated by the bootstrap step. It's probably benign because it only happens at the end of the program during the final garbage collection. It's still disconcerting though. It looks like the exception and message could be avoided by adding the following line at the bottom of the bootstrap.py file:

   db.manager.driver.close()

with indention to indicate it's the last line of that final method.

There's a similar message when one ctrl-c's out of the runserver step. It looks like it would be much more difficult to eliminate that and less disconcerting. The best solution might be to ask the Neo4j team to evaluate if that exception passing through the Driver.__del__() method is always benign. If so they probably should modify __del__() to catch the exception and swallow it. Or modify the close() method to check for parameters that have already been GC'd so as to avoid generating the exception in the first place.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants