cloudfoundry / php-buildpack

A Cloud Foundry Buildpack for PHP.
Apache License 2.0
142 stars 342 forks source link

PHP 8.1.11 and libcrypt.so.1.1 conflict during buildback compile #722

Closed tuga84 closed 1 year ago

tuga84 commented 1 year ago

What version of Cloud Foundry and CF CLI are you using? (i.e. What is the output of running cf curl /v2/info && cf version? ❯ cf curl /v2/info && cf version { "name": "", "build": "", "support": "", "version": 0, "description": "", "authorization_endpoint": "https://login.prod-mgmt-p", "token_endpoint": "https://uaa.prod-mgmt-p", "min_cli_version": null, "min_recommended_cli_version": null, "app_ssh_endpoint": "ssh.prod-mgmt-p*", "app_ssh_host_key_fingerprint": "**", "app_ssh_oauth_client": "ssh-proxy", "doppler_logging_endpoint": "wss://doppler.prod-mgmt-p:443", "api_version": "2.128.0", "osbapi_version": "2.14", "routing_endpoint": "https://api.prod-mgmt-p*/routing", "user": "60efe255-4295-4968-8bf5-3329b6465226"

What version of the buildpack you are using? 4.4.67

If you were attempting to accomplish a task, what was it you were attempting to do? Try to fix it in our pipeline or try to fix dependecies in the apps manifest.yaml

What did you expect to happen?

A clean PHP environment with the correct libraries.

It could be as well related to this article https://www.php.net/manual/en/openssl.requirements.php

n order to use the OpenSSL functions you need to install the » OpenSSL library. PHP 7 requires at least OpenSSL >= 0.9.8. Other versions (PHP >= 7.1.0) require OpenSSL >= 1.0.1. Only PHP >= 8.1 supports OpenSSL >= 3.0.

What was the actual behavior?

During the app deployment our gitlab runner was unable to build the php stack.

Starting app net.m.app-GREEN in org backend / space dev as -ci... Staging app and tracing logs... Downloading mgb_php_oracle_buildpack_latest... Downloaded mgb_php_oracle_buildpack_latest Cell 3822248e-d124-4f3b-91af-02f9306afb98 creating container for instance a77fb7f0-f1b6-4c59-bbb4-ede64307c5dd Cell 3822248e-d124-4f3b-91af-02f9306afb98 successfully created container for instance a77fb7f0-f1b6-4c59-bbb4-ede64307c5dd Downloading app package... Downloaded app package (24M) -------> Buildpack version 4.4.67 Installing Nginx Downloaded [file:///tmp/buildpacks/ff872f10462dca2610c15c3c48159f83/dependencies/https_buildpacks.cloudfoundry.org_dependencies_nginx-static_nginx-static_1.23.1_linux_x64_cflinuxfs3_23bf563e.tgz] to [/tmp] NGINX 1.23.1 Installing PHP PHP 8.1.11 Downloaded [file:///tmp/buildpacks/ff872f10462dca2610c15c3c48159f83/dependencies/file__tmp_build_86eb19bb_php-buildpack-builder_php-builds_php-8.1.11-linux-x64.tgz] to [/tmp] /tmp/app/php/bin/php: /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1: version `OPENSSL_1_1_1' not found (required by /tmp/app/php/bin/php) Traceback (most recent call last): File "/tmp/buildpacks/ff872f10462dca2610c15c3c48159f83/scripts/compile.py", line 57, in .from_build_pack('lib/additional_commands') File "/tmp/buildpacks/ff872f10462dca2610c15c3c48159f83/lib/build_pack_utils/builder.py", line 212, in extensions process_extension(path, ctx, 'compile', process, args=[self]) File "/tmp/buildpacks/ff872f10462dca2610c15c3c48159f83/lib/build_pack_utils/utils.py", line 69, in process_extension success(getattr(extn, to_call)(args)) File "/tmp/buildpacks/ff872f10462dca2610c15c3c48159f83/lib/extension_helpers.py", line 48, in extension_helper_wrapper return getattr(inst, 'compile')(install) File "/tmp/buildpacks/ff872f10462dca2610c15c3c48159f83/lib/extension_helpers.py", line 154, in compile self._compile(install) File "/tmp/buildpacks/ff872f10462dca2610c15c3c48159f83/lib/php/extension.py", line 142, in _compile validate_php_ini_extensions(ctx) File "/tmp/buildpacks/ff872f10462dca2610c15c3c48159f83/lib/compile_helpers.py", line 168, in validate_php_ini_extensions all_supported = _get_supported_php_extensions(ctx) + _get_compiled_modules(ctx) File "/tmp/buildpacks/ff872f10462dca2610c15c3c48159f83/lib/compile_helpers.py", line 132, in _get_compiled_modules raise RuntimeError("Error determining PHP compiled modules") RuntimeError: Error determining PHP compiled modules Failed to compile droplet: Failed to run finalize script: exit status 1 Exit status 223 Cell 3822248e-d124-4f3b-91af-02f9306afb98 stopping instance a77fb7f0-f1b6-4c59-bbb4-ede64307c5dd Cell 3822248e-d124-4f3b-91af-02f9306afb98 destroying container for instance a77fb7f0-f1b6-4c59-bbb4-ede64307c5dd FAILED Error staging application: App staging failed in the buildpack compile phase In the mentioned bb_php-buildpack-builder_php-builds_php-8.1.11-linux-x64.tgz archive which cirunner download, following file libcrypto.so.1.1 it isn't available in the lib folder.

An ls shows only these 3 files /Users/m0584955/Downloads/php_8.1.11_linux_x64_cflinuxfs3_4e981704/lib ❯ ls -al |grep crypt -rw-r--r-- 3 m0584955 187920 Oct 3 21:32 libmcrypt.so -rw-r--r-- 3 m0584955 187920 Oct 3 21:32 libmcrypt.so.4 -rw-r--r-- 3 m0584955 187920 Oct 3 21:32 libmcrypt.so.4.4.8

Please confirm where necessary:

brayanhenao commented 1 year ago

Hi @tuga84, could you please provide us with a sample application to reproduce the error and perform the corresponding debugging?

tuga84 commented 1 year ago

Hi @brayanhenao

Thanks for your reply.

Our workflow is slightly different then we use a custom buildpack with additional binaries and extentsions. So for the moment we can close it.

I'll reopen one after our custom buildpack is build from scratsch and tested against a sample app.

Kind regards