Ask Your Question
1

Another Celery remote debug issue, not working in a periodic task

asked 2017-09-17 22:05:00 -0600

Eric Earnst gravatar image

updated 2019-03-13 10:14:17 -0600

I am trying to debug a tasks that was fired by celery beat and put in import wingdbstub in the task code.  The task fires and Celery responds but I get ModuleNotFoundError("No module named 'wingdbstub'",) when it hits import wingdbstub.  I have wingdbstub.py in every directory mentioned in the traceback at this point and in \celery and\celery\bin and it still isn't found.  It is working fine in the main celery code in site-packages when I look at other issues.  Any ideas where it might be looking?

[2017-09-16 20:21:36,213: INFO/MainProcess] Connected to sqla+sqlite:///tasks.sqlite
[2017-09-16 20:21:36,260: WARNING/MainProcess] celery@Eric-PC ready.
[2017-09-16 20:21:43,729: INFO/MainProcess] Received task: tasks.update_trader[7bc0b86f-561e-4638-807f-48149fde6efa]
[2017-09-16 20:21:43,744: INFO/MainProcess] **** update_trader
[2017-09-16 20:21:43,744: ERROR/MainProcess] Task tasks.update_trader[7bc0b86f-561e-4638-807f-48149fde6efa] raised unexpected: ModuleNotFoundError("No module named wingdbstub'",)Traceback (most recent call last): 
File "d:\svnrepo\projects-sw\eve_esi\trunk\env\lib\site-packages\celery\app\trace.py", line 240, in trace_task R = retval = fun(*args, **kwargs) 
File "D:\SVNRepo\projects-sw\EVE_ESI\trunk\env\src\app_web\extensions\celery_app.py", line 32, in __call__ return TaskBase.__call__(self, *args, **kwargs) 
File "d:\svnrepo\projects-sw\eve_esi\trunk\env\lib\site-packages\celery\app\trace.py", line 438, in __protected_call__ return self.run(*args, **kwargs) 
File "D:\SVNRepo\projects-sw\EVE_ESI\trunk\env\src\app_web\tasks\tasks.py", line 57, in update_trader import wingdbstubModuleNotFoundError: No module named 'wingdbstub'

This is on Win 7/64 with Python 3.6.2 and the latest Wing Pro.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2017-09-18 09:44:00 -0600

updated 2019-03-07 07:31:49 -0600

Wingware Admin gravatar image

I don't know the internals of celery but you can see all the directories it'll try to import from by printing sys.path (after 'import sys') on the line before the import of wingdbstub.  If '' or '.' is not on the sys.path then it won't look in the current directory.  If it is, it'll also look in the directory given by os.getcwd().

Probably best to sort this out and just have one copy of wingdbstub...

edit flag offensive delete link more

Comments

Should have remembered sys.path, since this is fired by celery.exe in the Scripts folder (in an Anaconda env) that was the first entry and the rest weren't particularly useful for this problem.  I added '.' and put wingdbstub.py in that location and life is good again.  And I cleaned up all the other wingdbstubs :)

Eric Earnst gravatar imageEric Earnst ( 2017-09-18 23:35:00 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2017-09-17 22:05:00 -0600

Seen: 6,679 times

Last updated: Mar 07