Fix logger overwriting vars in some circumstances#32898
Merged
Conversation
Member
Author
|
/backport to stable25 |
Member
Author
|
/backport to stable24 |
Member
Author
|
/backport to stable23 |
Member
Author
|
special thanks to @miaulalala and @mgallien for the debugging sessions <3 |
5da846c to
52839f6
Compare
866baac to
7d443de
Compare
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
7d443de to
8b2b594
Compare
|
The backport to stable25 failed. Please do this backport manually. |
Member
Author
|
/backport to stable22 |
Member
Author
off by one 🤭 |
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.
We were investigating one case, indicated by the error
foreach() argument must be of type array|object, string givenThis can be reproduce like this:
1.) in php.ini, zend.exception_ignore_args is set to "Off" (PHP default, check distro in doubt)
2.) app files_lock enabled
3.) use an addressbook client (like KAddressbook)
4.) there, add a new contact
You will see an exception like:
{ "Exception": "Error", "Message": "Invalid argument supplied for foreach() at /srv/http/nextcloud/stable24/3rdparty/sabre/dav/lib/DAV/Server.php#1454", "Code": 0, "Trace": [ { "file": "/srv/http/nextcloud/stable24/3rdparty/sabre/dav/lib/DAV/Server.php", "line": 1454, "function": "onAll", "class": "OC\\Log\\ErrorHandler", "type": "::", "args": [ 2, "Invalid argument supplied for foreach()", "/srv/http/nextcloud/stable24/3rdparty/sabre/dav/lib/DAV/Server.php", 1454, { "request": { "__class__": "Sabre\\HTTP\\Request" }, "response": { "__class__": "Sabre\\HTTP\\Response" }, "path": "addressbooks/users/stable24/contacts/1655379707.R254.vcf", "node": null, "lastMod": null, "etag": null, "ifMatch": null, "e": { "__class__": "Sabre\\DAV\\Exception\\NotFound" }, "ifNoneMatch": "*", "nodeExists": false, "ifUnmodifiedSince": null, "ifConditions": "*** sensitive parameter replaced ***" } ] }, { "file": "/srv/http/nextcloud/stable24/3rdparty/sabre/dav/lib/DAV/Server.php", "line": 466, "function": "checkPreconditions", "class": "Sabre\\DAV\\Server", "type": "->", "args": [ { "__class__": "Sabre\\HTTP\\Request" }, { "__class__": "Sabre\\HTTP\\Response" } ] }, { "file": "/srv/http/nextcloud/stable24/3rdparty/sabre/dav/lib/DAV/Server.php", "line": 253, "function": "invokeMethod", "class": "Sabre\\DAV\\Server", "type": "->", "args": [ { "__class__": "Sabre\\HTTP\\Request" }, { "__class__": "Sabre\\HTTP\\Response" } ] }, { "file": "/srv/http/nextcloud/stable24/3rdparty/sabre/dav/lib/DAV/Server.php", "line": 321, "function": "start", "class": "Sabre\\DAV\\Server", "type": "->", "args": [] }, { "file": "/srv/http/nextcloud/stable24/apps/dav/lib/Server.php", "line": 352, "function": "exec", "class": "Sabre\\DAV\\Server", "type": "->", "args": [] }, { "file": "/srv/http/nextcloud/stable24/apps/dav/appinfo/v2/remote.php", "line": 35, "function": "exec", "class": "OCA\\DAV\\Server", "type": "->", "args": [] }, { "file": "/srv/http/nextcloud/stable24/remote.php", "line": 166, "args": [ "/srv/http/nextcloud/stable24/apps/dav/appinfo/v2/remote.php" ], "function": "require_once" } ], "File": "/srv/http/nextcloud/stable24/lib/private/Log/ErrorHandler.php", "Line": 99, "CustomMessage": "--" }The hidden issue is that a variable, passed by reference, was overwritten. I used to be an array and was turned into a string
*** sensitive parameter replaced ***.Now we have a test to reproduce the issue and the fix.
This problem popped up in a related scenario, where we committed a temporary fix: #32685