Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failed to build with pack: mbedded daemon response: max depth exceeded #1649

Closed
dmitry-mightydevops opened this issue Feb 28, 2023 · 6 comments
Labels
type/support Issue with general questions or troubleshooting.

Comments

@dmitry-mightydevops
Copy link

Summary

Using pack cli with paketo buildpacks for PHP it fails with:

pack build app --path=$(pwd) --buildpack gcr.io/paketo-buildpacks/php:2.4   --builder paketobuildpacks/builder:0.2.256-full --run-image paketobuildpacks/run:1.3.125-full-cnb

0.2.256-full: Pulling from paketobuildpacks/builder
Digest: sha256:cb19251d74c9d90c1ea88d92dc2180b51c9ef661bc570a7b01b55a2c5c6922e0
Status: Image is up to date for paketobuildpacks/builder:0.2.256-full
1.3.125-full-cnb: Pulling from paketobuildpacks/run
Digest: sha256:72b21852ae279bbde51f8a0660fafe5a1f76287d5db25f17586b2399737499f1
Status: Image is up to date for paketobuildpacks/run:1.3.125-full-cnb
2.4: Pulling from paketo-buildpacks/php
Digest: sha256:a07fc765726f161ac1fd3e6f79e84a07ee3740769d7920e48e0b05238f210f71
Status: Image is up to date for gcr.io/paketo-buildpacks/php:2.4
ERROR: failed to build: failed to write image to the following tags: [pack.local/builder/796e6b77717174746e75:latest: loading image "pack.local/builder/796e6b77717174746e75:latest". first error: embedded daemon response: max depth exceeded]

I made clean up with docker system prune -a that didn't help

At the same time if I run:

pack build app --path=$(pwd) --buildpack gcr.io/paketo-buildpacks/php   --builder paketobuildpacks/builder:full --run-image paketobuildpacks/run:full-cnb

it fails with a different error:

Digest: sha256:fc74261d4fbde0eb3db33b8408a5d143669b3ad83ffa28cde4e745763e6866a7
Status: Downloaded newer image for gcr.io/paketo-buildpacks/php:latest
===> ANALYZING
Previous image with name "app" not found
===> DETECTING
9 of 13 buildpacks participating
paketo-buildpacks/ca-certificates  3.6.0
paketo-buildpacks/php-dist         2.0.6
paketo-buildpacks/composer         0.5.4
paketo-buildpacks/composer-install 0.3.4
paketo-buildpacks/nginx            0.12.2
paketo-buildpacks/php-fpm          0.2.5
paketo-buildpacks/php-nginx        0.2.5
paketo-buildpacks/php-start        0.4.5
paketo-buildpacks/procfile         5.6.0
===> RESTORING
===> BUILDING

Paketo Buildpack for CA Certificates 3.6.0
  https://github.com/paketo-buildpacks/ca-certificates
  Launch Helper: Contributing to layer
    Creating /layers/paketo-buildpacks_ca-certificates/helper/exec.d/ca-certificates-helper
Paketo Buildpack for PHP Distribution 2.0.6
  Resolving PHP version
    Candidate version sources (in priority order):
      BP_PHP_VERSION -> "7.4.*"
      composer.lock  -> "^7.1"
      <unknown>      -> ""

failed to satisfy "php" dependency version constraint "7.4.*": no compatible versions on "io.buildpacks.stacks.bionic" stack. Supported versions are: [8.0.27, 8.0.28, 8.1.15, 8.1.16]
ERROR: failed to build: exit status 1
ERROR: failed to build: executing lifecycle: failed with status code: 51

So I need to use older versions of the builder/runner to support PHP 7.1


Current behavior

Build failed with the error

ERROR: failed to build: failed to write image to the following tags: [pack.local/builder/796e6b77717174746e75:latest: loading image "pack.local/builder/796e6b77717174746e75:latest". first error: embedded daemon response: max depth exceeded]
Expected behavior

Image to be built successfully


Environment

pack info
✗  pack report
Pack:
  Version:  0.28.0+git-b10e41f.build-3729
  OS/Arch:  linux/amd64

Default Lifecycle Version:  0.15.2

Supported Platform APIs:  0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.10

Config:
(no config file found at /home/dmitry/.pack/config.toml)
docker info
➜ docker info                                                     
Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.10.2
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.16.0
    Path:     /usr/libexec/docker/cli-plugins/docker-compose
  scan: Docker Scan (Docker Inc.)
    Version:  v0.23.0
    Path:     /usr/libexec/docker/cli-plugins/docker-scan

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 3
 Server Version: 23.0.1
 Storage Driver: btrfs
  Btrfs: 
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 2456e983eb9e37e47538f59ea18f2043c9a73640
 runc version: v1.1.4-0-g5fd4c4d
 init version: de40ad0
 Security Options:
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.1.12-100.fc36.x86_64
 Operating System: Fedora Linux 36 (Workstation Edition)
 OSType: linux
 Architecture: x86_64
 CPUs: 12
 Total Memory: 62.3GiB
 Name: dmitry-laptop
 ID: UQLP:CSSZ:F2KO:C33V:D724:ZKLU:OA5Y:GW3C:KZIH:X7DF:WXAD:YPKE
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

@dmitry-mightydevops dmitry-mightydevops added status/triage Issue or PR that requires contributor attention. type/bug Issue that reports an unexpected behaviour. labels Feb 28, 2023
@natalieparellano
Copy link
Member

FWIW I think this relates to #1595 as I believe max depth exceeded shows up when the builder has too many layers.

What happens if you don't provide --buildpack gcr.io/paketo-buildpacks/php?

cc @dmikusa

@dmikusa
Copy link
Contributor

dmikusa commented Feb 28, 2023

Yes, 100%. max depth exceeded means you have too many layers.

Either:

1.) drop the --buildpack flags and use the buidpacks in the builder.
2.) use a buildpackless builder. These start with no buildpacks, so the layer count is a lot lower. Then you just need to add the --buildpack flag with the buildpacks you want to use. Ex: --builder gcr.io/paketo-buildpacks/builder:buildpackless-base.

and @natalieparellano Yes, this is a perfect example to illustrate the request on #1595

@dmitry-mightydevops
Copy link
Author

@dmikusa @natalieparellano thank you for suggestions!

  1. The problem is that I need to support older deprecated version of PHP (specifically the PHP 7.4). If I drop the --buildpack gcr.io/paketo-buildpacks/php:0.11 (which supports older PHP), then I get an error
pack build app --path=$(pwd)  --builder paketobuildpacks/builder:full --run-image paketobuildpacks/run:full-cnb
...
8d64c9e373d0: Pull complete 
273978fd99f5: Pull complete 
4f4fb700ef54: Pull complete 
Digest: sha256:92c9f5795c31f93ac0a5a9c2a3e6e9f1142ddd4bf82c3cfdd542034011304532
Status: Downloaded newer image for paketobuildpacks/builder:full
full-cnb: Pulling from paketobuildpacks/run
e58c18cab017: Already exists 
b5cff81d82a3: Already exists 
89f12f6a028f: Pull complete 
ea6d6675c1de: Pull complete 
2e16d22ba9a8: Pull complete 
0776c74abed9: Pull complete 
0b6da45e0e0b: Pull complete 
Digest: sha256:7dd145d8c23d8e2d1fc1706d2e5eef5c49cb6328ba7976bcf074b5bf69993f8e
Status: Downloaded newer image for paketobuildpacks/run:full-cnb
ERROR: failed to build: Invalid buildpack defined in project descriptor

this folder where I run the command above contains the following project.toml file:

[project]
id = "io.buildpacks.project-backend"
name = "Project"
version = "1.0.0"

[build]
exclude = [
  ".*ignore",
  ".data",
  ".env",
  ".git",
  ".idea",
  "*.pem",
  "*.properties",
  "*.sql",
  "**/.local.ini",
  "bootstrap/app/public/*",
  "bootstrap/cache/*.php",
  "ci",
  "composer.phar",
  "install.sh",
  "Makefile",
  "package.json",
  "storage/framework/cache/*",
  "storage/framework/debugbar",
  "storage/framework/sessions/*",
  "storage/framework/views/*",
  "storage/logs/*",
  "storage/tmp/*",
  "vendor",
]

[[build.buildpacks]]
id = "gcr.io/paketo-buildpacks/php:0.11"

[[build.env]]
name =  "BP_PHP_SERVER"
value = "nginx"

[[build.env]]
name =  "BP_NGINX_VERSION"
value = "1.22.*"

[[build.env]]
name =  "BP_PHP_VERSION"
value = "7.4.*"

[[ build.env ]]
name="BP_COMPOSER_INSTALL_OPTIONS"
value="--dev --prefer-dist --no-suggest"
  1. with buldpackless
➜ pack build app --path=$(pwd) --builder gcr.io/paketo-buildpacks/builder:buildpackless-base --run-image paketobuildpacks/run:full-cnb 
buildpackless-base: Pulling from paketo-buildpacks/builder
e58c18cab017: Already exists 
6d86645106a5: Pull complete 
2bc5566b75ad: Pull complete 
16f0453a6b98: Pull complete 
f0c1c6a5398b: Pull complete 
20bceb6e60f5: Pull complete 
e478e71fb8ef: Pull complete 
70e0bea64ce8: Pull complete 
682fcfb7094c: Pull complete 
f9305a2967d6: Pull complete 
72ad9888618d: Pull complete 
4f4fb700ef54: Pull complete 
Digest: sha256:8b0b3999be3ee2810d89e6e4b09685177be5e5ed6837f688271cdbb18633f23e
Status: Downloaded newer image for gcr.io/paketo-buildpacks/builder:buildpackless-base
full-cnb: Pulling from paketobuildpacks/run
Digest: sha256:7dd145d8c23d8e2d1fc1706d2e5eef5c49cb6328ba7976bcf074b5bf69993f8e
Status: Image is up to date for paketobuildpacks/run:full-cnb
ERROR: failed to build: Invalid buildpack defined in project descriptor

if I mention "old" php buildpack, still error

✗  pack build app  --buildpack gcr.io/paketo-buildpacks/php:0.11 --builder gcr.io/paketo-buildpacks/builder:buildpackless-base                              
buildpackless-base: Pulling from paketo-buildpacks/builder
Digest: sha256:8b0b3999be3ee2810d89e6e4b09685177be5e5ed6837f688271cdbb18633f23e
Status: Image is up to date for gcr.io/paketo-buildpacks/builder:buildpackless-base
base-cnb: Pulling from paketo-buildpacks/run
e58c18cab017: Already exists 
6d86645106a5: Already exists 
2f51262d9ef7: Pull complete 
6a4881d9f26b: Pull complete 
ce1a5c1e325e: Pull complete 
4edf834187f5: Pull complete 
9a13d981ab1a: Pull complete 
Digest: sha256:92bd0f7d7315281a1f330ac9f1175049a3cf603884fb263901cce2d2c725a739
Status: Downloaded newer image for gcr.io/paketo-buildpacks/run:base-cnb
0.11: Pulling from paketo-buildpacks/php
Digest: sha256:c477c3eca0e16856e323ec835fd515fc136972b19d4a3ef329d80e45b4f32d9f
Status: Image is up to date for gcr.io/paketo-buildpacks/php:0.11
ERROR: failed to build: validating stack mixins: buildpack paketo-buildpacks/[email protected] requires missing mixin(s): libargon2-0, libcurl4, libedit2, libgd3, libmagickwand-6.q16-3, libonig4, libxml2

@dmitry-mightydevops
Copy link
Author

Also per their github
https://github.com/paketo-buildpacks/php supports only in the full builder


The PHP buildpack is compatible with the following builder(s):
Paketo Jammy Full Builder
Paketo Bionic Full Builder

@dmikusa
Copy link
Contributor

dmikusa commented Mar 2, 2023

If you need to use an older buildpack, you'll have to use the stackless builder. They are the same in terms of compatibility, so use the full stackless builder for jammy or bionic.

I don't know why you're getting those errors but would suggest reaching out on https://github.com/paketo-buildpacks/php and asking. The issues you're having are not related to pack. It may be that your buildpack is just too old. If that's the case, you could repackage the latest buildpack but add in binaries for your particular version of PHP. That said, I don't work on the PHP buildpacks so I would defer to whatever the maintainers suggest.

@jjbustamante jjbustamante added type/support Issue with general questions or troubleshooting. and removed type/bug Issue that reports an unexpected behaviour. status/triage Issue or PR that requires contributor attention. labels Aug 14, 2023
@natalieparellano
Copy link
Member

I'm going to close this issue as it doesn't seem related to pack. Please note that buildpacks/rfcs#290 would refine the (currently experimental) feature for reducing the number of layers in buildpack packages and builders.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/support Issue with general questions or troubleshooting.
Projects
None yet
Development

No branches or pull requests

4 participants