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
symfony/console Unable to write output. #36166
Comments
Problem is with PHP 7.4 https://www.php.net/manual/en/migration74.incompatible.php#migration74.incompatible.core.fread-fwrite |
Thanks for tracking this down @HarasimowiczKamil . I guess there still needs to be some change in the symfony component then so that it handles the new return differently? |
Yes https://github.com/symfony/console/blob/master/Output/StreamOutput.php#L77 "should never happen" just happened 😄 For now I use |
I've also experienced this, but nothing more of value to add her. My "best guess": behaviour change in 7.4 now exposing something which was already there but hidden? OP however didn't state PHP Version , @robtesch are you using PHP 7.4 ? |
@mfn yes, sorry, at the time of posting i didn't know it was php version related, but yes, i am using PHP 7.4. |
Same here |
This PR was squashed before being merged into the 3.4 branch. Discussion ---------- [Console] Fix OutputStream for PHP 7.4 | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #36166 | License | MIT From PHP 7.4, `fwrite` function now returns false for any failure: https://www.php.net/manual/en/migration74.incompatible.php#migration74.incompatible.core.fread-fwrite Actually, the note in the PHP documentation is not exact: for PHP 7.3 and lower, `fwrite` function did return false when arguments passed in to the function were invalid, and 0 for other failures. From PHP 7.4, it returns false for any failure. We can see it in the source code: for PHP 7.3: https://github.com/php/php-src/blob/a1a8d144854acb1c891cf0c21abb0f612b1d8de7/ext/standard/file.c#L1140 Compare to PHP 7.4: https://github.com/php/php-src/blob/master/ext/standard/file.c#L1136 I update `OutputStream::doWrite()` to keep the same behavior as before. Commits ------- b375f93 [Console] Fix OutputStream for PHP 7.4
Is there a chance to merge to 4.3? |
@HarasimowiczKamil Symfony 4.3 does not receive bugfixes anymore. You will need to update to 4.4 (see https://symfony.com/releases/4.3). |
I had the same issue on Laravel. Afther writing |
Symfony version(s) affected:v5.0.5
Description
#laravel/horizon#762
Several of us have been having bizarre issues when using Laravel Horizon to manage our background queues. Since the actual error stems from symfony/console (and there is a comment just above the exception in the source code that says it should never get there) I figured it was best to submit an issue here about it.
How to reproduce
Unfortunately this one is pretty tough to get to the bottom of. So far it seems pretty "random" as to what's causing it. The best lead we have to go down is, throw an exception of any kind during a queued job. Steps to get there are as follows:
Possible Solution
Tried many things in order to reproduce or fix and so far absolutely nothing has helped.
Additional context
Stack trace:
The text was updated successfully, but these errors were encountered: