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

Pushing the Docker image using FMP gives access denied #4

Closed
arun-gupta opened this issue Feb 13, 2018 · 25 comments
Closed

Pushing the Docker image using FMP gives access denied #4

arun-gupta opened this issue Feb 13, 2018 · 25 comments
Labels
bug Something isn't working maven
Milestone

Comments

@arun-gupta
Copy link
Contributor

Pushing the Docker image using FMP gives the following error:

services $ mvn fabric8:push -Pdocker
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] services
[INFO] name
[INFO] greeting
[INFO] webapp
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Building services 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- fabric8-maven-plugin:3.5.34:push (default-cli) @ services ---
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Building name 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- fabric8-maven-plugin:3.5.34:push (default-cli) @ name --
[INFO] F8> Running generator wildfly-swarm
[INFO] F8> wildfly-swarm: Using Docker image fabric8/java-jboss-openjdk8-jdk:1.3 as base / builder
[INFO] F8> The push refers to repository [docker.io/arungupta/name]
0e014839ff57: Preparing   
f14ef5f204ff: Preparing   
85bb608219b7: Preparing   
160c15b8811e: Preparing   
498396e67e5c: Preparing   
2e544e952df4: Waiting     
e07090bc1b2d: Waiting     
c8af1cb1c035: Waiting     
64062a6d7af2: Waiting     
dfb51d70f8af: Waiting     
56939e74679c: Waiting     
d1be66a59bc5: Waiting     
[ERROR] F8> Unable to push 'arungupta/name' : denied: requested access to the resource is denied  [denied: requested access to the resource is denied ]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] services ........................................... SUCCESS [  3.287 s]
[INFO] name ............................................... FAILURE [  1.382 s]
[INFO] greeting ........................................... SKIPPED
[INFO] webapp ............................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.026 s
[INFO] Finished at: 2018-02-13T15:22:44-08:00
[INFO] Final Memory: 35M/415M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.fabric8:fabric8-maven-plugin:3.5.34:push (default-cli) on project name: Unable to push 'arungupta/name' : denied: requested access to the resource is denied  -> [Help 1]

Pushing the image using Docker CLI works fine.

@arun-gupta arun-gupta added bug Something isn't working maven labels Feb 14, 2018
@ALRubinger
Copy link

@arun-gupta Help me with some env config so I can replicate this? Seeing:

$ mvn fabric8:push -Pdocker
...
[ERROR] Failed to execute goal io.fabric8:fabric8-maven-plugin:3.5.34:push (default-cli) on project services: Execution default-cli of goal io.fabric8:fabric8-maven-plugin:3.5.34:push failed: No <dockerHost> given, no DOCKER_HOST environment variable, no read/writable '/var/run/docker.sock' or '//./pipe/docker_engine' and no external provider like Docker machine configured -> [Help 1]

@arun-gupta
Copy link
Contributor Author

Seems like you don't have Docker running in your environment?

Make sure Docker is running using one of the methods explained at https://store.docker.com/search?type=edition&offering=community. This is how FMP identifies the Docker host.

@ALRubinger
Copy link

@arun-gupta Nevermind; had just resetup Docker and forgot to add the group and permissions so I don't need to run as sudo. Now replicated as you've got:

[ERROR] Failed to execute goal io.fabric8:fabric8-maven-plugin:3.5.34:push (default-cli) on project name: Unable to push 'arungupta/name' : An image does not exist locally with the tag: arungupta/name  -> [Help 1]

Investigating; thanks.

@ALRubinger
Copy link

Charting further progressing and now at the point where I've replicated Arun's same error:

[INFO] F8> Running generator wildfly-swarm
[INFO] F8> wildfly-swarm: Using Docker image fabric8/java-jboss-openjdk8-jdk:1.3 as base / builder
[INFO] F8> The push refers to repository [docker.io/arungupta/name]
b18fc48878d6: Preparing   
f14ef5f204ff: Preparing   
85bb608219b7: Preparing   
160c15b8811e: Preparing   
498396e67e5c: Preparing   
2e544e952df4: Waiting     
e07090bc1b2d: Waiting     
c8af1cb1c035: Waiting     
64062a6d7af2: Waiting     
dfb51d70f8af: Waiting     
56939e74679c: Waiting     
d1be66a59bc5: Waiting     
[ERROR] F8> Unable to push 'arungupta/name' : denied: requested access to the resource is denied  [denied: requested access to the resource is denied ]

What's required is running the steps 1) and 2) under Docker Images here: https://github.com/aws-samples/aws-compute-options and then running mvn fabric8:push -Pdocker instead of the 3) workaround noted

@ALRubinger
Copy link

@arun-gupta So I'm understanding the problem correctly, wouldn't I expect access denied here because I should instead be pushing to alrubinger/name, on Docker Hub from the retagged image in my local repo?

https://stackoverflow.com/questions/41984399/denied-requested-access-to-the-resource-is-denied-docker

I'm currently not seeing the option to specify the namespace in https://maven.fabric8.io/#fabric8:push; does this correctly summarize the root cause, do you believe?

@ALRubinger
Copy link

ALRubinger commented Feb 15, 2018

Hm, even when changing docker.repo:

F8> Unable to push 'alrubinger/name' : denied: requested access to the resource is denied  [denied: requested access to the resource is denied ]

@ALRubinger
Copy link

OK, @arun-gupta : I got this passing by first docker login, then running mvn fabric8:push -Pdocker with docker.repo set to my own namespace.

Is this a valid workaround for you to use FMP - assuming you docker login first?

@kenfinnigan
Copy link
Contributor

Thanks for diving into this @ALRubinger, really appreciated

@arun-gupta
Copy link
Contributor Author

It is absolutely a valid workaround, as long as it works in my setup. Here are the commands issued in my terminal:

services $ mvn -pl greeting fabric8:push -Pdocker
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Building greeting 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- fabric8-maven-plugin:3.5.34:push (default-cli) @ greeting ---
[INFO] F8> Running generator wildfly-swarm
[INFO] F8> wildfly-swarm: Using Docker image fabric8/java-jboss-openjdk8-jdk:1.3 as base / builder
[INFO] F8> The push refers to repository [docker.io/arungupta/greeting]
d2cda8e485d1: Preparing   
f14ef5f204ff: Preparing   
85bb608219b7: Preparing   
160c15b8811e: Preparing   
498396e67e5c: Preparing   
2e544e952df4: Waiting     
e07090bc1b2d: Waiting     
c8af1cb1c035: Waiting     
64062a6d7af2: Waiting     
dfb51d70f8af: Waiting     
56939e74679c: Waiting     
d1be66a59bc5: Waiting     
[ERROR] F8> Unable to push 'arungupta/greeting' : denied: requested access to the resource is denied  [denied: requested access to the resource is denied ]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.623 s
[INFO] Finished at: 2018-02-15T04:54:07-08:00
[INFO] Final Memory: 34M/327M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.fabric8:fabric8-maven-plugin:3.5.34:push (default-cli) on project greeting: Unable to push 'arungupta/greeting' : denied: requested access to the resource is denied  -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[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
services $ mvn -pl greeting fabric8:push -Ddocker.repo=arungupta -Pdocker
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Building greeting 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- fabric8-maven-plugin:3.5.34:push (default-cli) @ greeting ---
[INFO] F8> Running generator wildfly-swarm
[INFO] F8> wildfly-swarm: Using Docker image fabric8/java-jboss-openjdk8-jdk:1.3 as base / builder
[INFO] F8> The push refers to repository [docker.io/arungupta/greeting]
d2cda8e485d1: Preparing   
f14ef5f204ff: Preparing   
85bb608219b7: Preparing   
160c15b8811e: Preparing   
498396e67e5c: Preparing   
2e544e952df4: Waiting     
e07090bc1b2d: Waiting     
c8af1cb1c035: Waiting     
64062a6d7af2: Waiting     
dfb51d70f8af: Waiting     
56939e74679c: Waiting     
d1be66a59bc5: Waiting     
[ERROR] F8> Unable to push 'arungupta/greeting' : denied: requested access to the resource is denied  [denied: requested access to the resource is denied ]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.863 s
[INFO] Finished at: 2018-02-15T04:54:32-08:00
[INFO] Final Memory: 35M/418M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.fabric8:fabric8-maven-plugin:3.5.34:push (default-cli) on project greeting: Unable to push 'arungupta/greeting' : denied: requested access to the resource is denied  -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[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
services $ docker push arungupta/greeting
The push refers to repository [docker.io/arungupta/greeting]
d2cda8e485d1: Pushed 
f14ef5f204ff: Layer already exists 
85bb608219b7: Layer already exists 
160c15b8811e: Layer already exists 
498396e67e5c: Layer already exists 
2e544e952df4: Layer already exists 
e07090bc1b2d: Layer already exists 
c8af1cb1c035: Layer already exists 
64062a6d7af2: Layer already exists 
dfb51d70f8af: Layer already exists 
56939e74679c: Layer already exists 
d1be66a59bc5: Layer already exists 
latest: digest: sha256:1279e63b5696157f813cdc9345f0b111c4a41ff4b3027e486238a9c765c6b5ba size: 2828

As you can see, docker push works fine but fabric8:push, with or without docker.repo does not. And in my pom.xml, docker.repo is already set to arungupta.

What could be the discrepancy in my setup? How should I further debug it?

@ALRubinger
Copy link

@arun-gupta I don't see where you issued docker login? Is your manual docker push set up with some config to send along your credentials without having to use login first?

Also this differs from the command I used by passing -pl to the mvn commands.

I can look again on my machine in a few hours, but yeah, dock login before running mvn is what made this start to work for me.

@ALRubinger
Copy link

@arun-gupta Yeah, check my traces below. First I am not logged into docker locally:

[alr@tubescreamer ~]$ docker logout 
Removing login credentials for https://index.docker.io/v1/

Then I attempt the same command you've provided me, which fails with familiar "requested access to the resource is denied" error:

✔ ~/business/jboss/git/aws-samples/aws-compute-options/services [alrubinger-fmp L|✚ 1] 
16:34 $ mvn -pl greeting fabric8:push -Pdocker
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building greeting 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- fabric8-maven-plugin:3.5-SNAPSHOT:push (default-cli) @ greeting ---
[INFO] F8> Running generator wildfly-swarm
[INFO] F8> wildfly-swarm: Using Docker image fabric8/java-jboss-openjdk8-jdk:1.3 as base / builder
[INFO] F8> The push refers to repository [docker.io/alrubinger/greeting]
dbbebd36d1c7: Preparing   
f14ef5f204ff: Preparing   
85bb608219b7: Preparing   
160c15b8811e: Preparing   
498396e67e5c: Preparing   
2e544e952df4: Waiting     
e07090bc1b2d: Waiting     
c8af1cb1c035: Waiting     
64062a6d7af2: Waiting     
dfb51d70f8af: Waiting     
56939e74679c: Waiting     
d1be66a59bc5: Waiting     
[ERROR] F8> Unable to push 'alrubinger/greeting' : denied: requested access to the resource is denied  [denied: requested access to the resource is denied ]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.682 s
[INFO] Finished at: 2018-02-15T16:35:00+00:00
[INFO] Final Memory: 34M/392M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.fabric8:fabric8-maven-plugin:3.5-SNAPSHOT:push (default-cli) on project greeting: Unable to push 'alrubinger/greeting' : denied: requested access to the resource is denied  -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[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

Then I run docker login:

✘-1 ~/business/jboss/git/aws-samples/aws-compute-options/services [alrubinger-fmp L|✚ 1] 
16:35 $ docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username: alrubinger
Password: 
Login Succeeded

Finally I try the same command again and the pushes go forward:

✔ ~/business/jboss/git/aws-samples/aws-compute-options/services [alrubinger-fmp L|✚ 1] 
16:35 $ mvn -pl greeting fabric8:push -Pdocker
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building greeting 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- fabric8-maven-plugin:3.5-SNAPSHOT:push (default-cli) @ greeting ---
[INFO] F8> Running generator wildfly-swarm
[INFO] F8> wildfly-swarm: Using Docker image fabric8/java-jboss-openjdk8-jdk:1.3 as base / builder
[INFO] F8> The push refers to repository [docker.io/alrubinger/greeting]
dbbebd36d1c7: Preparing   
f14ef5f204ff: Pushed      
85bb608219b7: Pushed      
160c15b8811e: Pushed      
498396e67e5c: Pushed      
2e544e952df4: Pushing     [==============================>                    ]  525.8kB/853kB
e07090bc1b2d: Pushed      
c8af1cb1c035: Pushed      
64062a6d7af2: Pushing     [>                                                  ]  1.078MB/203.1MB
dfb51d70f8af: Pushed      
56939e74679c: Pushing     [=>                                                 ]  593.4kB/28.13MB
d1be66a59bc5: Pushing     [>                                                  ]    555kB/203.5MB

@ALRubinger
Copy link

@arun-gupta Note that my environment is Fedora:

[alr@tubescreamer ~]$ uname -a
Linux tubescreamer 4.14.16-300.fc27.x86_64 #1 SMP Wed Jan 31 19:24:27 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

@kenfinnigan notes that he's on Mac and sees the same issue you do; FMP doesn't seem to be respecting the login creds on that platform. We're looking into it.

@ALRubinger
Copy link

So the contents of my:

[alr@tubescreamer ~]$ cat $HOME/.docker/config.json
{
	"auths": {
		"https://index.docker.io/v1/": {
			"auth": "$$$$_REDACTED_BY_ALR_FOR_SECURITY_$$$$"
		}
	},
	"HttpHeaders": {
		"User-Agent": "Docker-Client/17.12.0-ce (linux)"
	}
}

@kenfinnigan version has a credstore variable pointing to osxkeychain, so we're wondering if FMP is not keychain-aware and respecting the login.

@ALRubinger
Copy link

The fix I believe, based on a naked-eye view, is in the AuthConfig class of the Fabric8 docker-maven-plugin:

public AuthConfig(String credentialsEncoded, String email) {
        String credentials = new String(Base64.decodeBase64(credentialsEncoded));
        String[] parsedCreds = credentials.split(":",2);
        username = parsedCreds[0];
        password = parsedCreds[1];
        this.email = email;
        auth = null;
        authEncoded = createAuthEncoded();
    }

This does not support the keychain stuff used by Mac. Credentials on Linux are simply stored as a Base64 encoded String of form username:password

@kenfinnigan
Copy link
Contributor

kenfinnigan commented Feb 15, 2018

Some workarounds as per https://dmp.fabric8.io/#authentication

  • Set system properties for docker.username and docker.password
  • Add a server to ~/.m2/settings.xml for docker.io

@ALRubinger
Copy link

Underlying issue is here:

fabric8io/docker-maven-plugin#946

@kenfinnigan to note a workaround for how to pass the username/password into the mvn CLI manually which will get you past this until a fix can be applied.

@arun-gupta
Copy link
Contributor Author

Added docker.username and docker.password properties to pom.xml. Here is the output:

services $ mvn -pl greeting clean package fabric8:push -Pdocker -Ddocker.password=<password>
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Building greeting 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ greeting ---
[INFO] Deleting /Users/argu/workspaces/aws-compute-options/services/greeting/target
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ greeting ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/argu/workspaces/aws-compute-options/services/greeting/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ greeting ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to /Users/argu/workspaces/aws-compute-options/services/greeting/target/classes
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ greeting ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/argu/workspaces/aws-compute-options/services/greeting/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ greeting ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ greeting ---
[INFO] No tests to run.
[INFO] 
[INFO] --- maven-war-plugin:2.5:war (default-war) @ greeting ---
[INFO] Packaging webapp
[INFO] Assembling webapp [greeting] in [/Users/argu/workspaces/aws-compute-options/services/greeting/target/greeting]
[INFO] Processing war project
[INFO] Webapp assembled in [122 msecs]
[INFO] Building war: /Users/argu/workspaces/aws-compute-options/services/greeting/target/greeting.war
[INFO] 
[INFO] --- wildfly-swarm-plugin:2018.2.0:package (default) @ greeting ---
Resolving 49 out of 222 artifacts
[INFO] Repackaging .war: /Users/argu/workspaces/aws-compute-options/services/greeting/target/greeting.war
[INFO] Repackaged .war: /Users/argu/workspaces/aws-compute-options/services/greeting/target/greeting.war
[INFO] 
[INFO] --- fabric8-maven-plugin:3.5.30:build (default) @ greeting ---
[INFO] F8: Building Docker image in Kubernetes mode
[INFO] F8: Running generator wildfly-swarm
[INFO] F8: wildfly-swarm: Using Docker image fabric8/java-jboss-openjdk8-jdk:1.2 as base / builder
[INFO] Copying files to /Users/argu/workspaces/aws-compute-options/services/greeting/target/docker/arungupta/greeting/build/maven
[INFO] Building tar: /Users/argu/workspaces/aws-compute-options/services/greeting/target/docker/arungupta/greeting/tmp/docker-build.tar
[INFO] F8: [arungupta/greeting:latest] "wildfly-swarm": Created docker-build.tar in 239 milliseconds
[INFO] F8: [arungupta/greeting:latest] "wildfly-swarm": Built image sha256:95ff9
[INFO] F8: [arungupta/greeting:latest] "wildfly-swarm": Removed old image sha256:071f9
[INFO] F8: [arungupta/greeting:latest] "wildfly-swarm": Tag with latest
[INFO] 
[INFO] --- fabric8-maven-plugin:3.5.30:push (default-cli) @ greeting ---
[INFO] F8> Running generator wildfly-swarm
[INFO] F8> wildfly-swarm: Using Docker image fabric8/java-jboss-openjdk8-jdk:1.2 as base / builder
[INFO] F8> The push refers to repository [docker.io/arungupta/greeting]
15282a8d2d15: Preparing   
d98d8362fa14: Preparing   
dd5ac05fcae7: Preparing   
ad2afd14bd56: Preparing   
38ed80498e01: Preparing   
b6b9cebd2bc4: Waiting     
44d468e487be: Waiting     
ebe243934b99: Waiting     
fef12de4c7da: Waiting     
3bf2c105669b: Waiting     
85c6e373d858: Waiting     
dc1e2dcdc7b6: Waiting     
[ERROR] F8> Unable to push 'arungupta/greeting' : denied: requested access to the resource is denied  [denied: requested access to the resource is denied ]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.644 s
[INFO] Finished at: 2018-02-15T11:24:38-08:00
[INFO] Final Memory: 55M/603M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.fabric8:fabric8-maven-plugin:3.5.30:push (default-cli) on project greeting: Unable to push 'arungupta/greeting' : denied: requested access to the resource is denied  -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[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

@kenfinnigan
Copy link
Contributor

Not sure why the system properties aren't working, as it's in the docs.

Apologies though as I didn't directly try those settings. However, I did have success with -Ddocker.push.username=<username> -Ddocker.push.password=<password> being passed to Maven.

I was looking for alternatives that didn't require password on command line

@arun-gupta
Copy link
Contributor Author

Even docker.push.password=<password> is not working:

services $ mvn -pl greeting clean package fabric8:push -Pdocker -Ddocker.push.password=<password>
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Building greeting 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ greeting ---
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ greeting ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/argu/workspaces/aws-compute-options/services/greeting/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ greeting ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to /Users/argu/workspaces/aws-compute-options/services/greeting/target/classes
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ greeting ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/argu/workspaces/aws-compute-options/services/greeting/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ greeting ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ greeting ---
[INFO] No tests to run.
[INFO] 
[INFO] --- maven-war-plugin:2.5:war (default-war) @ greeting ---
[INFO] Packaging webapp
[INFO] Assembling webapp [greeting] in [/Users/argu/workspaces/aws-compute-options/services/greeting/target/greeting]
[INFO] Processing war project
[INFO] Webapp assembled in [105 msecs]
[INFO] Building war: /Users/argu/workspaces/aws-compute-options/services/greeting/target/greeting.war
[INFO] 
[INFO] --- wildfly-swarm-plugin:2018.2.0:package (default) @ greeting ---
Resolving 49 out of 222 artifacts
[INFO] Repackaging .war: /Users/argu/workspaces/aws-compute-options/services/greeting/target/greeting.war
[INFO] Repackaged .war: /Users/argu/workspaces/aws-compute-options/services/greeting/target/greeting.war
[INFO] 
[INFO] --- fabric8-maven-plugin:3.5.30:build (default) @ greeting ---
[WARNING] Error reading service account token from: [/var/run/secrets/kubernetes.io/serviceaccount/token]. Ignoring.
[WARNING] Error reading service account token from: [/var/run/secrets/kubernetes.io/serviceaccount/token]. Ignoring.
[WARNING] F8: Cannot access cluster for detecting mode: Unknown host kubernetes.default.svc
[INFO] F8: Building Docker image in Kubernetes mode
[WARNING] Error reading service account token from: [/var/run/secrets/kubernetes.io/serviceaccount/token]. Ignoring.
[WARNING] F8: Cannot access cluster for detecting mode: Unknown host kubernetes.default.svc
[WARNING] Error reading service account token from: [/var/run/secrets/kubernetes.io/serviceaccount/token]. Ignoring.
[WARNING] F8: Cannot access cluster for detecting mode: Unknown host kubernetes.default.svc
[WARNING] Error reading service account token from: [/var/run/secrets/kubernetes.io/serviceaccount/token]. Ignoring.
[INFO] F8: Running generator wildfly-swarm
[INFO] F8: wildfly-swarm: Using Docker image fabric8/java-jboss-openjdk8-jdk:1.2 as base / builder
[WARNING] Error reading service account token from: [/var/run/secrets/kubernetes.io/serviceaccount/token]. Ignoring.
[WARNING] F8: Cannot access cluster for detecting mode: Unknown host kubernetes.default.svc
[WARNING] Error reading service account token from: [/var/run/secrets/kubernetes.io/serviceaccount/token]. Ignoring.
[WARNING] F8: Cannot access cluster for detecting mode: Unknown host kubernetes.default.svc
[WARNING] Error reading service account token from: [/var/run/secrets/kubernetes.io/serviceaccount/token]. Ignoring.
[INFO] Copying files to /Users/argu/workspaces/aws-compute-options/services/greeting/target/docker/arungupta/greeting/build/maven
[INFO] Building tar: /Users/argu/workspaces/aws-compute-options/services/greeting/target/docker/arungupta/greeting/tmp/docker-build.tar
[INFO] F8: [arungupta/greeting:latest] "wildfly-swarm": Created docker-build.tar in 266 milliseconds
[INFO] F8: [arungupta/greeting:latest] "wildfly-swarm": Built image sha256:cd781
[INFO] F8: [arungupta/greeting:latest] "wildfly-swarm": Tag with latest
[INFO] 
[INFO] --- fabric8-maven-plugin:3.5.30:push (default-cli) @ greeting ---
[INFO] F8> Running generator wildfly-swarm
[INFO] F8> wildfly-swarm: Using Docker image fabric8/java-jboss-openjdk8-jdk:1.2 as base / builder
[INFO] F8> The push refers to repository [docker.io/arungupta/greeting]
c23b06bf65ef: Preparing   
d98d8362fa14: Preparing   
dd5ac05fcae7: Preparing   
ad2afd14bd56: Preparing   
38ed80498e01: Preparing   
b6b9cebd2bc4: Waiting     
44d468e487be: Waiting     
ebe243934b99: Waiting     
fef12de4c7da: Waiting     
3bf2c105669b: Waiting     
85c6e373d858: Waiting     
dc1e2dcdc7b6: Waiting     
[ERROR] F8> Unable to push 'arungupta/greeting' : denied: requested access to the resource is denied  [denied: requested access to the resource is denied ]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.386 s
[INFO] Finished at: 2018-02-15T14:12:40-08:00
[INFO] Final Memory: 51M/514M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.fabric8:fabric8-maven-plugin:3.5.30:push (default-cli) on project greeting: Unable to push 'arungupta/greeting' : denied: requested access to the resource is denied  -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[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
services $ 

@kenfinnigan
Copy link
Contributor

I didn't try running it with just the password.

But if I pass the username and password that way, then it worked for me

@arun-gupta
Copy link
Contributor Author

I added the following properties to pom.xml:

        <docker.push.username>arungupta</docker.push.username>
        <docker.push.password>password</docker.push.password>

So, docker.push.username was already set and just had to override docker.push.password.

If both username and password are specified, then it fails with:

[INFO] F8> The push refers to repository [docker.io/arungupta/greeting]
b32f57d8b2c3: Preparing   
d98d8362fa14: Preparing   
dd5ac05fcae7: Preparing   
ad2afd14bd56: Preparing   
38ed80498e01: Preparing   
b6b9cebd2bc4: Waiting     
44d468e487be: Waiting     
ebe243934b99: Waiting     
fef12de4c7da: Waiting     
3bf2c105669b: Waiting     
85c6e373d858: Waiting     
dc1e2dcdc7b6: Waiting     
[ERROR] F8> Unable to push 'arungupta/greeting' : unauthorized: incorrect username or password  [unauthorized: incorrect username or password ]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13.468 s
[INFO] Finished at: 2018-02-15T14:46:40-08:00
[INFO] Final Memory: 51M/499M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.fabric8:fabric8-maven-plugin:3.5.30:push (default-cli) on project greeting: Unable to push 'arungupta/greeting' : unauthorized: incorrect username or password  -> [Help 1]

These are the same values that are used with docker login.

@kenfinnigan
Copy link
Contributor

That's very weird, didn't have the same issue myself

@arun-gupta arun-gupta added this to the Milestone 3 milestone Apr 2, 2018
@arun-gupta
Copy link
Contributor Author

@arun-gupta
Copy link
Contributor Author

Closing this, following up at amazon-archives/microservices-greeting#3

@arun-gupta
Copy link
Contributor Author

Closing this, following up at amazon-archives/microservices-greeting#3

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working maven
Projects
None yet
Development

No branches or pull requests

3 participants