When sending 10 concurrent requests into Octane server with OpenSwoole coroutine enabled, it may throw BindingResolutionException:
$php artisan octane:start --workers=2
INFO Server running…
Local: http://127.0.0.1:8000
Press Ctrl+C to stop the server
200 GET /google ........................................................................ 19.36 mb 189.63 ms
200 GET /google ........................................................................ 19.37 mb 194.08 ms
200 GET /google ........................................................................ 19.40 mb 206.60 ms
200 GET /google ........................................................................ 19.35 mb 214.35 ms
200 GET /google ........................................................................ 19.31 mb 221.36 ms
200 GET /google ........................................................................ 19.26 mb 227.83 ms
Illuminate\Contracts\Container\BindingResolutionException
Target [Illuminate\Contracts\Encryption\Encrypter] is not instantiable while building [Illuminate\Cookie\Middleware\EncryptCookies].
at vendor/laravel/framework/src/Illuminate/Container/Container.php:1118
1114▕ } else {
1115▕ $message = "Target [$concrete] is not instantiable.";
1116▕ }
1117▕
➜ 1118▕ throw new BindingResolutionException($message);
1119▕ }
1120▕
1121▕ /**
1122▕ * Throw an exception for an unresolvable primitive.
200 GET /google ........................................................................ 19.32 mb 240.42 ms
200 GET /google ........................................................................ 19.29 mb 253.11 ms
200 GET /google ........................................................................ 19.24 mb 267.67 ms
200 GET /google ........................................................................ 19.20 mb 281.84 ms
Illuminate\Contracts\Container\BindingResolutionException
Target [Illuminate\Contracts\Encryption\Encrypter] is not instantiable while building [Illuminate\Cookie\Middleware\EncryptCookies].
at vendor/laravel/framework/src/Illuminate/Container/Container.php:1118
1114▕ } else {
1115▕ $message = "Target [$concrete] is not instantiable.";
1116▕ }
1117▕
➜ 1118▕ throw new BindingResolutionException($message);
1119▕ }
1120▕
1121▕ /**
1122▕ * Throw an exception for an unresolvable primitive.
200 GET /google ........................................................................ 19.78 mb 158.28 ms
200 GET /google ........................................................................ 19.73 mb 165.39 ms
200 GET /google ........................................................................ 19.59 mb 172.71 ms
200 GET /google ........................................................................ 19.51 mb 179.75 ms
200 GET /google ........................................................................ 19.46 mb 188.33 ms
Illuminate\Contracts\Container\BindingResolutionException
Target [Illuminate\Contracts\Encryption\Encrypter] is not instantiable while building [Illuminate\Cookie\Middleware\EncryptCookies].
at vendor/laravel/framework/src/Illuminate/Container/Container.php:1118
1114▕ } else {
1115▕ $message = "Target [$concrete] is not instantiable.";
1116▕ }
1117▕
➜ 1118▕ throw new BindingResolutionException($message);
1119▕ }
1120▕
1121▕ /**
1122▕ * Throw an exception for an unresolvable primitive.
200 GET /google ........................................................................ 19.78 mb 184.72 ms
200 GET /google ........................................................................ 19.73 mb 192.32 ms
Illuminate\Contracts\Container\BindingResolutionException
Target class [events] does not exist.
at vendor/laravel/framework/src/Illuminate/Container/Container.php:906
902▕
903▕ try {
904▕ $reflector = new ReflectionClass($concrete);
905▕ } catch (ReflectionException $e) {
➜ 906▕ throw new BindingResolutionException("Target class [$concrete] does not exist.", 0, $e);
907▕ }
908▕
909▕ // If the type is not instantiable, the developer is attempting to resolve
910▕ // an abstract type such as an Interface or Abstract Class and there is
Illuminate\Contracts\Container\BindingResolutionException
Target class [events] does not exist.
at vendor/laravel/framework/src/Illuminate/Container/Container.php:906
902▕
903▕ try {
904▕ $reflector = new ReflectionClass($concrete);
905▕ } catch (ReflectionException $e) {
➜ 906▕ throw new BindingResolutionException("Target class [$concrete] does not exist.", 0, $e);
907▕ }
908▕
909▕ // If the type is not instantiable, the developer is attempting to resolve
910▕ // an abstract type such as an Interface or Abstract Class and there is
200 GET /google ........................................................................ 19.77 mb 149.22 ms
200 GET /google ........................................................................ 19.74 mb 159.78 ms
200 GET /google ........................................................................ 19.70 mb 167.36 ms
200 GET /google ........................................................................ 19.65 mb 174.66 ms
200 GET /google ........................................................................ 19.46 mb 182.03 ms
200 GET /google ........................................................................ 19.77 mb 218.69 ms
200 GET /google ........................................................................ 19.74 mb 227.10 ms
200 GET /google ........................................................................ 19.70 mb 234.80 ms
200 GET /google ........................................................................ 19.65 mb 242.13 ms
200 GET /google ........................................................................ 19.46 mb 249.64 ms
200 GET /google ........................................................................ 19.77 mb 147.72 ms
200 GET /google ........................................................................ 19.77 mb 161.08 ms
200 GET /google ........................................................................ 19.74 mb 167.77 ms
200 GET /google ........................................................................ 19.70 mb 174.74 ms
200 GET /google ........................................................................ 19.65 mb 182.64 ms
200 GET /google ........................................................................ 19.61 mb 191.55 ms
There are two main exception:
BindingResolutionException: Target class [events] does not exist.
BindingResolutionException: Target [Illuminate\Contracts\Encryption\Encrypter] is not instantiable while building [Illuminate\Cookie\Middleware\EncryptCookies]
I believe these two errors are not the only ones; there should be similar objects that encountered errors during the binding process.
Although some requests encountered these errors, the response still returned 200.
Octane Version
2.4.0
Laravel Version
11.10.0
PHP Version
8.2.20
What server type are you using?
Open Swoole
Server Version
22.0.0
Database Driver & Version
php8.2-sqlite3
Description
When sending 10 concurrent requests into Octane server with OpenSwoole coroutine enabled, it may throw BindingResolutionException:
There are two main exception:
Target class [events] does not exist.
Target [Illuminate\Contracts\Encryption\Encrypter] is not instantiable while building [Illuminate\Cookie\Middleware\EncryptCookies]
I believe these two errors are not the only ones; there should be similar objects that encountered errors during the binding process.
Although some requests encountered these errors, the response still returned 200.
Steps To Reproduce
Router:
Configuration (all remains default values except
WorkerStarting
listeners andswoole.options
):\App\EnableCoroutine.php
:Dockerfile for listing all system libraries:
Start the server:
Concurrent requests by fortio: