I have a project that is using the plugin. The plugin will build a docker image during the install phase and will push to my docker registry on the deploy stage. I am using the option true. My credentials are defined in the settings file.
In normal operation, from my Jenkins box this runs fine - images are build and pushed to my remote docker registry.
When this happens as part of the the release process, I get the following message:
[INFO] [ERROR] unauthorized: Could not find robot with username: ipit+ipitrobot and supplied password
Note: that the username is correctly picked up from the server definitions in settings.xml.
How to reproduce
Build a simple project to create a docker image using the plugin, that uses "useMavenSettingsForAuth"
Configure credentials in settings.xml
Perform a maven release:prepare and release:perform
What do you expect
[Describe what do you expect to happen]
Expected behavior is for the docker image to be uploaded to the remote registry
Actual result: unauthorized error as above, plus exception below
[INFO] [ERROR] unauthorized: Could not find robot with username: ipit+ipitrobot and supplied password.
[INFO] [WARNING] An attempt failed, will retry 1 more times
[INFO] org.apache.maven.plugin.MojoExecutionException: Could not push image
[INFO] at com.spotify.plugin.dockerfile.PushMojo.execute(PushMojo.java:90)
[INFO] at com.spotify.plugin.dockerfile.AbstractDockerMojo.tryExecute(AbstractDockerMojo.java:246)
[INFO] at com.spotify.plugin.dockerfile.AbstractDockerMojo.execute(AbstractDockerMojo.java:235)
[INFO] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
[INFO] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
[INFO] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
[INFO] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
[INFO] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
[INFO] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
[INFO] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
[INFO] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
[INFO] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
[INFO] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
[INFO] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
[INFO] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
[INFO] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
[INFO] at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
[INFO] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[INFO] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[INFO] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[INFO] at java.lang.reflect.Method.invoke(Method.java:498)
[INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
[INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
[INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
[INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[INFO] Caused by: com.spotify.docker.client.exceptions.DockerException: unauthorized: Could not find robot with username: ipit+ipitrobot and supplied password.
[INFO] at com.spotify.plugin.dockerfile.LoggingProgressHandler.handleError(LoggingProgressHandler.java:105)
[INFO] at com.spotify.plugin.dockerfile.LoggingProgressHandler.progress(LoggingProgressHandler.java:63)
[INFO] at com.spotify.docker.client.ProgressStream.tail(ProgressStream.java:74)
[INFO] at com.spotify.docker.client.DefaultDockerClient.push(DefaultDockerClient.java:1291)
[INFO] at com.spotify.docker.client.DefaultDockerClient.push(DefaultDockerClient.java:1271)
[INFO] at com.spotify.plugin.dockerfile.PushMojo.execute(PushMojo.java:88)
[INFO] ... 24 more
Software:
docker version: [17.05.0-ce - client and server]
docker-maven-plugin version: [1.3.7]
maven version: [17.05.0-ce]
Full backtrace
[INFO] [ERROR] unauthorized: Could not find robot with username: ipit+ipitrobot and supplied password.
[INFO] [WARNING] An attempt failed, will retry 1 more times
[INFO] org.apache.maven.plugin.MojoExecutionException: Could not push image
[INFO] at com.spotify.plugin.dockerfile.PushMojo.execute(PushMojo.java:90)
[INFO] at com.spotify.plugin.dockerfile.AbstractDockerMojo.tryExecute(AbstractDockerMojo.java:246)
[INFO] at com.spotify.plugin.dockerfile.AbstractDockerMojo.execute(AbstractDockerMojo.java:235)
[INFO] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
[INFO] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
[INFO] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
[INFO] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
[INFO] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
[INFO] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
[INFO] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
[INFO] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
[INFO] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
[INFO] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
[INFO] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
[INFO] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
[INFO] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
[INFO] at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
[INFO] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[INFO] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[INFO] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[INFO] at java.lang.reflect.Method.invoke(Method.java:498)
[INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
[INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
[INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
[INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[INFO] Caused by: com.spotify.docker.client.exceptions.DockerException: unauthorized: Could not find robot with username: ipit+ipitrobot and supplied password.
[INFO] at com.spotify.plugin.dockerfile.LoggingProgressHandler.handleError(LoggingProgressHandler.java:105)
[INFO] at com.spotify.plugin.dockerfile.LoggingProgressHandler.progress(LoggingProgressHandler.java:63)
[INFO] at com.spotify.docker.client.ProgressStream.tail(ProgressStream.java:74)
[INFO] at com.spotify.docker.client.DefaultDockerClient.push(DefaultDockerClient.java:1291)
[INFO] at com.spotify.docker.client.DefaultDockerClient.push(DefaultDockerClient.java:1271)
[INFO] at com.spotify.plugin.dockerfile.PushMojo.execute(PushMojo.java:88)
[INFO] ... 24 more
I had a similar problem and found that if I put a clear text password (not ideal) in the settings.xml it worked, but if I use an encrypted password (mvn --encrypt-password), then if fails.
Description
I have a project that is using the plugin. The plugin will build a docker image during the install phase and will push to my docker registry on the deploy stage. I am using the optiontrue . My credentials are defined in the settings file.
In normal operation, from my Jenkins box this runs fine - images are build and pushed to my remote docker registry.
When this happens as part of the the release process, I get the following message: [INFO] [ERROR] unauthorized: Could not find robot with username: ipit+ipitrobot and supplied password
Note: that the username is correctly picked up from the server definitions in settings.xml.
How to reproduce
Build a simple project to create a docker image using the plugin, that uses "useMavenSettingsForAuth" Configure credentials in settings.xml
Perform a maven release:prepare and release:perform
What do you expect
[Describe what do you expect to happen]
Expected behavior is for the docker image to be uploaded to the remote registry
Actual result: unauthorized error as above, plus exception below [INFO] [ERROR] unauthorized: Could not find robot with username: ipit+ipitrobot and supplied password. [INFO] [WARNING] An attempt failed, will retry 1 more times [INFO] org.apache.maven.plugin.MojoExecutionException: Could not push image [INFO] at com.spotify.plugin.dockerfile.PushMojo.execute(PushMojo.java:90) [INFO] at com.spotify.plugin.dockerfile.AbstractDockerMojo.tryExecute(AbstractDockerMojo.java:246) [INFO] at com.spotify.plugin.dockerfile.AbstractDockerMojo.execute(AbstractDockerMojo.java:235) [INFO] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) [INFO] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207) [INFO] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) [INFO] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) [INFO] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116) [INFO] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) [INFO] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) [INFO] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) [INFO] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307) [INFO] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) [INFO] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) [INFO] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863) [INFO] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288) [INFO] at org.apache.maven.cli.MavenCli.main(MavenCli.java:199) [INFO] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [INFO] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [INFO] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [INFO] at java.lang.reflect.Method.invoke(Method.java:498) [INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) [INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) [INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) [INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) [INFO] Caused by: com.spotify.docker.client.exceptions.DockerException: unauthorized: Could not find robot with username: ipit+ipitrobot and supplied password. [INFO] at com.spotify.plugin.dockerfile.LoggingProgressHandler.handleError(LoggingProgressHandler.java:105) [INFO] at com.spotify.plugin.dockerfile.LoggingProgressHandler.progress(LoggingProgressHandler.java:63) [INFO] at com.spotify.docker.client.ProgressStream.tail(ProgressStream.java:74) [INFO] at com.spotify.docker.client.DefaultDockerClient.push(DefaultDockerClient.java:1291) [INFO] at com.spotify.docker.client.DefaultDockerClient.push(DefaultDockerClient.java:1271) [INFO] at com.spotify.plugin.dockerfile.PushMojo.execute(PushMojo.java:88) [INFO] ... 24 more
Software:
Full backtrace