sail: Segmentation fault with last docker version
Sail Version
1.26
Laravel Version
10.10
PHP Version
8.2
Operating System
Linux
OS Version
Debian 12 (kernel 6.1.0-13-amd64)
Description
With the latest version of docker and docker-desktop, when running ./vendor/bin/sail up, the mysql image is pulled successfully, but when Laravel is building, it crashes (segfault) at Processing triggers for php8.2-cli (8.2.13-1+ubuntu22.04.1+deb.sury.org+1).
I tried purging docker from my computer (along with docker-desktop) but nothing worked.
Maybe as the previous Issue #639 it comes from the docker compose version because I use the version Docker Compose version v2.23.0-desktop.1.
Here is the ouput of the command:
...
71.99 Setting up build-essential (12.9ubuntu3) ...
72.00 Setting up debhelper (13.6ubuntu1) ...
72.01 Setting up pkg-php-tools (1.42build1) ...
72.02 Processing triggers for libc-bin (2.35-0ubuntu3.4) ...
72.05 Processing triggers for fontconfig (2.13.1-4.2ubuntu5) ...
72.18 Processing triggers for php8.2-cli (8.2.13-1+ubuntu22.04.1+deb.sury.org+1) ...
72.23 Segmentation fault
72.58 curl: (23) Failure writing output to destination
------
failed to solve: process "/bin/sh -c apt-get update && mkdir -p /etc/apt/keyrings && apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev python2 dnsutils librsvg2-bin fswatch && curl -sS 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x14aa40ec0831756756d7f66c4f4ea0aae5267a6c' | gpg --dearmor | tee /etc/apt/keyrings/ppa_ondrej_php.gpg > /dev/null && echo \"deb [signed-by=/etc/apt/keyrings/ppa_ondrej_php.gpg] https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy main\" > /etc/apt/sources.list.d/ppa_ondrej_php.list && apt-get update && apt-get install -y php8.2-cli php8.2-dev php8.2-pgsql php8.2-sqlite3 php8.2-gd php8.2-imagick php8.2-curl php8.2-imap php8.2-mysql php8.2-mbstring php8.2-xml php8.2-zip php8.2-bcmath php8.2-soap php8.2-intl php8.2-readline php8.2-ldap php8.2-msgpack php8.2-igbinary php8.2-redis php8.2-swoole php8.2-memcached php8.2-pcov php8.2-xdebug && curl -sLS https://getcomposer.org/installer | php -- --install-dir=/usr/bin/ --filename=composer && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && echo \"deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_VERSION.x nodistro main\" > /etc/apt/sources.list.d/nodesource.list && apt-get update && apt-get install -y nodejs && npm install -g npm && npm install -g pnpm && npm install -g bun && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | tee /etc/apt/keyrings/yarn.gpg >/dev/null && echo \"deb [signed-by=/etc/apt/keyrings/yarn.gpg] https://dl.yarnpkg.com/debian/ stable main\" > /etc/apt/sources.list.d/yarn.list && curl -sS https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | tee /etc/apt/keyrings/pgdg.gpg >/dev/null && echo \"deb [signed-by=/etc/apt/keyrings/pgdg.gpg] http://apt.postgresql.org/pub/repos/apt jammy-pgdg main\" > /etc/apt/sources.list.d/pgdg.list && apt-get update && apt-get install -y yarn && apt-get install -y mysql-client && apt-get install -y postgresql-client-$POSTGRES_VERSION && apt-get -y autoremove && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*" did not complete successfully: exit code: 139
Steps To Reproduce
- Have the latest docker, docker-composer, and docker-desktop version.
- Create a new Laravel project
- Install Sail
- Run
./vendor/bin/sail up
About this issue
- Original URL
- State: closed
- Created 7 months ago
- Reactions: 10
- Comments: 62 (8 by maintainers)
Commenting out
php8.2-xdebugworks for me. Thanks @cjj25 !Steps to apply the fix with Swoole prior to 5.1.1 installed along with xdebug 3.3
On a new Laravel project
vendor/laravel/sail/runtimes/8.2/Dockerfilewith the fixphp artisan sail:installOn an already existing project
If you just pulled the project and did not create a docker image, go from step 3 of the first example. Otherwise (already have a docker image setup)
php artisan sail:publishdocker/8.2/Dockerfilewith the fixsail build --no-cacheHope it works for you !
You’re right on! Mentioned it above here https://github.com/laravel/sail/issues/641#issuecomment-1836054617. An issue has already been reported https://github.com/oerdnj/deb.sury.org/issues/2058. Now we wait ^^
Correct ^^
Already a report on there https://bugs.xdebug.org/view.php?id=2221
A segmentation fault during an
npmcommand sounds like a very different issue, and unlikely caused by sail. Best to post on a support forum with more full logs of the errors.(For what its worth, the commands listed worked fine for me, doing
./vendor/bin/sail up -d -- buildto make sure to use latest image)It now builds the docker images again for me. Maybe somebody else can also try it too?
@ToguyC Unfortunately you’ll need to modify the actual Dockerfile you originally found in the vendor directly as you can’t run the sail:publish without having a working built docker image.
Oh nice didn’t see it, thanks.
@cjj25 my apologies for being misleading there. It was a fix I rushed out to the devs @ the company I work for before lunch
It seems like it’s the official package that’s broken yeah…
New question for you @cjj25 have you tried specifying the pecl version to an older known good one? We have a container image that’s got xdebug installed but it’s running an old version for stability reasons (3.2.2)
So
We also need to specify a xdebug.ini file
then copy it in
Hope this helps ^^
Commenting out the php8.2-xdebug gets the build working.
File:
docker/8.2/DockerfilePerhaps the compiling of php8.2-xdebug is making the container run out of memory (throwing ideas out there)?
becomes
Nice thanks @Theprim0. I tried several things to mitigate this issue, but setting up the image to use PHP 8.3 seems currently the only working option, although it launched like 2-3 days ago as a stable release.
I tried setting up the sail image to
sail-8.3/appand context to 8.3 also, and it seems to work. It can be a workaround but if any project have to use specifically PHP 8.2 it will not be possible.@driesvints I can confirm, that the issue exists with PHP 8.1 and 8.2 (not tested with PHP 8.0)
PHP 8.3 seems to work fine.
The issue stems from this line of code
https://github.com/laravel/sail/blob/688a820f10fe67ad6dec724721b732d96de9a572/runtimes/8.2/Dockerfile#L31
curl fails when it’s passing piping it out to PHP
Same with 8.1 here !