-
Notifications
You must be signed in to change notification settings - Fork 19
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
Fix for updater/application.php cli fatal errors #472 #482 owncloud/core#31425 #485
Conversation
…d#453 - and owncloud/core/#31425) - when running application.php from command line, fatal error occurs. Traced issue to an unnecessary/fatal "=" in the command line being provided to "php occ" by ConfigReader.php:109. I am unsure if the issue is with the original change of this code to its current revision (owncloud@f78291e#diff-ad6d84de30f605974920c65454932957 ) or if the issue is one of a Symfony framework change. The root issue appears to be Symfony\Component\Process\Process by way of occRunner->runJson interpreting the array as a key-value pair with an empty argument. Example cmd line: [commandline:Symfony\Component\Process\Process:private] => php /path/occ --no-warnings config:list --output=json '--private=' Nevertheless, changing ConfigReader.php:109 to simply remove the associative array assignment of an empty string (e.g. ** => '' **) appears to fix the issue. I have tested this change on OC 10.0.9/Ubuntu 18.04/PHP 7.2 and the error is resolved and the command line changes to remove the "=".
More notes are in #482 - more analysis appears to be that this commit fixes an incorrect implementation of the parsing code as implemented in https://github.com/owncloud/updater/blob/master/src/Utils/OccRunner.php#L73-L80 |
@danieldjewell thanks a lot for taking this over! |
@danieldjewell May I ask you to submit another PR against stable10 branch? |
Hey @VicDeo no problem! Sorry, haven't been on in awhile and didn't see your reply until now. Glad to help! Just confirming -- did you still need me to submit another PR against stable10? |
@danieldjewell yes, please |
…o update stable10 with changes from owncloud@857ec02
@danieldjewell thank you very much! |
Description
As reported in several issues, running "php updater/application.php upgrade:detect/info" results in a fatal error.
Traced issue to an unnecessary/fatal "=" in the command line being provided to "php occ" by ConfigReader.php:109. I am unsure if the issue is with the original change of this code to its current revision (f78291e#diff-ad6d84de30f605974920c65454932957 ) or if the issue is one of a Symfony framework change.
The root issue appears to be Symfony\Component\Process\Process by way of occRunner->runJson interpreting the array as a key-value pair with an empty argument. This results in the argument to "occ" changing from '--private' to '--private=' ... resulting in a fatal error in "occ" and thus a fatal error in "updater/application.php".
Example cmd line: [commandline:Symfony\Component\Process\Process:private] => php /path/occ --no-warnings config:list --output=json '--private='
Nevertheless, changing ConfigReader.php:109 to simply remove the associative array assignment of an empty string (e.g. ** => '' **) appears to fix the issue.
Related Issue
Motivation and Context
I am unsure when this actually stopped working - presumably, when the original commit was made 2 years ago, it worked. My only guess is a regression and/or change in the Symfony framework process code -- or a commit/change to "occ" to make it perform more strict command line argument testing.
This proposed pull fixes the immediate issues with updater/application.php being 99.9% broken -- however, there may be other regressions/effects by the ultimate root cause that was the source of this.
How Has This Been Tested?
Screenshots (if appropriate):
See issues for details.
Types of changes
Checklist:
Do we really need the above for this?
Open tasks: