First time here? Check out the FAQ!
1

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

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.

Eric Earnst's avatar
36
Eric Earnst
asked 2017-09-17 22:05:00 -0600
Wingware Support's avatar
4k
Wingware Support
updated 2019-03-13 10:14:17 -0600
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

1

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...

Wingware Support's avatar
4k
Wingware Support
answered 2017-09-18 09:44:00 -0600
Wingware Admin's avatar
231
Wingware Admin
updated 2019-03-07 07:31:49 -0600
edit flag offensive 0 remove flag delete link

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's avatar Eric Earnst (2017-09-18 23:35:00 -0600) edit
add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer