Skip to content

Run queue worker as abc user - #297

Open
tiran133 wants to merge 1 commit into
linuxserver:masterfrom
tiran133:fix/queue-worker-user
Open

Run queue worker as abc user#297
tiran133 wants to merge 1 commit into
linuxserver:masterfrom
tiran133:fix/queue-worker-user

Conversation

@tiran133

@tiran133 tiran133 commented Aug 5, 2026

Copy link
Copy Markdown
  • I have read the contributing guideline and understand that I have made the correct modifications

Description:

Run the BookStack async queue worker as the abc user using s6-setuidgid.

A corresponding changelog entry has also been added to readme-vars.yml.

Benefits of this PR and context:

The queue worker currently inherits root privileges from s6, while PHP-FPM runs as the abc user.

If the queue worker is the first process to write to /config/log/bookstack/laravel.log, such as during a transient Redis failure, the file is created as root:root with mode 0644. PHP-FPM cannot subsequently append to it, causing Laravel logging to throw an UnexpectedValueException and web requests to return HTTP 500 errors.

Running the queue worker as abc:

  • Prevents root-owned Laravel log files.
  • Ensures PHP-FPM and the queue worker can safely share application files.
  • Consistently applies the configured PUID and PGID.
  • Avoids requiring startup-time ownership repairs as a workaround.

How Has This Been Tested?

  • Successfully built the complete image using docker build --no-cache --pull.
  • Started an isolated container from the resulting image with PUID=1000, PGID=1000, and QUEUE_CONNECTION=redis.
  • Confirmed the async queue worker ran as UID/GID 1000:1000.
  • Triggered the failure path using an unavailable Redis endpoint.
  • Confirmed the queue worker created /config/log/bookstack/laravel.log as 1000:1000 with mode 0644.
  • Confirmed the PHP-FPM UID could write to the resulting log file.
  • Confirmed PHP-FPM workers also ran as UID/GID 1000:1000.
  • Ran bash -n and git diff --check successfully.

Source / References:

AI assistance disclosure:

The issue investigation and preparation of this change were assisted by OpenAI Codex. The resulting diagnosis, code change, and validation results were reviewed by the contributor.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for opening this pull request! Be sure to follow the pull request template!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants