RuntimeWarning:您是 运行 具有超级用户权限的工作人员:绝对不推荐这样做

RuntimeWarning: You're running the worker with superuser privileges: this is absolutely not recommended

当我守护 celery worker 时,它给我上面的警告以及以下错误:

Traceback (most recent call last): File
"/var/app/venv/env/lib/python3.7/site-packages/celery/worker/worker.py",
line 205, in start self.blueprint.start(self)
File "/var/app/venv/env/lib/python3.7/site-packages/celery/bootsteps.py", line 119, in start step.start(parent)
File "/var/app/venv/env/lib/python3.7/site-packages/celery/bootsteps.py", line 370, in start return self.obj.start()
File "/var/app/venv/env/lib/python3.7/site-packages/celery/worker/consumer/consumer.py", line 316, in start blueprint.start(self)
File "/var/app/venv/env/lib/python3.7/site-packages/celery/bootsteps.py", line 119, in start step.start(parent)
File "/var/app/venv/env/lib/python3.7/site-packages/celery/worker/consumer/consumer.py", line 592, in start c.loop(*c.loop_args())
File "/var/app/venv/env/lib/python3.7/site-packages/celery/worker/loops.py", line 91, in asynloop next(loop)
File "/var/app/venv/env/lib/python3.7/site-packages/kombu/asynchronous/hub.py", line 299, in create_loop item()
File "/var/app/venv/env/lib/python3.7/site-packages/vine/promises.py", line 170, in call return self.throw()
File "/var/app/venv/env/lib/python3.7/site-packages/vine/promises.py", line 167, in call retval = fun(*final_args, **final_kwargs)
File "/var/app/venv/env/lib/python3.7/site-packages/kombu/transport/SQS.py", line 336, in _schedule_queue queue, callback=promise(self._loop1, (queue,)),
File "/var/app/venv/env/lib/python3.7/site-packages/kombu/transport/SQS.py", line 352, in _get_bulk_async return self._get_async(queue, maxcount, callback=callback) File "/var/app/venv/env/lib/python3.7/site-packages/kombu/transport/SQS.py", line 362, in _get_async qname, count=count, connection=self.asynsqs, File "/var/app/venv/env/lib/python3.7/site-packages/kombu/transport/SQS.py", line 456, in asynsqs region=self.region
File "/var/app/venv/env/lib/python3.7/site-packages/kombu/asynchronous/aws/sqs/connection.py", line 27, in init **kwargs File "/var/app/venv/env/lib/python3.7/site-packages/kombu/asynchronous/aws/connection.py", line 186, in init **http_client_params)
File "/var/app/venv/env/lib/python3.7/site-packages/kombu/asynchronous/aws/connection.py", line 151, in init self._httpclient = http_client or get_client() File "/var/app/venv/env/lib/python3.7/site-packages/kombu/asynchronous/http/init.py", line 22, in get_client client = hub._current_http_client = Client(hub, **kwargs) File "/var/app/venv/env/lib/python3.7/site-packages/kombu/asynchronous/http/init.py", line 13, in Client return CurlClient(hub, **kwargs)
File "/var/app/venv/env/lib/python3.7/site-packages/kombu/asynchronous/http/curl.py", line 43, in init raise ImportError('The curl client requires the pycurl library.') ImportError: The curl client requires the pycurl library. The above error is little strange since the pycurl is already installed.

当我更改 user=nobody 时出现以下错误:

File "/var/app/venv/env/lib/python3.7/site-packages/django/apps/registry.py", line 135, in check_apps_ready raise AppRegistryNotReady("Apps aren't loaded yet.") django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.

看看 documentation. It's a warning, though, not an error (see the code). Running Celery under root is an error only when you allow pickle serialization which is not enabled by default (see here).

希望能帮助解决您的问题。

在 headbanging.The 错误 ImportError('The curl client requires the pycurl library.') 数小时后得到解决,在 this github comment.As Safwan Samsudeen 指出警告 运行时警告:您是运行具有超级用户权限的工作者:绝对不推荐 不是 issue.So 我的 .conf 文件是相同的,我卸载了 pycurl 并再次使用命令 pip install pycurl --compile --global-option="--with-openssl" 重新安装它--no-cache-dir'