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
Subprocess failure on "upgrade:all" with PHP deprecation messages #751
Comments
My first question to you would be: where is |
It's a default But the same can occur anytime for any other deprecation in PHP. |
Since PHP outputs this startup error message early on, before any php script is triggered and it output this message to stdout not stderr, I see no way to fix this particular issue. Other notices triggered during runtime are either muted by our own error handler or the one from TYPO3, so they won't appear in the output. That is at least my observation. If you have a way to reproduce a failure with runtime error messages, please let me know. |
I also have no other idea how to let a subprocess cleanly communicate to the parent process, except from the hacky approach to use stdout for that. If you know from other ways to achieve that, let me know as well. |
A safe solution would be a separate file descriptor instead of Aside from that the only option I see ATM is to drop everything from the subprocess output except of the last line which is supposed to contain the actual output:
|
separate file descriptors are not supported by Symfony Process Regarding sanitation: I have no clue how we should detect what should be kept and what should be discarded |
Maybe I'm naive but basically like this:
|
your code would cover exactly one case where exactly one line is prepended to the output. I'm not even sure if it would work on Windows (crlf) |
Actually it works for many lines. |
Well, ok it is the other way around. Only one output line is treated as valid, leading to a wrong result if the serialized string contains newlines. See the result of this code with an actual value produced by a subprocess. We would need to wrap the actual output between magic strings and then cut out that value from in between. And still, if this magical string would appear within the actual output it would break. |
Guess we'd actually need a way to stop PHP from emitting these messages in subprocesses ... |
In order to not interfere with the actual output of sub-processes, we suppress the native php error output for starting a sub-process. Any important error will be turned into an exception anyway, which will result in the sub-process to fail. Fixes: TYPO3-Console#751
In order to not interfere with the actual output of sub-processes, we suppress the native php error output for starting a sub-process. Any important error will be turned into an exception anyway, which will result in the sub-process to fail. Also fix the non working PHP_INI_PATH env var setting since we are at it. Fixes: TYPO3-Console#751
I can't confirm, that the message appears when the option is set to off. Can you re-check? Thanks. It does not appear, if Therefore, I think, I have found a good solution to fix this. |
In order to not interfere with the actual output of sub-processes, we suppress the native php error output for starting a sub-process. Any important error will be turned into an exception anyway, which will result in the sub-process to fail. Also fix the non working PHP_INI_PATH env var setting since we are at it. Fixes: TYPO3-Console#751
In order to not interfere with the actual output of sub-processes, we suppress the native php error output for starting a sub-process. Any important error will be turned into an exception anyway, which will result in the sub-process to fail. Also fix the non working PHP_INI_PATH env var setting since we are at it. Fixes: TYPO3-Console#751
Bug Report
Current Behavior
If PHP shows deprecation messages (e.g. for usage of
track_errors
inphp.ini
) theupgrade:all
command fails. This happens because theUpgradeHandling
executesupgrade:subprocess
and unserializes the response which in this case can contain messages from PHP in addition to a serialized response:TYPO3-Console/Classes/Console/Install/Upgrade/UpgradeHandling.php
Line 235 in 35b5a60
Expected behavior/output
The
upgrade:all
command should skip messages like these.TYPO3 Console command executed
TYPO3 Console command output
Environment
Possible Solution
The response from
upgrade:subprocess
should be sanitized before unserialization.The text was updated successfully, but these errors were encountered: