Bug 297201 - deskutils/py-paperless-ngx: service paperless-worker doesn't start
Summary: deskutils/py-paperless-ngx: service paperless-worker doesn't start
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Michael Gmelin
URL:
Keywords:
Depends on: 297203
Blocks:
  Show dependency treegraph
 
Reported: 2026-07-31 12:59 UTC by Thomas Kurschel
Modified: 2026-08-10 09:13 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (grembo)


Attachments
Fix paperless-worker service start (452 bytes, text/plain)
2026-07-31 12:59 UTC, Thomas Kurschel
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Kurschel 2026-07-31 12:59:35 UTC
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.
Comment 1 Michael Gmelin freebsd_committer freebsd_triage 2026-07-31 13:50:21 UTC
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).
Comment 2 Michael Gmelin freebsd_committer freebsd_triage 2026-07-31 13:54:30 UTC
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.
Comment 3 Michael Gmelin freebsd_committer freebsd_triage 2026-07-31 14:01:32 UTC
I added bug #297203 to update celery to a version that has a fix.
Comment 4 Thomas Kurschel 2026-07-31 15:11:18 UTC
(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.