Skip to content
This repository has been archived by the owner on Mar 21, 2022. It is now read-only.

Error in using private docker registery: java.lang.ArrayIndexOutOfBoundsException: 255 #362

Closed
huadong opened this issue Dec 3, 2017 · 1 comment

Comments

@huadong
Copy link

huadong commented Dec 3, 2017

Description

[ERROR] Failed to execute goal com.spotify:docker-maven-plugin:1.0.0:build (build-image) on project xxxx: Exception caught: 255 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.spotify:docker-maven-plugin:1.0.0:build (build-image) on project xxxx: Exception caught
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Exception caught
at com.spotify.docker.AbstractDockerMojo.execute(AbstractDockerMojo.java:151)
at com.spotify.docker.BuildMojo.execute(BuildMojo.java:87)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
... 20 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 255
at org.glassfish.jersey.internal.util.Base64.encode(Base64.java:100)
at org.glassfish.jersey.internal.util.Base64.encodeAsString(Base64.java:169)
at org.glassfish.jersey.internal.util.Base64.encodeAsString(Base64.java:185)
at com.spotify.docker.client.DefaultDockerClient.authRegistryHeader(DefaultDockerClient.java:2447)
at com.spotify.docker.client.DefaultDockerClient.build(DefaultDockerClient.java:1379)
at com.spotify.docker.client.DefaultDockerClient.build(DefaultDockerClient.java:1348)
at com.spotify.docker.BuildMojo.buildImage(BuildMojo.java:580)
at com.spotify.docker.BuildMojo.execute(BuildMojo.java:360)
at com.spotify.docker.AbstractDockerMojo.execute(AbstractDockerMojo.java:149)
... 23 more

How to reproduce

  1. login private registery of docker using docker cli
  2. build the image using mvn command

pom.xml

<plugin>
	<groupId>com.spotify</groupId>
	<artifactId>docker-maven-plugin</artifactId>
	<version>1.0.0</version>
	<executions>
		<execution>
			<id>build-image</id>
			<phase>package</phase>
			<goals>
				<goal>build</goal>
			</goals>
		</execution>
	</executions>
	<configuration>
		<imageName>${project.groupId}_${project.artifactId}:${project.version}</imageName>
		<imageTags>
			<imageTag>latest</imageTag>
			<imageTag>${profiles.active}</imageTag>
		</imageTags>
		<dockerDirectory>${project.build.directory}/docker</dockerDirectory>
		<resources>
			<resource>
				<targetPath>/</targetPath>
				<directory>${project.build.directory}</directory>
				<include>${project.build.finalName}.jar</include>
				<include>lib/*</include>
			</resource>
		</resources>
	</configuration>
</plugin>

Software:

  • docker version: 17.10.0-ce, build f4ffd25
  • docker-maven-plugin version: 1.0.0
  • maven version: Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-11T00:41:47+08:00)
    Java version: 1.8.0_51, vendor: Oracle Corporation
    Default locale: en_US, platform encoding: UTF-8
    OS name: "linux", version: "4.13.0-17-generic", arch: "amd64", family: "unix"
@davidxia
Copy link
Contributor

davidxia commented May 22, 2018

fixed by spotify/docker-client#942

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants