Skip to content
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

ob_end_clean(): Failed to delete buffer in Worker.php #922

Closed
atom1285 opened this issue Jul 5, 2024 · 1 comment
Closed

ob_end_clean(): Failed to delete buffer in Worker.php #922

atom1285 opened this issue Jul 5, 2024 · 1 comment

Comments

@atom1285
Copy link
Contributor

atom1285 commented Jul 5, 2024

Octane Version

2.5.1

Laravel Version

10.48.15

PHP Version

8.3.8

What server type are you using?

Swoole

Server Version

5.3.1

Database Driver & Version

No response

Description

Upon sending a request to my laravel application I receive the following.

curl http://0.0.0.0:8000
ErrorException: ob_end_clean(): Failed to delete buffer. No buffer to delete in /var/www/html/vendor/laravel/octane/src/Worker.php:90
Stack trace:
#0 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(255): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError()
#1 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->Illuminate\Foundation\Bootstrap\{closure}()
#2 /var/www/html/vendor/laravel/octane/src/Worker.php(90): ob_end_clean()
#3 /var/www/html/vendor/laravel/octane/bin/swoole-server(120): Laravel\Octane\Worker->handle()
#4 [internal function]: {closure}()
#5 /var/www/html/vendor/laravel/octane/bin/swoole-server(170): Swoole\Server->start()
#6 {main}

I investigated and it happens, because an another package that i use cleans the output buffer (ob_end_clean()) when an exception is thrown in my application (in this case a 404 Not Found exception), this means that when octane executes ob_end_clean() the output buffer is already empty, so the function produces an E_NOTICE.

Steps To Reproduce

Run the ob_end_clean() function just before returning a response to octane.

@driesvints
Copy link
Member

Seems you sent in a PR so let's see how it goes. Thanks 👍

taylorotwell pushed a commit that referenced this issue Jul 5, 2024
* fix buffer error

* add test

* fix formatting

* fix formatting

* fix formatting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants