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

unauthorized: authentication required when dockerfile:push os macOS #247

Closed
NeoCN opened this issue Nov 8, 2018 · 3 comments
Closed

unauthorized: authentication required when dockerfile:push os macOS #247

NeoCN opened this issue Nov 8, 2018 · 3 comments
Labels

Comments

@NeoCN
Copy link

NeoCN commented Nov 8, 2018

BUG REPORT

Description

When do mvn dockerfile:push on macOS with com.spotify:dockerfile-maven:v1.4.8, got the following error:

denied: requested access to the resource is denied
unauthorized: authentication required

docker login did not help

after downgrade the com.spotify:docker-client to v8.11.7, mvn dockerfile:push success without error.

How to reproduce

  1. do docker login first
  2. do mvn dockerfile:push

What do you expect

docker image pushed to private registry successfully

What happened instead

got the following error

denied: requested access to the resource is denied
unauthorized: authentication required

Software:

  • OS
macOS v10.14.1
  • mvn -version
Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-25T02:41:47+08:00)
Maven home: /usr/local/Cellar/maven/3.6.0/libexec
Java version: 1.8.0_121, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "mac os x", version: "10.14.1", arch: "x86_64", family: "mac"
  • docker version:
Client:
 Version:           18.06.1-ce
 API version:       1.38
 Go version:        go1.10.3
 Git commit:        e68fc7a
 Built:             Tue Aug 21 17:21:31 2018
 OS/Arch:           darwin/amd64
 Experimental:      false

Server:
 Engine:
  Version:          18.06.1-ce
  API version:      1.38 (minimum version 1.12)
  Go version:       go1.10.3
  Git commit:       e68fc7a
  Built:            Tue Aug 21 17:29:02 2018
  OS/Arch:          linux/amd64
  Experimental:     true

  • Spotify's dockerfile-maven version: v1.4.8

Full backtrace

2018-11-08T19:02:53:583+0800 [INFO] ------------------------------------------------------------------------
2018-11-08T19:02:53:583+0800 [INFO] BUILD FAILURE
2018-11-08T19:02:53:583+0800 [INFO] ------------------------------------------------------------------------
2018-11-08T19:02:53:584+0800 [INFO] Total time:  6.009 s (Wall Clock)
2018-11-08T19:02:53:584+0800 [INFO] Finished at: 2018-11-08T19:02:53+08:00
2018-11-08T19:02:53:585+0800 [INFO] ------------------------------------------------------------------------
2018-11-08T19:02:53:586+0800 [ERROR] Failed to execute goal com.spotify:dockerfile-maven-plugin:1.4.8:push (default-cli) on project xxx-processor: Could not push image: errors:
2018-11-08T19:02:53:587+0800 [ERROR] denied: requested access to the resource is denied
2018-11-08T19:02:53:588+0800 [ERROR] unauthorized: authentication required
2018-11-08T19:02:53:588+0800 [ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.spotify:dockerfile-maven-plugin:1.4.8:push (default-cli) on project xxx-processor: Could not push image
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:200)
    at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:196)
    at java.util.concurrent.FutureTask.run (FutureTask.java:266)
    at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:511)
    at java.util.concurrent.FutureTask.run (FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:617)
    at java.lang.Thread.run (Thread.java:745)
Caused by: org.apache.maven.plugin.MojoExecutionException: Could not push image
    at com.spotify.plugin.dockerfile.PushMojo.execute (PushMojo.java:90)
    at com.spotify.plugin.dockerfile.AbstractDockerMojo.tryExecute (AbstractDockerMojo.java:259)
    at com.spotify.plugin.dockerfile.AbstractDockerMojo.execute (AbstractDockerMojo.java:248)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:200)
    at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:196)
    at java.util.concurrent.FutureTask.run (FutureTask.java:266)
    at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:511)
    at java.util.concurrent.FutureTask.run (FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:617)
    at java.lang.Thread.run (Thread.java:745)
Caused by: com.spotify.docker.client.exceptions.DockerException: errors:
denied: requested access to the resource is denied
unauthorized: authentication required

    at com.spotify.plugin.dockerfile.LoggingProgressHandler.handleError (LoggingProgressHandler.java:105)
    at com.spotify.plugin.dockerfile.LoggingProgressHandler.progress (LoggingProgressHandler.java:63)
    at com.spotify.docker.client.ProgressStream.tail (ProgressStream.java:77)
    at com.spotify.docker.client.DefaultDockerClient$ResponseTailReader.call (DefaultDockerClient.java:2734)
    at com.spotify.docker.client.DefaultDockerClient$ResponseTailReader.call (DefaultDockerClient.java:2718)
    at java.util.concurrent.FutureTask.run (FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:617)
    at java.lang.Thread.run (Thread.java:745)

Working method

After some tries, I got a working method, downgrade com.spotify:docker-client version.

When com.spotify:docker-client version is smaller than v8.12.0, v8.11.7 for example, the mvn dockerfile:push will success.

When change the version to v8.12.0 or some other newer versions, the mvn dockerfile:push will fail with requested access to the resource is denied error.

I noticed that version v8.12.0 is released with spotify/docker-client#1051 pr merged, is that concerned?

@egillingham
Copy link

+1

1 similar comment
@belerweb
Copy link

+1

@stale
Copy link

stale bot commented Jan 13, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jan 13, 2019
@stale stale bot closed this as completed Jan 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants