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

mvn docker:push fails for me, but mvn docker:build and docker push works #33

Closed
jstrachan opened this issue Oct 10, 2014 · 11 comments
Closed
Milestone

Comments

@jstrachan
Copy link
Contributor

So I can totally do this...
http://fabric8.io/v2/mavenPlugin.html#example

mvn clean install docker:build
docker push $DOCKER_REGISTRY/mydemo/war-camel-servlet:2.0.0-SNAPSHOT

(or I can type docker push XXX and just copy/paste the image name from the output of the "mvn docker:build) and that works too.

but if I try "docker:push") I always get a failure:

mvn clean install docker:push -X
[ERROR] Failed to execute goal org.jolokia:docker-maven-plugin:0.9.10-SNAPSHOT:push (default-cli) on project fabric8-mq: Error while pushing image 'dockerhost:5000/fabric8/fabric8-mq:2.0.0-SNAPSHOT' (code: 500, Internal Server Error) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.jolokia:docker-maven-plugin:0.9.10-SNAPSHOT:push (default-cli) on project fabric8-mq: Error while pushing image 'dockerhost:5000/fabric8/fabric8-mq:2.0.0-SNAPSHOT' (code: 500, Internal Server Error)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
    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:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    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: Error while pushing image 'dockerhost:5000/fabric8/fabric8-mq:2.0.0-SNAPSHOT' (code: 500, Internal Server Error)
    at org.jolokia.docker.maven.AbstractDockerMojo.execute(AbstractDockerMojo.java:84)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    ... 19 more
Caused by: org.apache.maven.plugin.MojoExecutionException: Error while pushing image 'dockerhost:5000/fabric8/fabric8-mq:2.0.0-SNAPSHOT' (code: 500, Internal Server Error)
    at org.jolokia.docker.maven.access.DockerAccessUnirest.processChunkedResponse(DockerAccessUnirest.java:503)
    at org.jolokia.docker.maven.access.DockerAccessUnirest.processPullOrPushResponse(DockerAccessUnirest.java:423)
    at org.jolokia.docker.maven.access.DockerAccessUnirest.pullOrPushImage(DockerAccessUnirest.java:240)
    at org.jolokia.docker.maven.access.DockerAccessUnirest.pushImage(DockerAccessUnirest.java:227)
    at org.jolokia.docker.maven.PushMojo.executeInternal(PushMojo.java:23)
    at org.jolokia.docker.maven.AbstractDockerMojo.execute(AbstractDockerMojo.java:82)
    ... 21 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]

I've not had chance to delve into whats wrong though

@rhuss
Copy link
Collaborator

rhuss commented Oct 10, 2014

Frankly, never tried it yet with a private registry and user repository (i.e. with a second slash in the repository name). There could be dragons, indeed.

'will have to setup a private registry, might take a bit.

@wouterd
Copy link

wouterd commented Oct 20, 2014

Roland, check the integration test of my plugin, it uses a private registry as a docker container.

@rhuss
Copy link
Collaborator

rhuss commented Oct 20, 2014

thx, will check it ASAP. 'will have to write some documentation for my new config syntax first (and finally pump up the test coverage ...). But still might take a bit since I have some conference talks to do, too. Positive stress ;-)

BTW, I setup some sort of 'shootout' (in a funny sense ;-) of docker-maven-plugins at rhuss/shootout-docker-maven with a simple microservice accessing porstgres. README is still missing but the pom.xml contains quit some comments and mentions some quirks.

Feel free to correct me or send updates via PRs, I will apply them promptly.

@rhuss
Copy link
Collaborator

rhuss commented Nov 2, 2014

I merged in PR #40 which should fix that one. You have to specify the full name (including registry) as image name, though.

I will soon add the possibility to configure a registry alternatively (which then will do the local tagging transparently), either per build config, in the global config or with a environment variable.

@rhuss rhuss added this to the 0.10.6 milestone Dec 5, 2014
@rhuss
Copy link
Collaborator

rhuss commented Mar 1, 2015

There has been quite some enhancements for private registry handling recently. Does pushing to a private registry works for you with version 0.11.2 ?

@rhuss rhuss removed this from the 0.11.0 milestone Mar 1, 2015
@osigida
Copy link
Contributor

osigida commented Mar 17, 2015

Hi Roland,
I'm using version 0.11.2 and the problem is still there
stack trace:

[ERROR] Failed to execute goal org.jolokia:docker-maven-plugin:0.11.2:push (default-cli) on project schedule-dropwizard: Unable to push image [registry.lgi.io:8080/schedule-dropwizard] to registry [registry.lgi.io:8080] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.jolokia:docker-maven-plugin:0.11.2:push (default-cli) on project schedule-dropwizard: Unable to push image [registry.lgi.io:8080/schedule-dropwizard] to registry [registry.lgi.io:8080]
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
    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:120)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
    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:483)
    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: Unable to push image [registry.lgi.io:8080/schedule-dropwizard] to registry [registry.lgi.io:8080]
    at org.jolokia.docker.maven.AbstractDockerMojo.execute(AbstractDockerMojo.java:127)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    ... 19 more
Caused by: org.jolokia.docker.maven.access.DockerAccessException: Unable to push image [registry.lgi.io:8080/schedule-dropwizard] to registry [registry.lgi.io:8080]
    at org.jolokia.docker.maven.access.DockerAccessWithHttpClient.pushImage(DockerAccessWithHttpClient.java:218)
    at org.jolokia.docker.maven.PushMojo.executeInternal(PushMojo.java:30)
    at org.jolokia.docker.maven.AbstractDockerMojo.execute(AbstractDockerMojo.java:125)
    ... 21 more

@jgangemi
Copy link
Collaborator

do you have an empty authConfig block in your configuration even if your registry doesn't require actual authentication? eg:

<authConfig>
  <username></username>
  <password></password>
</authConfig>

@osigida
Copy link
Contributor

osigida commented Mar 17, 2015

With empty authConfig works.
Anyway this looks a bit dirty, if property are not specified plugging should treat them as empty and do not try to use username and password.

@rhuss
Copy link
Collaborator

rhuss commented Mar 17, 2015

Indeed, will check this for the next version. Thanks ...

@rhuss rhuss modified the milestones: 0.12.0, 0.11.3 Mar 17, 2015
@jgangemi
Copy link
Collaborator

yeah - i think this is some requirement of the docker registry where the X-Auth-Header needs to be there w/ an encode value even if those values are empty. see #102.

@rhuss
Copy link
Collaborator

rhuss commented Mar 28, 2015

This will be fixed when #102 is fixed. Closing that one.

@rhuss rhuss closed this as completed Mar 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants