about pyramid_celery+rabbitmq: [: ERROR/MainProcess] Received unregistered task of type 'long_running_with_tm.tasks.add_task'.

515 views
Skip to first unread message

Guohuang Chen

unread,
Sep 27, 2017, 6:22:47 AM9/27/17
to pylons-discuss
i download the pyramid_celery from github.com,
and copy example long_running_with_tm    to my vitualenv path,and
install it: pip install -e . and then
just change celery broker_url in the development.ini ,i use windows and have no redis.

[celery]
BROKER_URL = amqp://guest:guest@localhost:5672//

when i visit the page http://127.0.0.0.1:6543 ,and input some letters in the textfield, 
and click add then the dos cmd window display the errors like this:

D:\pyramid64_py36\long_running_with_tm>celery worker -A pyramid_celery.celery_app --ini development.ini

 -------------- celery@USER-VII7S3CG60 v4.1.0 (latentcall)
---- **** -----
--- * ***  * -- Windows-7-6.1.7601-SP1 2017-09-27 16:31:11
-- * - **** ---
- ** ---------- [config]
- ** ---------- .> app:         __main__:0x39d7c88
- ** ---------- .> transport:   amqp://guest:**@localhost:5672//
- ** ---------- .> results:     disabled://
- *** --- * --- .> concurrency: 4 (prefork)
-- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker)
--- ***** -----
 -------------- [queues]
                .> celery           exchange=celery(direct) key=celery


[2017-09-27 16:36:17,930: ERROR/MainProcess] Received unregistered task of type 'long_running_with_tm.tasks.add_task'.
The message has been ignored and discarded.

Did you remember to import the module containing this task?
Or maybe you're using relative imports?

Please see
for more information.

The full contents of the message body was:
'[["fdfd"], {}, {"callbacks": null, "errbacks": null, "chain": null, "chord": nu
ll}]' (83b)
Traceback (most recent call last):
  File "c:\python36\lib\site-packages\celery\worker\consumer\consumer.py", line561, in on_task_received
    strategy = strategies[type_]
KeyError: 'long_running_with_tm.tasks.add_task'

tonthon

unread,
Sep 28, 2017, 11:29:14 AM9/28/17
to pylons-...@googlegroups.com
Hi,
in your ini file, have your set the sqlalchemy.url to point to a valid database connection ?

(pyramid_celery silently fails if that one is missing)                      
--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discus...@googlegroups.com.
To post to this group, send email to pylons-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/e1455cc7-fec5-4a4a-a308-f6eac2393f2c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Guohuang Chen

unread,
Sep 28, 2017, 10:17:27 PM9/28/17
to pylons-discuss
this is the example's development.ini,i have change the password to ****** in the sqlalchemy.url when paste on the group
[app:main]
use = egg:long_running_with_tm

pyramid.reload_templates = true
pyramid.debug_authorization = false
pyramid.debug_notfound = false
pyramid.debug_routematch = false
pyramid.debug_templates = true
pyramid.default_locale_name = en
pyramid.includes = pyramid_debugtoolbar
                   pyramid_tm
                   pyramid_mako
                   pyramid_celery

sqlalchemy.url = postgresql://postgres:******@localhost/session

[celery]
broker_url = amqp://rainbird:password@localhost:5672//
CELERY_DEFAULT_EXCHANGE = gds_zf
CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'
CELERY_ACCEPT_CONTENT = ['json', 'application/json']
CELERY_RESULT_BACKEND = amqp://dev:d...@192.168.1.50:5672//test
CELERY_IMPORTS = celerypythontest.celery_service

[server:main]
use = egg:pyramid#wsgiref
host = 0.0.0.0
port = 6543

# Begin logging configuration

[loggers]
keys = root, long_running_with_tm, sqlalchemy

[handlers]
keys = console

[formatters]
keys = generic

[logger_root]
level = INFO
handlers = console

[logger_long_running_with_tm]
level = DEBUG
handlers =
qualname = long_running_with_tm

[logger_sqlalchemy]
level = INFO
handlers =
qualname = sqlalchemy.engine
# "level = INFO" logs SQL queries.
# "level = DEBUG" logs SQL queries and results.
# "level = WARN" logs neither.  (Recommended for production systems.)

[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic

[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s

# End logging configuration


在 2017年9月28日星期四 UTC+8下午11:29:14,tonthon写道:

tonthon

unread,
Oct 4, 2017, 3:09:50 PM10/4/17
to pylons-...@googlegroups.com
Is sqlalchemy.url pointing to a valid database connection ?
Reply all
Reply to author
Forward
0 new messages