New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange exception when you exit Django task (migrate/runserver/test) #3818

Closed
alexandcote opened this Issue Feb 8, 2017 · 7 comments

Comments

Projects
None yet
5 participants
@alexandcote

alexandcote commented Feb 8, 2017

Checklist

  • I have included the output of celery -A proj report in the issue.
    (if you are not able to do this, then at least specify the Celery
    version affected).
  • I have verified that the issue exists against the master branch of Celery.

Spec

software -> celery:4.0.2 (latentcall) kombu:4.0.2 py:3.5.3
            billiard:3.5.0.2 memory:N/A
platform -> system:Darwin arch:64bit imp:CPython
loader   -> celery.loaders.app.AppLoader
settings -> transport:memory results:disabled

Steps to reproduce

You can pull this repo or do these step :

  • Install python 3.5.3.
  • Start a new Django project.
  • Install the last version of Django currently 1.10.5.
  • Install the last version of Celery currently 4.0.2.
  • Create the celery.py file like you propose in this first step.
  • Add the celery app into the __init__.py file of the foo app.
  • Run de migration and start the server.

Some time when you stop the server, you will got :

Exception ignored in: <function WeakValueDictionary.__init__.<locals>.remove at 0x107e7a6a8>
Traceback (most recent call last):
  File "/Users/xxxx/.pyenv/versions/3.5.3/lib/python3.5/weakref.py", line 117, in remove
TypeError: 'NoneType' object is not callable
Exception ignored in: <function WeakValueDictionary.__init__.<locals>.remove at 0x107e7a6a8>
Traceback (most recent call last):
  File "/Users/xxxx/.pyenv/versions/3.5.3/lib/python3.5/weakref.py", line 117, in remove
TypeError: 'NoneType' object is not callable

In my case, I got the exception approximately once every three start/stop.
This error appear also when I run test or migrate command.

Thanks for you help. Let me know if you want more information 😄

@slykar

This comment has been minimized.

slykar commented Mar 2, 2017

I suppose it's because of this:
https://bugs.python.org/issue29519

It seems fine with Python 3.6.0 for me or I had luck not to get a warning with 3.6.0.

@alexandcote

This comment has been minimized.

alexandcote commented Mar 8, 2017

@slykar You are right. Thanks a lot 👍

@alexandcote alexandcote closed this Mar 8, 2017

@peterlauri

This comment has been minimized.

peterlauri commented Apr 19, 2017

This problem still exists. After installing celery in my django project 1.10 the above warnings when stopping celery with ctrl-c. This also shows up from time to time when I run my tests (pytest)... I'm bound to 3.5.3 as that is the latest supported version for django 1.10...

This didn't happen prior to installing celery (4.0.2)...

@slykar

This comment has been minimized.

slykar commented Apr 20, 2017

@peterlauri I had no problems running Django 1.10 under Python 3.6. The related error is gone for me for 3.6 inside official Docker container.
From my experience it does not seem like this error causes any more trouble, except for the annoying error message.

Django 1.11 is now released and ...

requires Python 2.7, 3.4, 3.5, or 3.6

Maybe you could try updating Django and Python versions.

@peterlauri

This comment has been minimized.

peterlauri commented Apr 20, 2017

@slykar yes, I will update to Django 1.11 as soon as I feel that the 3rd party packages supports 1.11... I'll relax for now, and ignore that error message... However, it pops up not only in celery :)

@peterlauri

This comment has been minimized.

peterlauri commented Apr 20, 2017

Also the referenced bug looks to be included in 3.5.4 whenever that is released:

https://docs.python.org/3.5/whatsnew/changelog.html#python-3-5-4-release-candidate-1

@blodone

This comment has been minimized.

blodone commented Dec 6, 2017

i modified python3.5/weakref.py:
simple

if _remove_dead_weakref:
  _remove_dead_weakref(d, wr.key)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment