Created attachment 273351 [details] Fix paperless-worker service start Starting paperless-worker results in following syslog message: [CRITICAL] [celery.worker] Unrecoverable error: AttributeError("'NoneType' object has no attribute 'isatty'") Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/celery/worker/worker.py", line 202, in start self.blueprint.start(self) File "/usr/local/lib/python3.12/site-packages/celery/bootsteps.py", line 112, in start self.on_start() File "/usr/local/lib/python3.12/site-packages/celery/apps/worker.py", line 135, in on_start self.emit_banner() File "/usr/local/lib/python3.12/site-packages/celery/apps/worker.py", line 164, in emit_banner use_image = term.supports_images() ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/celery/utils/term.py", line 165, in supports_images return sys.stdin.isatty() and ITERM_PROFILE ^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'isatty' It seems that the worker barfs because /dev/stdout is not existent. Workaround is to add parameter "-f" to daemon in rc.d, see attachment. I'm not sure whether it's related to FreeBSD 15.1p2, because on initial setup using FreeBSD 15.1p1, this problem didn't occur.
Hi, Thank you for bringing this up. Could you please try to revert your patch locally and modify /usr/local/lib/python3.12/site-packages/celery/utils/term.py so that supports_images reads like this: ``` def supports_images(): return sys.stdin and sys.stdin.isatty() and ITERM_PROFILE ``` If this works, I think fixing celery is better than working around the issue here. (I could swear that I've seen this error before in a different context).
I found the issue, I upstreamed a fix back in early 2025: https://github.com/celery/celery/pull/7814 It's just that the py-celery port hasn't been updated yet.
I added bug #297203 to update celery to a version that has a fix.
(In reply to Michael Gmelin from comment #3) Great! Thank you! It is really this celery line that needs to be fixed, but I thought that patching rc would be easier.