Unable to load dynamic library 'swoole'

631 Views Asked by At

I am trying to run laravel octane based image in php 8.1 image. but I am constantly getting an error of extension swoole.so not found

swoole.so is already there in desired location and php artisan octane:start is giving some errors like function not found

FROM existenz/webstack:8.1

RUN apk add --no-cache php81-openssl \
php81-session \
php81 \
php81-tokenizer \
php81-pdo \
php81-pdo_mysql \
php81-zip \
php81-xml \
php81-simplexml \
php81-fileinfo \
php81-xmlreader \
php81-xmlwriter \
php81-iconv \
php81-mbstring \
php81-curl \
php81-pecl-swoole \
libstdc++ \
libpq \
supervisor
COPY --chown=php:nginx . /www
COPY .docker/php.ini /etc/php81/php.ini
#RUN php81 artisan down
RUN php81 artisan optimize
#RUN php81 artisan up
RUN mkdir -p /etc/supervisor.d/
COPY .docker/supervisord.ini /etc/supervisor.d/supervisord.ini
CMD ["supervisord", "-c", "/etc/supervisor.d/supervisord.ini"]


Please suggest anything that will solve my problem and octane will start running on this image

Error Flashing is:

PHP Warning: PHP Startup: Unable to load dynamic library 'swoole' (tried: /usr/lib/php81/modules/swoole (Error loading shared library /usr/lib/php81/modules/swoole: No such file or directory), /usr/lib/php81/modules/swoole.so (Error relocating /usr/lib/php81/modules/swoole.so: curl_multi_assign: symbol not found)) in Unknown on line 0

Inside php.ini I have activated this swoole plugin

inside docker image logs following error are getting

[23-Feb-2023 12:50:39] NOTICE: PHP message: PHP Warning:  PHP Startup: Unable to load dynamic library 'swoole' (tried: /usr/lib/php81/modules/swoole (Error loading shared library /usr/lib/php81/modules/swoole: No such file or directory), /usr/lib/php81/modules/swoole.so (Error relocating /usr/lib/php81/modules/swoole.so: curl_multi_assign: symbol not found)) in Unknown on line 0
[23-Feb-2023 12:50:39] WARNING: Nothing matches the include pattern '/etc/php81/php-fpm.d/*.conf' from /etc/php81/php-fpm.conf at line 28.
[23-Feb-2023 12:50:39] NOTICE: fpm is running, pid 191
[23-Feb-2023 12:50:39] NOTICE: ready to handle connections
2023-02-23 12:50:39,419 CRIT Supervisor is running as root.  Privileges were not dropped because no user is specified in the config file.  If you intend to run as root, you can set user=root in the config file to avoid this message.
2023-02-23 12:50:39,421 INFO supervisord started with pid 207
2023-02-23 12:50:40,423 INFO spawned: 'laravel-octane_000' with pid 226
2023-02-23 12:50:40,424 INFO spawned: 'laravel-worker_00' with pid 227
2023-02-23 12:50:40,425 INFO spawned: 'laravel-worker_01' with pid 228
2023-02-23 12:50:40,426 INFO spawned: 'laravel-worker_02' with pid 229
2023-02-23 12:50:40,427 INFO spawned: 'laravel-worker_03' with pid 230
2023-02-23 12:50:40,428 INFO spawned: 'laravel-worker_04' with pid 231
2023-02-23 12:50:40,429 INFO spawned: 'laravel-worker_05' with pid 232
2023-02-23 12:50:40,431 INFO spawned: 'laravel-worker_06' with pid 233
2023-02-23 12:50:40,432 INFO spawned: 'laravel-worker_07' with pid 234
2023-02-23 12:50:40,620 CRIT uncaptured python exception, closing channel <POutputDispatcher at 140551371207680 for <Subprocess at 140551371197264 with name laravel-octane_000 in state STARTING> (stdout)> (<class 'OSError'>:[Errno 29] Invalid seek [/usr/lib/python3.10/site-packages/supervisor/supervisord.py|runforever|218] [/usr/lib/python3.10/site-packages/supervisor/dispatchers.py|handle_read_event|281] [/usr/lib/python3.10/site-packages/supervisor/dispatchers.py|record_output|215] [/usr/lib/python3.10/site-packages/supervisor/dispatchers.py|_log|184] [/usr/lib/python3.10/site-packages/supervisor/loggers.py|info|327] [/usr/lib/python3.10/site-packages/supervisor/loggers.py|log|345] [/usr/lib/python3.10/site-packages/supervisor/loggers.py|emit|227] [/usr/lib/python3.10/site-packages/supervisor/loggers.py|doRollover|264])
PHP Warning:  PHP Startup: Unable to load dynamic library 'swoole' (tried: /usr/lib/php81/modules/swoole (Error loading shared library /usr/lib/php81/modules/swoole: No such file or directory), /usr/lib/php81/modules/swoole.so (Error relocating /usr/lib/php81/modules/swoole.so: curl_multi_assign: symbol not found)) in Unknown on line 0
PHP Fatal error:  Uncaught Error: Call to undefined function Laravel\Octane\Swoole\Handlers\posix_getpid() in /www/vendor/laravel/octane/src/Swoole/Handlers/OnWorkerStart.php:38
Stack trace:
#0 /www/vendor/laravel/octane/bin/swoole-server(95): Laravel\Octane\Swoole\Handlers\OnWorkerStart->__invoke()
#1 /www/vendor/laravel/octane/bin/swoole-server(95): {closure}()
#2 [internal function]: {closure}()
#3 /www/vendor/laravel/octane/bin/swoole-server(170): Swoole\Server->start()
#4 {main}
  thrown in /www/vendor/laravel/octane/src/Swoole/Handlers/OnWorkerStart.php on line 38
Fatal error: Uncaught Error: Call to undefined function Laravel\Octane\Swoole\Handlers\posix_getpid() in /www/vendor/laravel/octane/src/Swoole/Handlers/OnWorkerStart.php:38
  thrown in /www/vendor/laravel/octane/src/Swoole/Handlers/OnWorkerStart.php on line 38PHP Fatal error:  Uncaught Error: Call to undefined function Laravel\Octane\Swoole\Handlers\posix_getpid() in /www/vendor/laravel/octane/src/Swoole/Handlers/OnWorkerStart.php:38
  thrownFatal error: Uncaught Error: Call to undefined function Laravel\Octane\Swoole\Handlers\posix_getpid() in /www/vendor/laravel/octane/src/Swoole/Handlers/OnWorkerStart.php:38
 in /www/vendor/laravel/octane/src/Swoole/Handlers/OnWorkerStart.php on line 38
  thrown in /www/vendor/laravel/octane/src/Swoole/Handlers/OnWorkerStart.php on line 38Fatal error: Uncaught Error: Call to undefined function Laravel\Octane\Swoole\Handlers\posix_getpid() in /www/vendor/laravel/octane/src/Swoole/Handlers/OnWorkerStart.php:38
  thrown
2023-02-23 12:50:41,124 CRIT uncaptured python exception, closing channel <POutputDispatcher at 140551371447824 for <Subprocess at 140551371197264 with name laravel-octane_000 in state STARTING> (stderr)> (<class 'OSError'>:[Errno 29] Invalid seek [/usr/lib/python3.10/site-packages/supervisor/supervisord.py|runforever|218] [/usr/lib/python3.10/site-packages/supervisor/dispatchers.py|handle_read_event|281] [/usr/lib/python3.10/site-packages/supervisor/dispatchers.py|record_output|215] [/usr/lib/python3.10/site-packages/supervisor/dispatchers.py|_log|184] [/usr/lib/python3.10/site-packages/supervisor/loggers.py|info|327] [/usr/lib/python3.10/site-packages/supervisor/loggers.py|log|345] [/usr/lib/python3.10/site-packages/supervisor/loggers.py|emit|227] [/usr/lib/python3.10/site-packages/supervisor/loggers.py|doRollover|264])
PHP Fatal error:  Uncaught Error: Call to a member function handleTick() on null in /www/vendor/laravel/octane/bin/swoole-server:145
Stack trace:
#0 [internal function]: {closure}()
#1 /www/vendor/laravel/octane/bin/swoole-server(170): Swoole\Server->start()
#2 {main}
  thrown in /www/vendor/laravel/octane/bin/swoole-server on line 145
Fatal error: Uncaught Error: Call to a member function handleTick() on null in /www/vendor/laravel/octane/bin/swoole-server:145
2023-02-23 12:50:42,124 CRIT uncaptured python exception, closing channel <POutputDispatcher at 140551371447824 for <Subprocess at 140551371197264 with name laravel-octane_000 in state STARTING> (stderr)> (<class 'OSError'>:[Errno 29] Invalid seek [/usr/lib/python3.10/site-packages/supervisor/supervisord.py|runforever|218] [/usr/lib/python3.10/site-packages/supervisor/dispatchers.py|handle_read_event|281] [/usr/lib/python3.10/site-packages/supervisor/dispatchers.py|record_output|215] [/usr/lib/python3.10/site-packages/supervisor/dispatchers.py|_log|184] [/usr/lib/python3.10/site-packages/supervisor/loggers.py|info|327] [/usr/lib/python3.10/site-packages/supervisor/loggers.py|log|345] [/usr/lib/python3.10/site-packages/supervisor/loggers.py|emit|227] [/usr/lib/python3.10/site-packages/supervisor/loggers.py|doRollover|264])
2023-02-23 12:50:42,124 INFO success: laravel-octane_000 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2023-02-23 12:50:42,124 INFO success: laravel-worker_00 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2023-02-23 12:50:42,124 INFO success: laravel-worker_01 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2023-02-23 12:50:42,124 INFO success: laravel-worker_02 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2023-02-23 12:50:42,124 INFO success: laravel-worker_03 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2023-02-23 12:50:42,124 INFO success: laravel-worker_04 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2023-02-23 12:50:42,124 INFO success: laravel-worker_05 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2023-02-23 12:50:42,124 INFO success: laravel-worker_06 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2023-02-23 12:50:42,124 INFO success: laravel-worker_07 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
PHP Fatal error:  Uncaught Error: Call to a member function handleTick() on null in /www/vendor/laravel/octane/bin/swoole-server:145
Stack trace:
#0 [internal function]: {closure}()
#1 /www/vendor/laravel/octane/bin/swoole-server(170): Swoole\Server->start()
#2 {main}
  thrown in /www/vendor/laravel/octane/bin/swoole-server on line 145
Fatal error: Uncaught Error: Call to a member function handleTick() on null in /www/vendor/laravel/octane/bin/swoole-server:145
2023-02-23 12:50:43,125 CRIT uncaptured python exception, closing channel <POutputDispatcher at 140551371447824 for <Subprocess at 140551371197264 with name laravel-octane_000 in state RUNNING> (stderr)> (<class 'OSError'>:[Errno 29] Invalid seek [/usr/lib/python3.10/site-packages/supervisor/supervisord.py|runforever|218] [/usr/lib/python3.10/site-packages/supervisor/dispatchers.py|handle_read_event|281] [/usr/lib/python3.10/site-packages/supervisor/dispatchers.py|record_output|215] [/usr/lib/python3.10/site-packages/supervisor/dispatchers.py|_log|184] [/usr/lib/python3.10/site-packages/supervisor/loggers.py|info|327] [/usr/lib/python3.10/site-packages/supervisor/loggers.py|log|345] [/usr/lib/python3.10/site-packages/supervisor/loggers.py|emit|227] [/usr/lib/python3.10/site-packages/supervisor/loggers.py|doRollover|264])
PHP Fatal error:  Uncaught Error: Call to a member function handleTick() on null in /www/vendor/laravel/octane/bin/swoole-server:145
Stack trace:
#0 [internal function]: {closure}()
#1 /www/vendor/laravel/octane/bin/swoole-server(170): Swoole\Server->start()
#2 {main}
  thrown in /www/vendor/laravel/octane/bin/swoole-server on line 145
Fatal error: Uncaught Error: Call to a member function handleTick() on null in /www/vendor/laravel/octane/bin/swoole-server:145
2023-02-23 12:50:44,125 CRIT uncaptured python exception, closing channel <POutputDispatcher at 140551371447824 for <Subprocess at 140551371197264 with name laravel-octane_000 in state RUNNING> (stderr)> (<class 'OSError'>:[Errno 29] Invalid seek [/usr/lib/python3.10/site-packages/supervisor/supervisord.py|runforever|218] [/usr/lib/python3.10/site-packages/supervisor/dispatchers.py|handle_read_event|281] [/usr/lib/python3.10/site-packages/supervisor/dispatchers.py|record_output|215] [/usr/lib/python3.10/site-packages/supervisor/dispatchers.py|_log|184] [/usr/lib/python3.10/site-packages/supervisor/loggers.py|info|327] [/usr/lib/python3.10/site-packages/supervisor/loggers.py|log|345] [/usr/lib/python3.10/site-packages/supervisor/loggers.py|emit|227] [/usr/lib/python3.10/site-packages/supervisor/loggers.py|doRollover|264])
PHP Fatal error:  Uncaught Error: Call to a member function handleTick() on null in /www/vendor/laravel/octane/bin/swoole-server:145
Stack trace:
#0 [internal function]: {closure}()
2023-02-23 12:50:45,127 CRIT uncaptured python exception, closing channel <POutputDispatcher at 140551371447824 for <Subprocess at 140551371197264 with name laravel-octane_000 in state RUNNING> (stderr)> (<class 'OSError'>:[Errno 29] Invalid seek [/usr/lib/python3.10/site-packages/supervisor/supervisord.py|runforever|218] [/usr/lib/python3.10/site-packages/supervisor/dispatchers.py|handle_read_event|281] [/usr/lib/python3.10/site-packages/supervisor/dispatchers.py|record_output|215] [/usr/lib/python3.10/site-packages/supervisor/dispatchers.py|_log|184] [/usr/lib/python3.10/site-packages/supervisor/loggers.py|info|327] [/usr/lib/python3.10/site-packages/supervisor/loggers.py|log|345] [/usr/lib/python3.10/site-packages/supervisor/loggers.py|emit|227] [/usr/lib/python3.10/site-packages/supervisor/loggers.py|doRollover|264])
#1 /www/vendor/laravel/octane/bin/swoole-server(170): Swoole\Server->start()
#2 {main}
  thrown in /www/vendor/laravel/octane/bin/swoole-server on line 145
Fatal error: Uncaught Error: Call to a member function handleTick() on null in /www/vendor/laravel/octane/bin/swoole-server:145
PHP Fatal error:  Uncaught Error: Call to a member function handleTick() on null in /www/vendor/laravel/octane/bin/swoole-server:145
Stack trace:
#0 [internal function]: {closure}()
#1 /www/vendor/laravel/octane/bin/swoole-server(170): Swoole\Server->start()
#2 {main}
  thrown in /www/vendor/laravel/octane/bin/swoole-server on line 145
Fatal error: Uncaught Error: Call to a member function handleTick() on null in /www/vendor/laravel/octane/bin/swoole-server:145
2023-02-23 12:50:46,127 CRIT uncaptured python exception, closing channel <POutputDispatcher at 140551371447824 for <Subprocess at 140551371197264 with name laravel-octane_000 in state RUNNING> (stderr)> (<class 'OSError'>:[Errno 29] Invalid seek [/usr/lib/python3.10/site-packages/supervisor/supervisord.py|runforever|218] [/usr/lib/python3.10/site-packages/supervisor/dispatchers.py|handle_read_event|281] [/usr/lib/python3.10/site-packages/supervisor/dispatchers.py|record_output|215] [/usr/lib/python3.10/site-packages/supervisor/dispatchers.py|_log|184] [/usr/lib/python3.10/site-packages/supervisor/loggers.py|info|327] [/usr/lib/python3.10/site-packages/supervisor/loggers.py|log|345] [/usr/lib/python3.10/site-packages/supervisor/loggers.py|emit|227] [/usr/lib/python3.10/site-packages/supervisor/loggers.py|doRollover|264])
PHP Fatal error:  Uncaught Error: Call to a member function handleTick() on null in /www/vendor/laravel/octane/bin/swoole-server:145
Stack trace:
0

There are 0 best solutions below