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

debian-11 failed when building the docker image 1.21.0-main-debian11 #311

Closed
v1v opened this issue Aug 17, 2023 · 6 comments
Closed

debian-11 failed when building the docker image 1.21.0-main-debian11 #311

v1v opened this issue Aug 17, 2023 · 6 comments

Comments

@v1v
Copy link
Member

v1v commented Aug 17, 2023

[2023-08-16T10:22:31.447Z] >> Building docker.elastic.co/beats-dev/golang-crossbuild:1.21.0-main-debian11
[2023-08-16T10:22:31.949Z] #0 building with "default" instance using docker driver
[2023-08-16T10:22:31.949Z] 
[2023-08-16T10:23:45.480Z] #9 [ 4/10] RUN apt install -y --no-install-recommends --allow-unauthenticated         libsystemd-dev
[2023-08-16T10:23:45.781Z] #9 0.299 
[2023-08-16T10:23:45.781Z] #9 0.299 WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
[2023-08-16T10:23:45.781Z] #9 0.299 
[2023-08-16T10:23:46.784Z] #9 0.306 Reading package lists...
[2023-08-16T10:23:47.085Z] #9 1.442 Building dependency tree...
[2023-08-16T10:23:47.085Z] #9 1.714 Reading state information...
[2023-08-16T10:23:47.186Z] #9 1.843 Some packages could not be installed. This may mean that you have
[2023-08-16T10:23:47.186Z] #9 1.843 requested an impossible situation or if you are using the unstable
[2023-08-16T10:23:47.186Z] #9 1.843 distribution that some required packages have not yet been created
[2023-08-16T10:23:47.186Z] #9 1.843 or been moved out of Incoming.
[2023-08-16T10:23:47.186Z] #9 1.843 The following information may help to resolve the situation:
[2023-08-16T10:23:47.186Z] #9 1.843 
[2023-08-16T10:23:47.186Z] #9 1.843 The following packages have unmet dependencies:
[2023-08-16T10:23:47.186Z] #9 1.920  libsystemd-dev : Depends: libsystemd0 (= 247.3-7+deb11u2)
[2023-08-16T10:23:47.286Z] #9 1.946 E: Unable to correct problems, you have held broken packages.
[2023-08-16T10:23:47.286Z] #9 ERROR: process "/bin/sh -c apt install -y --no-install-recommends --allow-unauthenticated         libsystemd-dev" did not complete successfully: exit code: 100
[2023-08-16T10:23:47.286Z] ------
[2023-08-16T10:23:47.286Z]  > [ 4/10] RUN apt install -y --no-install-recommends --allow-unauthenticated         libsystemd-dev:
[2023-08-16T10:23:47.286Z] 1.714 Reading state information...
[2023-08-16T10:23:47.286Z] 1.843 Some packages could not be installed. This may mean that you have
[2023-08-16T10:23:47.286Z] 1.843 requested an impossible situation or if you are using the unstable
[2023-08-16T10:23:47.286Z] 1.843 distribution that some required packages have not yet been created
[2023-08-16T10:23:47.286Z] 1.843 or been moved out of Incoming.
[2023-08-16T10:23:47.287Z] 1.843 The following information may help to resolve the situation:
[2023-08-16T10:23:47.287Z] 1.843 
[2023-08-16T10:23:47.287Z] 1.843 The following packages have unmet dependencies:
[2023-08-16T10:23:47.287Z] 1.920  libsystemd-dev : Depends: libsystemd0 (= 247.3-7+deb11u2)
[2023-08-16T10:23:47.287Z] 1.946 E: Unable to correct problems, you have held broken packages.
[2023-08-16T10:23:47.287Z] ------
[2023-08-16T10:23:47.287Z] Dockerfile:29
[2023-08-16T10:23:47.287Z] --------------------
[2023-08-16T10:23:47.287Z]   28 |     # libsystemd-dev
[2023-08-16T10:23:47.287Z]   29 | >>> RUN apt install -y --no-install-recommends --allow-unauthenticated\
[2023-08-16T10:23:47.287Z]   30 | >>>          libsystemd-dev
[2023-08-16T10:23:47.287Z]   31 |     # msitools
[2023-08-16T10:23:47.287Z] --------------------
[2023-08-16T10:23:47.287Z] ERROR: failed to solve: process "/bin/sh -c apt install -y --no-install-recommends --allow-unauthenticated         libsystemd-dev" did not complete successfully: exit code: 100
[2023-08-16T10:23:47.287Z] make[1]: *** [../Makefile.common:17: build] Error 1
[2023-08-16T10:23:47.287Z] make[1]: Leaving directory '/var/lib/jenkins/workspace/build_golang-crossbuild-mbp_main/src/github.com/elastic/golang-crossbuild/go/main'
[2023-08-16T10:23:47.287Z] make: *** [Makefile.debian11:8: build] Error 1
[2023-08-16T10:23:47.287Z] make: Leaving directory '/var/lib/jenkins/workspace/build_golang-crossbuild-mbp_main/src/github.com/elastic/golang-crossbuild/go'
image
@v1v
Copy link
Member Author

v1v commented Aug 21, 2023

Trying to reproduce the error locally by running make -C go -f Makefile.debian11 build but it didn't fail. I'm trying now using the command --no-cache so no caching is used while building those docker images locally.

@v1v
Copy link
Member Author

v1v commented Aug 21, 2023

I even tried to run the generated dockerfile for main and it did not fail locally:

➜  main git:(fix/debian-11-golang2.21) pwd
/Users/vmartinez/work/src/github.com/elastic/golang-crossbuild/go/main
➜  main git:(fix/debian-11-golang2.21) docker build --build-arg REPOSITORY=docker.elastic.co/beats-dev --build-arg VERSION=1.21.0 --build-arg TAG_EXTENSION=-debian11 --tag foo --no-cache . 
[+] Building 182.4s (15/15) FINISHED                                                                                                                                    docker:desktop-linux
 => [internal] load .dockerignore                                                                                                                                                       0.0s
 => => transferring context: 49B                                                                                                                                                        0.0s
 => [internal] load build definition from Dockerfile                                                                                                                                    0.0s
 => => transferring dockerfile: 2.71kB                                                                                                                                                  0.0s
 => [internal] load metadata for docker.elastic.co/beats-dev/golang-crossbuild:1.21.0-base-debian11                                                                                     0.0s
 => CACHED [ 1/10] FROM docker.elastic.co/beats-dev/golang-crossbuild:1.21.0-base-debian11                                                                                              0.0s
 => [internal] load build context                                                                                                                                                       0.0s
 => => transferring context: 107B                                                                                                                                                       0.0s
 => [ 2/10] RUN     dpkg --add-architecture i386     && apt-get -o Acquire::Check-Valid-Until=false update     && apt-get install -qq -y --no-install-recommends --allow-unauthentica  84.6s
 => [ 3/10] RUN apt install -y --no-install-recommends --allow-unauthenticated        librpm-dev         libxml2-dev         libsqlite3-dev                                            19.2s
 => [ 4/10] RUN apt install -y --no-install-recommends --allow-unauthenticated         libsystemd-dev                                                                                   5.2s
 => [ 5/10] RUN apt install -y --no-install-recommends --allow-unauthenticated         msitools                                                                                         4.8s
 => [ 6/10] RUN rm -rf /var/lib/apt/lists/*                                                                                                                                             0.4s
 => [ 7/10] COPY rootfs /                                                                                                                                                               0.0s
 => [ 8/10] RUN cd /   && gcc helloWorld.c -o helloWorld   && file helloWorld   && readelf -h helloWorld   && file helloWorld | cut -d "," -f 2 | grep -c 'x86-64'   && rm helloWorld.  0.6s
 => [ 9/10] RUN cd /libpcap/libpcap-1.8.1   && cp -R /libpcap/libpcap-1.8.1 /libpcap/libpcap-1.8.1-i386   && cp -R /libpcap/libpcap-1.8.1 /libpcap/libpcap-1.8.1-amd64   && cd /libpc  47.4s
 => [10/10] RUN curl -sSLO https://storage.googleapis.com/obs-ci-cache/beats/WpdPack_4_1_2.zip   && mkdir -p /libpcap/win   && echo "ea799cf2f26e4afb1892938070fd2b1ca37ce5cf75fec4349  1.3s
 => exporting to image                                                                                                                                                                 18.7s
 => => exporting layers                                                                                                                                                                18.7s
 => => writing image sha256:f7adf5534fd1b07e7b02d00017f3745166167f87f6917589365e5286ec71d50a                                                                                            0.0s
 => => naming to docker.io/library/foo                                                                                                                                                  0.0s
                                                                                
What's Next?                                                                    
  View summary of image vulnerabilities and recommendations → docker scout quickview

@v1v
Copy link
Member Author

v1v commented Aug 21, 2023

Interestingly it didn't fail for the original PR #310

image

And docker images were generated:

image

I'm inclined to think this is an environmental issue. I'm rerunning the build for the main branch

@v1v
Copy link
Member Author

v1v commented Aug 21, 2023

and now arm fails too:

.154Z]  > [linux/amd64 stage-amd64 5/5] RUN apt install -y         libsystemd-dev:arm64
[2023-08-21T08:30:46.154Z] 1.904   liblz4-1:arm64 libsystemd0:arm64
[2023-08-21T08:30:46.154Z] 1.988 The following packages will be REMOVED:
[2023-08-21T08:30:46.154Z] 1.992   apt bsdutils libapt-pkg6.0 libsystemd0 mount util-linux
[2023-08-21T08:30:46.154Z] 1.994 The following NEW packages will be installed:
[2023-08-21T08:30:46.154Z] 1.995   liblz4-1:arm64 libsystemd-dev:arm64 libsystemd0:arm64
[2023-08-21T08:30:46.154Z] 2.002 WARNING: The following essential packages will be removed.
[2023-08-21T08:30:46.154Z] 2.002 This should NOT be done unless you know exactly what you are doing!
[2023-08-21T08:30:46.154Z] 2.002   apt libapt-pkg6.0 (due to apt) libsystemd0 (due to apt) bsdutils util-linux
[2023-08-21T08:30:46.154Z] 2.023 0 upgraded, 3 newly installed, 6 to remove and 0 not upgraded.
[2023-08-21T08:30:46.154Z] 2.023 E: Essential packages were removed and -y was used without --allow-remove-essential.
[2023-08-21T08:30:46.154Z] ------
[2023-08-21T08:30:46.154Z] Dockerfile:23
[2023-08-21T08:30:46.154Z] --------------------
[2023-08-21T08:30:46.154Z]   22 |     # libsystemd-dev
[2023-08-21T08:30:46.154Z]   23 | >>> RUN apt install -y \
[2023-08-21T08:30:46.154Z]   24 | >>>         libsystemd-dev:arm64
[2023-08-21T08:30:46.154Z]   25 |     

@v1v
Copy link
Member Author

v1v commented Sep 14, 2023

#316 is the one fixing both archs

@pazone
Copy link
Contributor

pazone commented Sep 14, 2023

Fixed in #316

@pazone pazone closed this as completed Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants