LoginSignup
0
0

More than 5 years have passed since last update.

CeleryでAmazonSQSを使うとエラーメッセージなしに即終了してしまう

Last updated at Posted at 2017-10-12

課題

CeleryのBrokerにAmazonSQSを選択したのですが、起動しても即終了してしまいます。
ログレベルをDEBUGにしても何も出ません。AmazonSQSの権限周りも特に問題ありません。辛い。
redisを使えば動くんですが、自分で管理したくないので絶対AmazonSQSを使いたいのです。

解決策

https://github.com/celery/celery
レポジトリを見るとrequirements以下にいろいろあるではないですか。
brokerによって追加で必要なライブラリがあるのでインストールしましょう。

AmazonSQSの場合、 celery/requirements/extras/sqs.txtに書いてますね。
boto3とpycurlが必要っぽいですね。
pycurlを入れてなかったのでインストールしたら動きました!!

pycurlのインストールはちょっと面倒なのでこちらの記事を
https://qiita.com/kirishimaru/items/722776766da890fd853f

あとから見つけたんですがissueにあがってましたね
https://github.com/celery/celery/issues/3630
pycurlの依存関係外してくれ〜っていうissueが立ってますw

どうやって調べたか

celery.worker.consumer.tasksの49行目付近でCanceling task consumerというログを出力してるところに移動してエラーっぽいメッセージを探しました。task_consumerのオブジェクト内にはちゃんとエラーメッセージが残ってるっぽいです。できればコンソールにもエラーメッセージを流してほしいですね!
OSS活動は時間がないのでやめておきます←

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0