jib icon indicating copy to clipboard operation
jib copied to clipboard

No progress after "Container entrypoint set to" with jib-maven-plugin 3.4.3

Open LeovR opened this issue 1 year ago • 5 comments

Environment:

  • Jib version: 3.4.3
  • Build tool: Maven 3.9.6
  • OS: Windows 10

Description of the issue: After upgrading to jib-maven-plugin 3.4.3 the progress stops after "Container entrypoint set to". With jib-maven-plugin 3.4.2 the build succeeds.

Expected behavior: The build succeeds.

Steps to reproduce:

  1. skaffold run

jib-maven-plugin Configuration:

            <plugin>
                <groupId>com.google.cloud.tools</groupId>
                <artifactId>jib-maven-plugin</artifactId>
                <version>3.4.3</version>
                <configuration>
                    <skip>false</skip>
                    <containerizingMode>packaged</containerizingMode>
                    <container>
                        <creationTime>USE_CURRENT_TIMESTAMP</creationTime>
                        <mainClass>${start-class}</mainClass>
                    </container>
                    <from>
                        <image>eclipse-temurin:21</image>
                    </from>
                    <to>
                        <image>${docker-registry}/application</image>
                        <tags>
                            <tag>${project.version}</tag>
                            <tag>latest</tag>
                            <tag>${env.CI_COMMIT_SHA}</tag>
                        </tags>
                    </to>
                    <allowInsecureRegistries>true</allowInsecureRegistries>
                </configuration>
                <executions>
                    <execution>
                        <phase>deploy</phase>
                        <goals>
                            <goal>build</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

Log output:

[DEBUG] TIMING	Pulling base image manifest
[INFO] Getting manifest for base image eclipse-temurin:21...
[DEBUG] TIMING	trying mirrors
[DEBUG] TIMED	trying mirrors : 0.0 ms
[DEBUG] TIMING	Preparing application layer builders
[DEBUG] TIMED	Preparing application layer builders : 12.164 ms
[INFO] Building dependencies layer...
[INFO] Building project dependencies layer...
[INFO] Building extra files layer...
[DEBUG] TIMING	Building dependencies layer
[DEBUG] TIMING	Building project dependencies layer
[INFO] Building jvm arg files layer...
[DEBUG] TIMING	Building extra files layer
[DEBUG] TIMING	Building jvm arg files layer
[DEBUG] TIMED	Building jvm arg files layer : 46.44 ms
[DEBUG] TIMED	Building project dependencies layer : 46.752 ms
[DEBUG] TIMED	Building dependencies layer : 60.951 ms
[DEBUG] Building extra files layer built sha256:dfff3e035b17cc725566e639f61f51e44e1bdd662d7a8f6b4c6e55f07ef92d29
[DEBUG] TIMED	Building extra files layer : 107.42 ms
[INFO] Using base image with digest: sha256:ac1545309de7e27001a80d91df2d42865c0bacaec75e016cb4482255d7691187
[DEBUG] Searching for architecture=amd64, os=linux in the base image manifest list
[DEBUG] TIMED	Pulling base image manifest : 1069.014 ms
[DEBUG] TIMING	Pulling base image layer sha256:1ae78fb28ee8ad64497b830c9c46950ab9448341cbdb14f4710d143671487c61
[DEBUG] TIMING	Pulling base image layer sha256:e071b974f417bebf03dcba8690670bce9d7d83d647b1775d42f720b2813da09d
[DEBUG] TIMING	Pulling base image layer sha256:2ec76a50fe7c8d5db9ec25590b9217e14e3920513c6e7b5be55db72a16b55f7c
[DEBUG] TIMING	Pulling base image layer sha256:3c930bd25dd53355206fb22462e8fbde127b1d43483ca67962d2bf2bb4a534c0
[DEBUG] TIMING	Pulling base image layer sha256:eb2b2709c988772d4f722fa842b200b424f5873a64a9b4c5cfaeb86a6293a3b1
[DEBUG] TIMED	Pulling base image layer sha256:eb2b2709c988772d4f722fa842b200b424f5873a64a9b4c5cfaeb86a6293a3b1 : 0.684 ms
[DEBUG] TIMED	Pulling base image layer sha256:3c930bd25dd53355206fb22462e8fbde127b1d43483ca67962d2bf2bb4a534c0 : 1.226 ms
[DEBUG] TIMED	Pulling base image layer sha256:e071b974f417bebf03dcba8690670bce9d7d83d647b1775d42f720b2813da09d : 1.226 ms
[DEBUG] TIMED	Pulling base image layer sha256:2ec76a50fe7c8d5db9ec25590b9217e14e3920513c6e7b5be55db72a16b55f7c : 1.226 ms
[DEBUG] TIMED	Pulling base image layer sha256:1ae78fb28ee8ad64497b830c9c46950ab9448341cbdb14f4710d143671487c61 : 1.226 ms
[DEBUG] TIMING	Building container configuration
[INFO] 
[INFO] Container entrypoint set to [java, -cp, @/app/jib-classpath-file, com.example.Application]
[DEBUG] TIMED	Building container configuration : 1.0 ms

The output for jib-maven-plugin 3.4.2

[DEBUG] TIMING	Pulling base image manifest
[INFO] Getting manifest for base image eclipse-temurin:21...
[DEBUG] TIMING	trying mirrors
[DEBUG] TIMED	trying mirrors : 0.0 ms
[DEBUG] TIMING	Preparing application layer builders
[DEBUG] TIMED	Preparing application layer builders : 11.583 ms
[INFO] Building dependencies layer...
[INFO] Building project dependencies layer...
[DEBUG] TIMING	Building dependencies layer
[DEBUG] TIMING	Building project dependencies layer
[INFO] Building extra files layer...
[DEBUG] TIMING	Building extra files layer
[INFO] Building jvm arg files layer...
[DEBUG] TIMING	Building jvm arg files layer
[DEBUG] TIMED	Building jvm arg files layer : 51.587 ms
[DEBUG] TIMED	Building dependencies layer : 66.647 ms
[DEBUG] TIMED	Building project dependencies layer : 67.966 ms
[DEBUG] Building extra files layer built sha256:dfff3e035b17cc725566e639f61f51e44e1bdd662d7a8f6b4c6e55f07ef92d29
[DEBUG] TIMED	Building extra files layer : 105.634 ms
[INFO] Using base image with digest: sha256:ac1545309de7e27001a80d91df2d42865c0bacaec75e016cb4482255d7691187
[DEBUG] Searching for architecture=amd64, os=linux in the base image manifest list
[DEBUG] TIMED	Pulling base image manifest : 876.057 ms
[DEBUG] TIMING	Pulling base image layer sha256:3c930bd25dd53355206fb22462e8fbde127b1d43483ca67962d2bf2bb4a534c0
[DEBUG] TIMING	Pulling base image layer sha256:2ec76a50fe7c8d5db9ec25590b9217e14e3920513c6e7b5be55db72a16b55f7c
[DEBUG] TIMING	Pulling base image layer sha256:e071b974f417bebf03dcba8690670bce9d7d83d647b1775d42f720b2813da09d
[DEBUG] TIMING	Pulling base image layer sha256:1ae78fb28ee8ad64497b830c9c46950ab9448341cbdb14f4710d143671487c61
[DEBUG] TIMING	Pulling base image layer sha256:eb2b2709c988772d4f722fa842b200b424f5873a64a9b4c5cfaeb86a6293a3b1
[DEBUG] TIMED	Pulling base image layer sha256:1ae78fb28ee8ad64497b830c9c46950ab9448341cbdb14f4710d143671487c61 : 0.53 ms
[DEBUG] TIMED	Pulling base image layer sha256:eb2b2709c988772d4f722fa842b200b424f5873a64a9b4c5cfaeb86a6293a3b1 : 0.53 ms
[DEBUG] TIMED	Pulling base image layer sha256:3c930bd25dd53355206fb22462e8fbde127b1d43483ca67962d2bf2bb4a534c0 : 0.53 ms
[DEBUG] TIMED	Pulling base image layer sha256:2ec76a50fe7c8d5db9ec25590b9217e14e3920513c6e7b5be55db72a16b55f7c : 0.53 ms
[DEBUG] TIMED	Pulling base image layer sha256:e071b974f417bebf03dcba8690670bce9d7d83d647b1775d42f720b2813da09d : 0.53 ms
[DEBUG] TIMING	Building container configuration
[INFO] 
[INFO] Container entrypoint set to [java, -cp, @/app/jib-classpath-file, com.example.Application]
[DEBUG] TIMED	Building container configuration : 1.002 ms
[DEBUG] TIMING	Loading to Docker daemon
[INFO] Loading to Docker daemon...
[DEBUG] Loaded image: xxx:20240605-3829.598137-2-gfa19a177-dirty
The image xxx:local already exists, renaming the old one with ID sha256:cccec99bcdeeaf6a5f7c958a62761ec9a62f75c60fa6947a5df08e7548344317 to empty string
Loaded image: xxx:local

[DEBUG] TIMED	Loading to Docker daemon : 13144.805 ms
[DEBUG] TIMED	Building image to Docker daemon : 14055.52 ms
[INFO] 
[INFO] Built image to Docker daemon as ...

Additional Information:

The build is triggered by skaffold with additional parameter -Djib.to.tags=local.

LeovR avatar Jun 06 '24 06:06 LeovR

We are facing the same problem when upgrading to jib-maven-plugin 3.4.3.

It seems to be a Windows-only problem (it works correctly when running the command in WSL2/Ubuntu)

Staying on 3.4.2 for now.

beskow avatar Jun 14 '24 07:06 beskow

Breaking change is addition of the following line. https://github.com/GoogleContainerTools/jib/blob/ec44330c1adbd0e1538fe01ffaa51b8233432635/jib-core/src/main/java/com/google/cloud/tools/jib/builder/steps/StepsRunner.java#L624

This line blocks until docker info -f "{{json .}}" process exits to start reading the inputStream. On windows, it only exits after inputStream is read, resulting in deadlock. https://github.com/GoogleContainerTools/jib/blob/ec44330c1adbd0e1538fe01ffaa51b8233432635/jib-core/src/main/java/com/google/cloud/tools/jib/docker/CliDockerClient.java#L192

Can be reproduced on windows with following code. Only occurs with -f option.

Process process = new ProcessBuilder("docker", "info", "-f", "json").start();
process.waitFor();

bamanuel1 avatar Jun 21 '24 21:06 bamanuel1

@mpeddada1 this I believe was introduced in 3.4.3 and looks to be an important regression issue to fix before making the next release.

chanseokoh avatar Jun 27 '24 14:06 chanseokoh

@chanseokoh Assigned this to myself. @beskow My initial hypothesis was that this may have been caused due to some unconventional log warnings we added but this is really helpful information (https://github.com/GoogleContainerTools/jib/issues/4267#issuecomment-2183474967)

This line blocks until docker info -f "{{json .}}" process exits to start reading the inputStream. On windows, it only exits after inputStream is read, resulting in deadlock.

mpeddada1 avatar Jun 27 '24 15:06 mpeddada1

We encountered this issue as well. Seems to be working on linux but hanging on windows.

Doing a breakpoint on line 191 in CliDockerClient and calling waitFor() hangs on windows. If you call getInputStream() without calling waitFor() before it, it works as expected.

Downgraded to 3.4.2 in the meantime.

Chris-Frendo avatar Jul 01 '24 17:07 Chris-Frendo

jib-maven-plugin 3.4.4 has been released (https://github.com/GoogleContainerTools/jib/releases) to address https://github.com/GoogleContainerTools/jib/issues/4265 and https://github.com/GoogleContainerTools/jib/issues/4265. Please let us know if you're running into any further issues!

mpeddada1 avatar Oct 29 '24 20:10 mpeddada1

@mpeddada1 We are encountering this issue still. It is hanging on windows.

[INFO] Container entrypoint set to [java,....

Downgraded to 3.4.2 solve the issue.

awbit avatar Oct 31 '24 12:10 awbit

@awbit I can confirm that it is still not working for me with jib-maven-plugin 3.4.4 @mpeddada1 can you reopen this ticket?

LeovR avatar Nov 04 '24 06:11 LeovR

+1, It still hanging on Windows when execute gradle jibDockerBuild command

rxxy avatar Dec 05 '24 06:12 rxxy

It doesn't work for us on Windows either. However, it works if we run the command in WSL.

matejbizjak avatar Jan 08 '25 09:01 matejbizjak

Re-opening will try to prioritize, in the meantime if anyone in the community has a fix we would welcome a community contribution for this one!

ldetmer avatar Jan 23 '25 20:01 ldetmer

@ldetmer I proposed a solution via PR #4351

LeovR avatar Feb 08 '25 21:02 LeovR

@ldetmer @mpeddada1 It would be really appreciated if we could fix this.

HerrDerb avatar Feb 20 '25 07:02 HerrDerb

thank you for the fix @LeovR this should be resolved in jib-maven-plugin 3.4.5

ldetmer avatar Mar 20 '25 17:03 ldetmer

It looks like Quarkus 22.3 is already using this version. Unfortunately the problem still persists: https://github.com/quarkusio/quarkus/issues/47959 A fix for windows would be great..

stefan2503 avatar May 20 '25 12:05 stefan2503