Skip to content

fix(occ): Suppress errors when checking config.php fileowner #51594

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

Merged
merged 1 commit into from
Mar 26, 2025

Conversation

provokateurin
Copy link
Member

Summary

In a docker container of mine I've seen that I'm unable to install since #33545:

+ ./occ maintenance:install --admin-pass admin --admin-email [email protected]

Warning: fileowner(): stat failed for /usr/src/nextcloud/config/config.php in /usr/src/nextcloud/occ on line 20
An unhandled exception has been thrown:
Exception: Config file has leading content, please remove everything before "<?php" in apcu.config.php in /usr/src/nextcloud/lib/private/Config.php:222
Stack trace:
#0 /usr/src/nextcloud/lib/private/Config.php(40): OC\Config->readData()
#1 /usr/src/nextcloud/lib/base.php(94): OC\Config->__construct('/usr/src/nextcl...')
#2 /usr/src/nextcloud/lib/base.php(615): OC::initPaths()
#3 /usr/src/nextcloud/lib/base.php(1156): OC::init()
#4 /usr/src/nextcloud/console.php(28): require_once('/usr/src/nextcl...')
#5 /usr/src/nextcloud/occ(33): require_once('/usr/src/nextcl...')
#6 {main}

I have never seen it fail locally, but I have seen a few times that if something goes wrong in occ, odd errors are thrown down the line.
I tried this patch in the docker container and it makes it successfully install again.
I'm quite surprised, that I didn't find any reports about this issue in the server or docker repos.

Checklist

@provokateurin provokateurin added bug 3. to review Waiting for reviews labels Mar 20, 2025
@provokateurin provokateurin added this to the Nextcloud 32 milestone Mar 20, 2025
@provokateurin provokateurin requested a review from a team as a code owner March 20, 2025 07:06
@provokateurin provokateurin requested review from icewind1991, Altahrim and skjnldsv and removed request for a team March 20, 2025 07:06
@provokateurin
Copy link
Member Author

/backport to stable31

@provokateurin
Copy link
Member Author

/backport to stable30

Copy link
Contributor

@susnux susnux left a comment

Choose a reason for hiding this comment

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

looks good

@provokateurin provokateurin enabled auto-merge March 20, 2025 09:07
@provokateurin provokateurin requested a review from a team March 25, 2025 07:23
Copy link
Contributor

@szaimen szaimen left a comment

Choose a reason for hiding this comment

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

LGTM but didnt test

@provokateurin provokateurin merged commit e67eba5 into master Mar 26, 2025
121 checks passed
@provokateurin provokateurin deleted the fix/occ/config-fileowner-suppress-errors branch March 26, 2025 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants