Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with starting celery: "invalid width %r (must be > 0)" #3887

Closed
anandsourabh opened this issue Apr 7, 2021 · 2 comments
Closed

Issue with starting celery: "invalid width %r (must be > 0)" #3887

anandsourabh opened this issue Apr 7, 2021 · 2 comments
Labels
bug Something isn't working right

Comments

@anandsourabh
Copy link

I am using the base posthog docker image. The celery worker threads fail to start with the below error due to which the pre-flight checks are not completing successfully.

Has anyone else encountered this issue? There are many threads talking of setting docker environment variables etc.
Just wanted to check if there is a prescribed solution from the Posthog team.

Traceback (most recent call last):
  File "/usr/local/bin/celery", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/site-packages/celery/__main__.py", line 16, in main
    _main()
  File "/usr/local/lib/python3.8/site-packages/celery/bin/celery.py", line 322, in main
    cmd.execute_from_commandline(argv)
  File "/usr/local/lib/python3.8/site-packages/celery/bin/celery.py", line 495, in execute_from_commandline
    super(CeleryCommand, self).execute_from_commandline(argv)))
  File "/usr/local/lib/python3.8/site-packages/celery/bin/base.py", line 305, in execute_from_commandline
    return self.handle_argv(self.prog_name, argv[1:])
  File "/usr/local/lib/python3.8/site-packages/celery/bin/celery.py", line 487, in handle_argv
    return self.execute(command, argv)
  File "/usr/local/lib/python3.8/site-packages/celery/bin/celery.py", line 415, in execute
    return cls(
  File "/usr/local/lib/python3.8/site-packages/celery/bin/worker.py", line 221, in run_from_argv
    *self.parse_options(prog_name, argv, command))
  File "/usr/local/lib/python3.8/site-packages/celery/bin/base.py", line 428, in parse_options
    self.parser = self.create_parser(prog_name, command)
  File "/usr/local/lib/python3.8/site-packages/celery/bin/base.py", line 440, in create_parser
    description=self._format_description(self.description),
  File "/usr/local/lib/python3.8/site-packages/celery/bin/base.py", line 462, in _format_description
    text.fill_paragraphs(text.dedent(description), width))
  File "/usr/local/lib/python3.8/site-packages/celery/utils/text.py", line 58, in fill_paragraphs
    return sep.join(fill(p, width) for p in s.split(sep))
  File "/usr/local/lib/python3.8/site-packages/celery/utils/text.py", line 58, in <genexpr>
    return sep.join(fill(p, width) for p in s.split(sep))
  File "/usr/local/lib/python3.8/textwrap.py", line 391, in fill
    return w.fill(text)
  File "/usr/local/lib/python3.8/textwrap.py", line 363, in fill
    return "\n".join(self.wrap(text))
  File "/usr/local/lib/python3.8/textwrap.py", line 354, in wrap
    return self._wrap_chunks(chunks)
  File "/usr/local/lib/python3.8/textwrap.py", line 248, in _wrap_chunks
    raise ValueError("invalid width %r (must be > 0)" % self.width)
ValueError: invalid width -2 (must be > 0)
^[[2K^[[1G^[[2m[1/4]^[[22m Resolving packages...
@anandsourabh anandsourabh added the bug Something isn't working right label Apr 7, 2021
@Twixes
Copy link
Member

Twixes commented Apr 16, 2021

Unfortunately it looks like a very very system specific issue regarding terminal size (looking at celery/celery#5761). We haven't seen this before, but setting shell var COLUMNS should fix it.

@anandsourabh
Copy link
Author

This was fixed by adding COLUMS shell var, more of a doker thing. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working right
Projects
None yet
Development

No branches or pull requests

2 participants