Bug 41337 - koha-create --request-db and --populate-db creates log files owned by root (intranet-error.log, opac-error.log)
Summary: koha-create --request-db and --populate-db creates log files owned by root (i...
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Installation and upgrade (command-line installer) (show other bugs)
Version: Main
Hardware: All Linux
: P1 - high major
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-12-01 14:12 UTC by Saiful Amin
Modified: 2025-12-01 14:12 UTC (History)
1 user (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Saiful Amin 2025-12-01 14:12:41 UTC
When creating a new Koha instance using the two-step workflow (--request-db and --populate-db), some log files under /var/log/koha/<instance>/ end up with incorrect permissions. Specifically, intranet-error.log and opac-error.log are created as root:root instead of <inst>-koha:<inst>-koha.

This causes Apache/Plack to fail to start cleanly until the ownership is corrected manually.

Steps to Reproduce:

1. Run: koha-create --request-db test
2. Create the DB/user on the remote or local DB host as instructed.
3. Then run: koha-create --populate-db test
4. Check ownership of generated logs: ls -l /var/log/koha/test
Actual Result:
Two files are owned by root:root:
-rw-r--r-- 1 root      root    0 intranet-error.log
-rw-r--r-- 1 root      root    0 opac-error.log

All other logs have correct ownership (test-koha:test-koha).

Koha will not start smoothly until these two files are manually chowned.

Expected Result:
All log files under /var/log/koha/<instance>/ should be owned by <instance>-koha:<instance>-koha, identical to a normal koha-create run without the request/populate split.

Notes: This only happens when using the two-step creation (--request-db + --populate-db). A normal one-step koha-create with --create-db assigns the correct ownership.