Skip to content

build-image fails sometimes with ArrayIndexOutOfBoundsException #29307

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

Closed
nils-christian opened this issue Jan 11, 2022 · 10 comments
Closed

build-image fails sometimes with ArrayIndexOutOfBoundsException #29307

nils-christian opened this issue Jan 11, 2022 · 10 comments

Comments

@nils-christian
Copy link

Hi,

We are experiencing an ArrayIndexOutOfBoundsException in some very rare cases while building our image with the spring-boot-maven-plugin. We are using Spring Boot 2.4.6. Unfortunately we cannot provide an example project, because the error cannot be reproduced. It happens in something like 1 of 50 builds. Can we somehow do something for a better analysis? Is there a possible root cause?

Best regards

Nils

10:05:11  org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.4.6:build-image (default) on project XYZ: Execution default of goal org.springframework.boot:spring-boot-maven-plugin:2.4.6:build-image failed: Index 3 out of bounds for length 3
10:05:11      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
10:05:11      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
10:05:11      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
10:05:11      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
10:05:11      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
10:05:11      at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
10:05:11      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
10:05:11      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
10:05:11      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
10:05:11      at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
10:05:11      at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
10:05:11      at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
10:05:11      at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
10:05:11      at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
10:05:11      at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
10:05:11      at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
10:05:11      at java.lang.reflect.Method.invoke (Method.java:566)
10:05:11      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
10:05:11      at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
10:05:11      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
10:05:11      at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
10:05:11  Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default of goal org.springframework.boot:spring-boot-maven-plugin:2.4.6:build-image failed: Index 3 out of bounds for length 3
10:05:11      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:148)
10:05:11      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
10:05:11      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
10:05:11      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
10:05:11      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
10:05:11      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
10:05:11      at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
10:05:11      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
10:05:11      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
10:05:11      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
10:05:11      at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
10:05:11      at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
10:05:11      at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
10:05:11      at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
10:05:11      at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
10:05:11      at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
10:05:11      at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
10:05:11      at java.lang.reflect.Method.invoke (Method.java:566)
10:05:11      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
10:05:11      at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
10:05:11      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
10:05:11      at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
10:05:11  Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 3 out of bounds for length 3
10:05:11      at org.springframework.boot.buildpack.platform.****.LogUpdateEvent.read (LogUpdateEvent.java:93)
10:05:11      at org.springframework.boot.buildpack.platform.****.LogUpdateEvent.readAll (LogUpdateEvent.java:79)
10:05:11      at org.springframework.boot.buildpack.platform.****.DockerApi$ContainerApi.logs (DockerApi.java:338)
10:05:11      at org.springframework.boot.buildpack.platform.build.Lifecycle.run (Lifecycle.java:163)
10:05:11      at org.springframework.boot.buildpack.platform.build.Lifecycle.execute (Lifecycle.java:119)
10:05:11      at org.springframework.boot.buildpack.platform.build.Builder.executeLifecycle (Builder.java:193)
10:05:11      at org.springframework.boot.buildpack.platform.build.Builder.build (Builder.java:103)
10:05:11      at org.springframework.boot.maven.BuildImageMojo.buildImage (BuildImageMojo.java:222)
10:05:11      at org.springframework.boot.maven.BuildImageMojo.execute (BuildImageMojo.java:212)
10:05:11      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
10:05:11      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
10:05:11      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
10:05:11      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
10:05:11      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
10:05:11      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
10:05:11      at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
10:05:11      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
10:05:11      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
10:05:11      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
10:05:11      at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
10:05:11      at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
10:05:11      at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
10:05:11      at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
10:05:11      at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
10:05:11      at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
10:05:11      at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
10:05:11      at java.lang.reflect.Method.invoke (Method.java:566)
10:05:11      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
10:05:11      at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
10:05:11      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
10:05:11      at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 11, 2022
@philwebb
Copy link
Member

From the stacktrace it looks like this is in the low level code that reads Docker log messages. It looks like we're reading an incorrect stream type value somehow. It's going to be hard to replicate, but we can at least guard against the failure and continue.

@nils-christian Do the logs look correct on failed builds?

@philwebb philwebb added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Jan 11, 2022
@philwebb philwebb added this to the 2.5.x milestone Jan 11, 2022
@snicoll snicoll added the status: waiting-for-feedback We need additional information before we can continue label Jan 11, 2022
@scottfrederick
Copy link
Contributor

@nils-christian Can you provide any additional details about the environment the image build runs in, like the operating system, whether you are using Docker Engine or another Docker daemon, etc?

@nils-christian
Copy link
Author

Hi @philwebb,

Currently we do not save the log files. We changed that so that we can check them the next time the issue occures.

Best regards,

Nils

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Jan 17, 2022
@snicoll snicoll added status: waiting-for-feedback We need additional information before we can continue and removed status: feedback-provided Feedback has been provided labels Jan 17, 2022
@gutschet
Copy link

Hello @scottfrederick,
Here some details about the environment:

  • build is running in a jenkins agent in docker container in a kubernetes cluster
  • build agent container base image is debian (:buster and :bullseye both show the error)
  • maven 3.6.3
  • openjdk 11.0.9.1
  • kubernetes cluster version 1.20.4
  • docker engine on the nodes 20.10.5
  • operating system of clusternodes is debian buster

If you need any more information, please feel free to ask.

Best regards
Timo

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Jan 17, 2022
@scottfrederick
Copy link
Contributor

@gutschet Thanks for the additional info. I was curious if you were running something other than Docker Engine, or an older Docker Engine, or something else that might cause the daemon to give responses that are different from what we see in our testing. Docker Engine 20.10.5 is close to what we use, so that's not likely to be part of the root cause. As @philwebb said, this is difficult for us to reproduce to come up with a fix. If it is possible to provide logs as @nils-christian stated above that would be helpful.

@scottfrederick scottfrederick added status: waiting-for-feedback We need additional information before we can continue and removed status: feedback-provided Feedback has been provided labels Jan 21, 2022
@spring-projects-issues
Copy link
Collaborator

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

@spring-projects-issues spring-projects-issues added the status: feedback-reminder We've sent a reminder that we need additional information before we can continue label Jan 28, 2022
@spring-projects-issues
Copy link
Collaborator

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

@spring-projects-issues spring-projects-issues removed status: waiting-for-feedback We need additional information before we can continue status: feedback-reminder We've sent a reminder that we need additional information before we can continue labels Feb 4, 2022
@philwebb philwebb reopened this Feb 5, 2022
@philwebb
Copy link
Member

philwebb commented Feb 5, 2022

Reopening because even without the sample it’s probably worth guarding against the exception.

@mhalbritter
Copy link
Contributor

I submitted a PR which ignores events with an invalid stream type: #29675

@philwebb
Copy link
Member

philwebb commented Feb 8, 2022

Thanks @mhalbritter. Closing in favor of PR #29675

@philwebb philwebb closed this as completed Feb 8, 2022
@philwebb philwebb removed the type: bug A general bug label Feb 8, 2022
@philwebb philwebb removed this from the 2.5.x milestone Feb 8, 2022
mhalbritter added a commit to mhalbritter/spring-boot that referenced this issue Feb 9, 2022
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

No branches or pull requests

7 participants