Skip to content
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

worker function not found #9

Open
peetasan opened this issue Jun 21, 2017 · 5 comments
Open

worker function not found #9

peetasan opened this issue Jun 21, 2017 · 5 comments

Comments

@peetasan
Copy link

I am running the worker based on the README and get the following error after POSTing a url

$ python worker.py
22:45:34 RQ worker 'rq:worker:P6s-MacBook-Pro-2.33821' started, version 0.5.6
22:45:34
22:45:34 *** Listening on default...
22:45:46 default: __main__.count_and_save_words('http://index.hu') (aed5e21f-5b70-44c0-96d8-57845638cda0)
22:45:46 AttributeError: module '__main__' has no attribute 'count_and_save_words'
Traceback (most recent call last):
  File "/Users/peetasan/dev/flask-by-example/virtualenv/lib/python3.6/site-packages/rq/worker.py", line 568, in perform_job
    rv = job.perform()
  File "/Users/peetasan/dev/flask-by-example/virtualenv/lib/python3.6/site-packages/rq/job.py", line 495, in perform
    self._result = self.func(*self.args, **self.kwargs)
  File "/Users/peetasan/dev/flask-by-example/virtualenv/lib/python3.6/site-packages/rq/job.py", line 206, in func
    return import_attribute(self.func_name)
  File "/Users/peetasan/dev/flask-by-example/virtualenv/lib/python3.6/site-packages/rq/utils.py", line 151, in import_attribute
    return getattr(module, attribute)
AttributeError: module '__main__' has no attribute 'count_and_save_words'
Traceback (most recent call last):
  File "/Users/peetasan/dev/flask-by-example/virtualenv/lib/python3.6/site-packages/rq/worker.py", line 568, in perform_job
    rv = job.perform()
  File "/Users/peetasan/dev/flask-by-example/virtualenv/lib/python3.6/site-packages/rq/job.py", line 495, in perform
    self._result = self.func(*self.args, **self.kwargs)
  File "/Users/peetasan/dev/flask-by-example/virtualenv/lib/python3.6/site-packages/rq/job.py", line 206, in func
    return import_attribute(self.func_name)
  File "/Users/peetasan/dev/flask-by-example/virtualenv/lib/python3.6/site-packages/rq/utils.py", line 151, in import_attribute
    return getattr(module, attribute)
AttributeError: module '__main__' has no attribute 'count_and_save_words'
22:45:46 Moving job to 'failed' queue
@mjhea0
Copy link
Contributor

mjhea0 commented Jun 22, 2017

Which part of the tutorial are you in?

@QUDUSKUNLE
Copy link

QUDUSKUNLE commented May 11, 2018

@mjhea0 I too experienced the same problem. Any hint?

@dazzag24
Copy link

dazzag24 commented Jun 5, 2018

Same problem here.

@caseybecking
Copy link

Yeah same issue here.

@caseybecking
Copy link

caseybecking commented Jun 21, 2018

Redis also looks to be storing the information, it just looks wrong.

 1) "timeout"
 2) "180"
 3) "result_ttl"
 4) "5000"
 5) "status"
 6) "failed"
 7) "data"
 8) "\x80\x04\x95G\x00\x00\x00\x00\x00\x00\x00(\x8c\x1d__main__.count_and_save_words\x94N\x8c\x1bhttp://www.blackmonocle.com\x94\x85\x94}\x94t\x94."
 9) "exc_info"
10) "Traceback (most recent call last):\n  File \"/home/administrator/VM/flask-by-example/env/lib/python3.5/site-packages/rq/worker.py\", line 568, in perform_job\n    rv = job.perform()\n  File \"/home/administrator/VM/flask-by-example/env/lib/python3.5/site-packages/rq/job.py\", line 495, in perform\n    self._result = self.func(*self.args, **self.kwargs)\n  File \"/home/administrator/VM/flask-by-example/env/lib/python3.5/site-packages/rq/job.py\", line 206, in func\n    return import_attribute(self.func_name)\n  File \"/home/administrator/VM/flask-by-example/env/lib/python3.5/site-packages/rq/utils.py\", line 151, in import_attribute\n    return getattr(module, attribute)\nAttributeError: module '__main__' has no attribute 'count_and_save_words'\n"
11) "enqueued_at"
12) "2018-06-21T14:05:23Z"
13) "description"
14) "__main__.count_and_save_words('http://www.google.com')"
15) "origin"
16) "default"
17) "ended_at"
18) "2018-06-21T14:05:24Z"
19) "ttl"
20) "-1"
21) "created_at"
22) "2018-06-21T14:05:23Z"```

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

No branches or pull requests

5 participants