fix(config): Suppress config.php fopen error at install time#48426
Merged
provokateurin merged 1 commit intomasterfrom Oct 1, 2024
Merged
fix(config): Suppress config.php fopen error at install time#48426provokateurin merged 1 commit intomasterfrom
config.php fopen error at install time#48426provokateurin merged 1 commit intomasterfrom
Conversation
Signed-off-by: Josh <josh.t.richards@gmail.com>
Member
Author
|
/backport to stable30 |
Member
Author
|
/backport to stable29 |
Member
Author
|
/backport to stable28 |
come-nc
approved these changes
Sep 30, 2024
Contributor
come-nc
left a comment
There was a problem hiding this comment.
Either that or supporting the suppressor in onError is fine for me.
It’s really a pain that php fopen works like this -_-
provokateurin
approved these changes
Oct 1, 2024
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Failed to open stream+Error while running background jobimmediately after installation #45671 (config.php error not the second one in that report)Summary
The changes in #44230 brought back a regression from the OC days which is generating a non-operational error immediately after install time:
owncloud/core#13736
owncloud/core#21923
It becomes the very first log entry you see after a new install. While harmless from a technical standpoint, it is needless to say, not a great way for someone to be introduced to Nextcloud right after installation. And it gives the impression something is wrong, when it really isn't.
Cause
At install time we use our
onErrorerror handler:server/lib/base.php
Line 651 in 341b31b
This handler lacks handling to exclude suppressors:
server/lib/private/Log/ErrorHandler.php
Lines 53 to 61 in 341b31b
The easiest solution is simply to add back the
file_exists()check here before we callfopen().Additional thoughts
Despite this PR, I was tempted to add support in the
onErrorhandler for the suppressor. That way things behave in a standard way. If we want to suppress, it's been decided upon for a good reason. I took the approach here in this PR for now though because it seemed more conservative, by simply bringing back thefile_exists()check and relying on that instead of the non-functioning suppressor. This PR should be sufficient though since there aren't currently any other known situations where the suppressor handling is an issue. If/when other spots with the suppressor pop up, we could reconsider.TODO
Checklist