We have a php application on App Engine and we use Cloud Build to build the app. Today a new version was supposed to be build and deployed, however the build process reported the following error after trying to deploy on App Engine

php-fpm: error while loading shared libraries: libzip.so.4: cannot open shared object file: No such file or directory

I have compared the last working image and the new image and I see a difference in the configuration command used to build the php. The new image uses the following command:

Configure Command =>  './configure'  '--enable-bcmath' '--enable-calendar' '--enable-dba' '--enable-exif' '--enable-fpm' '--enable-ftp' '--enable-intl' '--enable-mbstring' '--enable-mysqlnd' '--enable-pcntl' '--enable-shmop' '--enable-soap' '--enable-sockets' '--enable-sysvshm' '--enable-zend-test' '--prefix=/layers/google.php.runtime/php' '--sysconfdir=/etc' '--with-bz2' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/workspace' '--with-curl' '--with-enchant' '--with-gettext' '--with-gmp' '--with-imap-ssl' '--with-ldap' '--with-libdir=lib/x86_64-linux-gnu' '--with-mhash' '--with-mysqli' '--with-openssl' '--with-pcre-jit' '--with-pdo-mysql' '--with-pdo-pgsql' '--with-pear' '--with-pgsql' '--with-tidy' '--with-xsl' '--with-zlib' '--enable-gd' '--with-jpeg' '--with-freetype' '--with-zip'

The issue is that '--with-zip' was added but libzip4 is not installed on the image.

I don't see a way to install the library manually or to specify what should be the base image for the build. This means that we can't deploy the new version.

Any suggestions how to resolve this issue?

1

There are 1 best solutions below

0
botzko On

If you have similar issue you can use the following things:

  • Downgrade to the php version you used in your last successful deploy by adding the following to your app.yaml file:
runtime_config:
     runtime_version: "8.2.8"
  • Build your own image by using Google Cloud's buildpack. This is what is used to build the image when you deploy to App Engine. You will need to find the build and corresponding run images (you can find the images used in the Cloud Build logs). You will need to fix the issues with these images by building a new one starting from the problematic one. After this you will need to build your image using the fixed build/run images. To specify the the build is for App Engine you need to set the GAE_APPLICATION_YAML_PATH env like this --env GAE_APPLICATION_YAML_PATH="app.yaml" when building the image. After you build the image you should deploy this image to App Engine
  • You can get the built image from Cloud Build (the one that is with the issue) and modify it by fixing the issue inside it. You can find the image in the Cloud Build logs. After you build the image you should deploy this image to App Engine