title: celery multi start PermissionError: [Errno 13] Permission denied: '/var/run/celery'
body: <p>I'm trying to run celery multi workers for a specific group of task with the command</p>
  <pre><code>celery multi start proj.main -E
  </code></pre>
  <p>but when I execute it got me this permission error</p>
  <pre><code>celery multi start proj.main -E
  celery multi v5.2.3 (dawn-chorus)
  Traceback (most recent call last):
    File &quot;/home/developer/.pyenv/versions/3.9.5/envs/CeleryRabbit/bin/celery&quot;, line 8, in &lt;module&gt;
      sys.exit(main())
    File &quot;/home/developer/.pyenv/versions/CeleryRabbit/lib/python3.9/site-packages/celery/__main__.py&quot;, line 15, in main
      sys.exit(_main())
    File &quot;/home/developer/.pyenv/versions/CeleryRabbit/lib/python3.9/site-packages/celery/bin/celery.py&quot;, line 213, in main
      return celery(auto_envvar_prefix=&quot;CELERY&quot;)
    File &quot;/home/developer/.pyenv/versions/CeleryRabbit/lib/python3.9/site-packages/click/core.py&quot;, line 1128, in __call__
      return self.main(*args, **kwargs)
    File &quot;/home/developer/.pyenv/versions/CeleryRabbit/lib/python3.9/site-packages/click/core.py&quot;, line 1053, in main
      rv = self.invoke(ctx)
    File &quot;/home/developer/.pyenv/versions/CeleryRabbit/lib/python3.9/site-packages/click/core.py&quot;, line 1659, in invoke
      return _process_result(sub_ctx.command.invoke(sub_ctx))
    File &quot;/home/developer/.pyenv/versions/CeleryRabbit/lib/python3.9/site-packages/click/core.py&quot;, line 1395, in invoke
      return ctx.invoke(self.callback, **ctx.params)
    File &quot;/home/developer/.pyenv/versions/CeleryRabbit/lib/python3.9/site-packages/click/core.py&quot;, line 754, in invoke
      return __callback(*args, **kwargs)
    File &quot;/home/developer/.pyenv/versions/CeleryRabbit/lib/python3.9/site-packages/click/decorators.py&quot;, line 26, in new_func
      return f(get_current_context(), *args, **kwargs)
    File &quot;/home/developer/.pyenv/versions/CeleryRabbit/lib/python3.9/site-packages/celery/bin/base.py&quot;, line 134, in caller
      return f(ctx, *args, **kwargs)
    File &quot;/home/developer/.pyenv/versions/CeleryRabbit/lib/python3.9/site-packages/celery/bin/multi.py&quot;, line 480, in multi
      return cmd.execute_from_commandline(args)
    File &quot;/home/developer/.pyenv/versions/CeleryRabbit/lib/python3.9/site-packages/celery/bin/multi.py&quot;, line 271, in execute_from_commandline
      return self.call_command(argv[0], argv[1:])
    File &quot;/home/developer/.pyenv/versions/CeleryRabbit/lib/python3.9/site-packages/celery/bin/multi.py&quot;, line 278, in call_command
      return self.commands[command](*argv) or EX_OK
    File &quot;/home/developer/.pyenv/versions/CeleryRabbit/lib/python3.9/site-packages/celery/bin/multi.py&quot;, line 148, in _inner
      return fun(self, *args, **kwargs)
    File &quot;/home/developer/.pyenv/versions/CeleryRabbit/lib/python3.9/site-packages/celery/bin/multi.py&quot;, line 156, in _inner
      return fun(self, self.cluster_from_argv(argv), **kwargs)
    File &quot;/home/developer/.pyenv/versions/CeleryRabbit/lib/python3.9/site-packages/celery/bin/multi.py&quot;, line 366, in cluster_from_argv
      _, cluster = self._cluster_from_argv(argv, cmd=cmd)
    File &quot;/home/developer/.pyenv/versions/CeleryRabbit/lib/python3.9/site-packages/celery/bin/multi.py&quot;, line 371, in _cluster_from_argv
      return p, self.Cluster(list(nodes), cmd=cmd)
    File &quot;/home/developer/.pyenv/versions/CeleryRabbit/lib/python3.9/site-packages/celery/apps/multi.py&quot;, line 319, in &lt;genexpr&gt;
      self._node_from_options(
    File &quot;/home/developer/.pyenv/versions/CeleryRabbit/lib/python3.9/site-packages/celery/apps/multi.py&quot;, line 328, in _node_from_options
      return Node(nodename, cmd, append,
    File &quot;/home/developer/.pyenv/versions/CeleryRabbit/lib/python3.9/site-packages/celery/apps/multi.py&quot;, line 132, in __init__
      self.options = self._annotate_with_default_opts(
    File &quot;/home/developer/.pyenv/versions/CeleryRabbit/lib/python3.9/site-packages/celery/apps/multi.py&quot;, line 140, in _annotate_with_default_opts
      self._setdefaultopt(options, ['--pidfile', '-p'], '/var/run/celery/%n.pid')
    File &quot;/home/developer/.pyenv/versions/CeleryRabbit/lib/python3.9/site-packages/celery/apps/multi.py&quot;, line 154, in _setdefaultopt
      os.makedirs(dir_path)
    File &quot;/home/developer/.pyenv/versions/3.9.5/lib/python3.9/os.py&quot;, line 225, in makedirs
      mkdir(name, mode)
  PermissionError: [Errno 13] Permission denied: '/var/run/celery'
  </code></pre>
  <p>I didn't get this error if I execute differents workers in differents terminals</p>
  <p>my project structure is:</p>
  <pre><code>proj
       __init__.py
       celeryconfig.py
       main.py
       tasks.py
  </code></pre>
  <p>how can I use multi my celery version is v5.2.3</p>
  <p><strong>my celeryconfig.py</strong></p>
  <pre><code># config for proj celery
  broker_url = 'pyamqp://'
  result_backend = 'rpc://'
  
  task_serializer = 'json'
  result_serializer = 'json'
  accept_content = ['json']
  timezone = 'America/Caracas'
  enable_utc = True
  include = ['proj.tasks']
  task_ignore_result = True
  </code></pre>
  <p><strong>my main.py</strong></p>
  <pre><code>from celery import Celery
  
  app = Celery('proj')
  
  app.conf.update(result_expires=3600)
  
  app.config_from_object(&quot;proj.celeryconfig&quot;)
  
  if __name__ == '__main__':
      app.start()
  </code></pre>
  <p><strong>tasks.py</strong></p>
  <pre><code>import random
  import time
  
  from .main import app
  
  
  @app.task
  def too_long_task(n):
      t = random.randint(4, 8)
      time.sleep(t)
      return f&quot;task n:{n} long task done&quot;
  
  
  @app.task
  def quick_task(n):
      t = random.randint(0, 3)
      time.sleep(t)
      return f&quot;task n:{n} quick task done&quot;
  
  
  @app.task
  def add(x, y):
      return x + y
  
  
  @app.task
  def mul(x, y):
      return x * y
  
  
  @app.task
  def rest(x, y):
      return x - y
  
  
  @app.task
  def n_add(numbers):
      return sum(numbers)
  </code></pre>