sail: Segmentation fault during building on Mac M1 devices

  • Sail Version: 1.8.1
  • Laravel Version: 8.46.0
  • PHP Version: 8.0.6
  • OS: macOS 11.4 (Apple Silicon)

Description:

While building the laravel.test container with sail, it currently is not able to finish and resolves in an Segmentation fault during building…

#7 33.87 ## Populating apt-get cache...
#7 33.87 
#7 33.87 + apt-get update
#7 33.95 Hit:1 http://ppa.launchpad.net/ondrej/php/ubuntu focal InRelease
#7 34.09 Hit:2 http://ports.ubuntu.com/ubuntu-ports focal InRelease
#7 34.19 Hit:3 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease
#7 34.28 Hit:4 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease
#7 34.38 Hit:5 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease
#7 34.43 Reading package lists...
#7 34.80 
#7 34.80 ## Installing packages required for setup: lsb-release...
#7 34.80 
#7 34.80 + apt-get install -y lsb-release > /dev/null 2>&1
#7 35.89 
#7 35.89 ## Confirming "focal" is supported...
#7 35.89 
#7 35.89 + curl -sLf -o /dev/null 'https://deb.nodesource.com/node_16.x/dists/focal/Release'
#7 35.92 
#7 35.92 ## Adding the NodeSource signing key to your keyring...
#7 35.92 
#7 35.92 + curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor | tee /usr/share/keyrings/nodesource.gpg >/dev/null
#7 35.95 
#7 35.95 ## Creating apt sources list file for the NodeSource Node.js 16.x repo...
#7 35.95 
#7 35.95 + echo 'deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_16.x focal main' > /etc/apt/sources.list.d/nodesource.list
#7 35.95 + echo 'deb-src [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_16.x focal main' >> /etc/apt/sources.list.d/nodesource.list
#7 35.95 
#7 35.95 ## Running `apt-get update` for you...
#7 35.95 
#7 35.95 + apt-get update
#7 36.03 Hit:1 http://ppa.launchpad.net/ondrej/php/ubuntu focal InRelease
#7 36.08 Get:2 https://deb.nodesource.com/node_16.x focal InRelease [4583 B]
#7 36.11 Get:3 https://deb.nodesource.com/node_16.x focal/main arm64 Packages [767 B]
#7 36.18 Hit:4 http://ports.ubuntu.com/ubuntu-ports focal InRelease
#7 36.28 Hit:5 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease
#7 36.37 Hit:6 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease
#7 36.47 Hit:7 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease
#7 36.52 Fetched 5350 B in 1s (9933 B/s)
#7 36.52 Reading package lists...
#7 36.88 
#7 36.88 ## Run `sudo apt-get install -y nodejs` to install Node.js 16.x and npm
#7 36.88 ## You may also need development tools to build native addons:
#7 36.88      sudo apt-get install gcc g++ make
#7 36.88 ## To install the Yarn package manager, run:
#7 36.88      curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/yarnkey.gpg >/dev/null
#7 36.88      echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
#7 36.88      sudo apt-get update && sudo apt-get install yarn
#7 36.88 
#7 36.88 
#7 36.91 Reading package lists...
#7 37.25 Building dependency tree...
#7 37.33 Reading state information...
#7 37.41 The following NEW packages will be installed:
#7 37.41   nodejs
#7 37.44 0 upgraded, 1 newly installed, 0 to remove and 8 not upgraded.
#7 37.44 Need to get 25.3 MB of archives.
#7 37.44 After this operation, 119 MB of additional disk space will be used.
#7 37.44 Get:1 https://deb.nodesource.com/node_16.x focal/main arm64 nodejs arm64 16.3.0-deb-1nodesource1 [25.3 MB]
#7 37.88 debconf: delaying package configuration, since apt-utils is not installed
#7 37.90 Fetched 25.3 MB in 0s (63.1 MB/s)
#7 37.92 Selecting previously unselected package nodejs.
(Reading database ... 21562 files and directories currently installed.)
#7 37.93 Preparing to unpack .../nodejs_16.3.0-deb-1nodesource1_arm64.deb ...
#7 37.93 Unpacking nodejs (16.3.0-deb-1nodesource1) ...
#7 39.47 Setting up nodejs (16.3.0-deb-1nodesource1) ...
#7 39.48 Processing triggers for man-db (2.9.1-1) ...
#7 39.54 Warning: apt-key output should not be parsed (stdout is not a terminal)
#7 39.56 gpg: no valid OpenPGP data found.
#7 39.56 Segmentation fault
------
failed to solve: rpc error: code = Unknown desc = executor failed running [/bin/sh -c apt-get update     && apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev python2     && mkdir -p ~/.gnupg     && chmod 600 ~/.gnupg     && echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf     && apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E5267A6C     && apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C300EE8C     && echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu focal main" > /etc/apt/sources.list.d/ppa_ondrej_php.list     && apt-get update     && apt-get install -y php8.0-cli php8.0-dev        php8.0-pgsql php8.0-sqlite3 php8.0-gd        php8.0-curl php8.0-memcached        php8.0-imap php8.0-mysql php8.0-mbstring        php8.0-xml php8.0-zip php8.0-bcmath php8.0-soap        php8.0-intl php8.0-readline        php8.0-msgpack php8.0-igbinary php8.0-ldap        php8.0-redis     && php -r "readfile('http://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer     && curl -sL https://deb.nodesource.com/setup_16.x | bash -     && apt-get install -y nodejs     && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -     && echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list     && apt-get update     && apt-get install -y yarn     && apt-get install -y mysql-client     && apt-get install -y postgresql-client     && apt-get -y autoremove     && apt-get clean     && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*]: exit code: 2

Steps To Reproduce:

  • Create a new laravel application,
  • Install sail with mariadb
  • Execute sail up -d

=> The build fails.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 35 (9 by maintainers)

Most upvoted comments

Had the same issue, working when changing https to http:

curl -sS http://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -

Interesting… I just updated my Docker to 20.10.7, build f0df350 (latest), and now I’m also getting a Segfault at the Node step.

For everyone that’s having this issue, I recommend to downgrade Docker to 20.10.6, build 370c289 or to stay on that version if you’re already on it (for now), as it appears that the newer version is actively causing this problem. This older build works.

Do note that downgrading Docker does mean you WILL lose your existing images/containers, as a ‘Factory Reset’ will be necessary. So be sure to make a backup / export of those images/containers first!

@driesvints I am on the M1 latest build and the issue still exists.

I can confirm that Downgrading helps. 😃

Huge thanks! 😃

I can confirm too, that it works now. The previous error seems to have been a temporary network problem. It fixed itself in my case.

@mludi I don’t think we’re ready yet to move to the newer Ubuntu. Forge still provisions Ubuntu 20.04 and we want to stick to the same version.

The issue is described here

https://docs.docker.com/docker-for-mac/release-notes/#known-issues

On Apple Silicon in native arm64 containers, older versions of libssl in debian:buster, ubuntu:20.04 and centos:8 will segfault when connected to some TLS servers, for example curl https://dl.yarnpkg.com. The bug is fixed in newer versions of libssl in debian:bullseye, ubuntu:21.04 and fedora:35.