2010-06-01 43 views
3

我張貼這個問題(和答案),所以如果其他人在未來有這個問題,你就可以google一下。錯誤運行celeryd

如果你想在Django這樣運行celeryd:

python manage.py celeryd 

您可以接收它已開始後立即出現以下錯誤:

[email protected] has started. 
Traceback (most recent call last): 
    File "manage.py", line 11, in <module> 
    execute_manager(settings) 
    <... snip ...> 
    File "/usr/local/lib/python2.6/dist-packages/amqplib-0.6.1-py2.6.egg/amqplib/client_0_8/connection.py", line 134, in __init__ 
    self._x_start_ok(d, login_method, login_response, locale) 
    File "/usr/local/lib/python2.6/dist-packages/amqplib-0.6.1-py2.6.egg/amqplib/client_0_8/connection.py", line 704, in _x_start_ok 
    args.write_longstr(response) 
    File "/usr/local/lib/python2.6/dist-packages/amqplib-0.6.1-py2.6.egg/amqplib/client_0_8/serialization.py", line 352, in write_longstr 
    self.write_long(len(s)) 
TypeError: object of type 'NoneType' has no len() 

一個頗爲神祕的錯誤消息,沒有真正的線索去哪裏解決問題。見下面的答案,這樣你就不會浪費了大量的時間在這個錯誤就像我今天:)

回答

1

你缺少settings.py芹菜設置一樣。在我的情況下,它是由一個錯字造成的(我錯過了一個「S」在BROKER_PASSWORD)。仔細檢查你包括所有必要的設置,並且每一個拼寫正確的一切,你會避免因爲自己的屁股就像我今天:)