芹菜工人的权限被拒绝

时间:2020-04-07 15:32:17

标签: django celery shared-memory

说实话,我真的不知道我在做什么;)

最近,我在NAS的chroot中安装了Mayan EDMS。到目前为止,我已经可以使用它了……至少我可以登录等等。但是我无法上传任何文件,我想这与芹菜有关(我以前不知道)。

因为我在chroot中,所以无法对这些芹菜工人使用超级用户,因此我是从命令行启动它们的。

例如

nice -n 19 /path/to/my/mayan-edms/bin/celery worker -A mayan -Ofair -l ERROR -Q statistics,tools,common_periodic,parsing,document_states,mailing,ocr -n mayan-worker-slow.@%h --concurrency=1 

但这会引发错误:

-------------- mayan-worker-slow.@DiskStation213 v4.3.0 (rhubarb)
---- **** ----- 
--- * ***  * -- Linux-3.2.40-armv7l-with-glibc2.17 2020-04-07 15:15:07
-- * - **** --- 
- ** ---------- [config]
- ** ---------- .> app:         mayan:0x41cc8d00
- ** ---------- .> transport:   redis://:**@127.0.0.1:6379/0
- ** ---------- .> results:     redis://:**@127.0.0.1:6379/1
- *** --- * --- .> concurrency: 1 (prefork)
-- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker)
--- ***** ----- 
 -------------- [queues]
                .> common_periodic  exchange=common_periodic(direct) key=common_periodic
                .> document_states  exchange=document_states(direct) key=document_states
                .> mailing          exchange=mailing(direct) key=mailing
                .> ocr              exchange=ocr(direct) key=ocr
                .> parsing          exchange=parsing(direct) key=parsing
                .> statistics       exchange=statistics(direct) key=statistics
                .> tools            exchange=tools(direct) key=tools

[2020-04-07 15:15:08,187: CRITICAL/MainProcess] Unrecoverable error: PermissionError(13, 'Permission denied')
Traceback (most recent call last):
  File "/path/to/my/mayan-edms/lib/python3.8/site-packages/celery/worker/worker.py", line 205, in start
    self.blueprint.start(self)
  File "/path/to/my/mayan-edms/lib/python3.8/site-packages/celery/bootsteps.py", line 119, in start
    step.start(parent)
  File "/path/to/my/mayan-edms/lib/python3.8/site-packages/celery/bootsteps.py", line 369, in start
    return self.obj.start()
  File "/path/to/my/mayan-edms/lib/python3.8/site-packages/celery/concurrency/base.py", line 131, in start
    self.on_start()
  File "/path/to/my/mayan-edms/lib/python3.8/site-packages/celery/concurrency/prefork.py", line 107, in on_start
    P = self._pool = Pool(processes=self.limit,
  File "/path/to/my/mayan-edms/lib/python3.8/site-packages/celery/concurrency/asynpool.py", line 428, in __init__
    super(AsynPool, self).__init__(processes, *args, **kwargs)
  File "/path/to/my/mayan-edms/lib/python3.8/site-packages/billiard/pool.py", line 1046, in __init__
    self._create_worker_process(i)
  File "/path/to/my/mayan-edms/lib/python3.8/site-packages/celery/concurrency/asynpool.py", line 445, in _create_worker_process
    return super(AsynPool, self)._create_worker_process(i)
  File "/path/to/my/mayan-edms/lib/python3.8/site-packages/billiard/pool.py", line 1142, in _create_worker_process
    on_ready_counter = self._ctx.Value('i')
  File "/path/to/my/mayan-edms/lib/python3.8/site-packages/billiard/context.py", line 181, in Value
    return Value(typecode_or_type, *args, lock=lock,
  File "/path/to/my/mayan-edms/lib/python3.8/site-packages/billiard/sharedctypes.py", line 83, in Value
    lock = ctx.RLock()
  File "/path/to/my/mayan-edms/lib/python3.8/site-packages/billiard/context.py", line 110, in RLock
    return RLock(ctx=self.get_context())
  File "/path/to/my/mayan-edms/lib/python3.8/site-packages/billiard/synchronize.py", line 207, in __init__
    SemLock.__init__(self, RECURSIVE_MUTEX, 1, 1, ctx=ctx)
  File "/path/to/my/mayan-edms/lib/python3.8/site-packages/billiard/synchronize.py", line 71, in __init__
    sl = self._semlock = _billiard.SemLock(
PermissionError: [Errno 13] Permission denied

在其他线程中,我读到有时为/ dev / shm授予不同的权限会有所帮助,但我还记得,很久以前,我曾警告过不要将777授予过多的文件/文件夹/设备,因为它可能导致安全问题。

因此,我的第一个问题是:我如何只给一个用户(玛雅人)在该设备上进行读/写的权利?

我的第二个问题是:您认为这将有助于解决权限问题,还是应该将我的注意力转移到其他地方?

第三,我什至不知道这是否与消失的上传有关,但是您对此有何建议?因为没有文件上传的文档管理系统是没有用的,不是吗? :D

最诚挚的问候

0 个答案:

没有答案