question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Could not push image in 0.9.8 but success in 0.9.7 gradle

See original GitHub issue

Description of the issue: I encounter the same problem with gradle plugin. The same configs works for version 0.9.7, but gives error in 0.9.8. It looks like this issue but there are not useful solution there.

Expected behavior: Should work with both versions

Steps to reproduce:

  1. Execute ./gradlew clean jib with version 0.9.7 (success)
  2. Execute ./gradlew clean jib with version 0.9.8 (error)

Environment: MacOs version 10.13.6 gradle wrapper 4.8.1

jib-gradle-plugin Configuration:

jib {
	from {
        image = 'openjdk:8-jdk-alpine'
		auth {
			username = dockerUsername
			password = dockerPassword
		}
	}
    to {
        image = "demonian/${bootJar.baseName}:${bootJar.version}"
		auth {
			username = dockerUsername
			password = dockerPassword
		}

    }
    container {
		useCurrentTimestamp = true
    }
}

Log output: ### Success with jib 0.9.7 logs: Built and pushed image as demonian/prime:0.0.1-SNAPSHOT :jib (Thread[Task worker for ‘:’ Thread 3,5,main]) completed. Took 9.24 secs.

BUILD SUCCESSFUL in 10s 4 actionable tasks: 4 executed

### Error with jib 0.9.8, but according to logs I see that it pushed the image:

Authenticating with push to registry.hub.docker.com : 1755.206 ms
RUNNING Pushing BLOB digest: sha256:196d20239e57e877897f1804f66edb53fa657eefd403191e40b2c451fc66a223, size: 142
RUNNING Pushing BLOB digest: sha256:5b8637e76e31c34f9f794885baae1511bc52127ba052dd0a8011df837122bc5c, size: 749
RUNNING Pushing BLOB digest: sha256:a19961ec08095eb70ca3a070945223dcf51500a255a745272276139bf0a29f4e, size: 15515814
BLOB : digest: sha256:5b8637e76e31c34f9f794885baae1511bc52127ba052dd0a8011df837122bc5c, size: 749 already exists on registry
Pushing BLOB digest: sha256:5b8637e76e31c34f9f794885baae1511bc52127ba052dd0a8011df837122bc5c, size: 749 : 752.68 ms
BLOB : digest: sha256:196d20239e57e877897f1804f66edb53fa657eefd403191e40b2c451fc66a223, size: 142 already exists on registry
Pushing BLOB digest: sha256:196d20239e57e877897f1804f66edb53fa657eefd403191e40b2c451fc66a223, size: 142 : 763.521 ms
BLOB : digest: sha256:a19961ec08095eb70ca3a070945223dcf51500a255a745272276139bf0a29f4e, size: 15515814 already exists on registry
Pushing BLOB digest: sha256:a19961ec08095eb70ca3a070945223dcf51500a255a745272276139bf0a29f4e, size: 15515814 : 876.491 ms
Pulling base image manifest : 4992.779 ms
RUNNING Setting up base image caching
RUNNING Pulling base image layer sha256:8e3ba11ec2a2b39ab372c60c16b421536e50e5ce64a0bc81765c2e38381bcff6
Pulling base image layer sha256:8e3ba11ec2a2b39ab372c60c16b421536e50e5ce64a0bc81765c2e38381bcff6 : 0.116 ms
RUNNING Pulling base image layer sha256:311ad0da45338842480bf25c6e6b7bb133b7b8cf709c3470db171ec370da5539
Setting up base image caching : 1.33 ms
Pulling base image layer sha256:311ad0da45338842480bf25c6e6b7bb133b7b8cf709c3470db171ec370da5539 : 0.214 ms
RUNNING Setting up to push layers
RUNNING Pulling base image layer sha256:df312c74ce16f20eeb87b5640db9b1579a53534bd3e9f3de1e916fc62744bcf4
Pulling base image layer sha256:df312c74ce16f20eeb87b5640db9b1579a53534bd3e9f3de1e916fc62744bcf4 : 0.025 ms
Setting up to push layers : 0.113 ms
RUNNING Pushing BLOB digest: sha256:311ad0da45338842480bf25c6e6b7bb133b7b8cf709c3470db171ec370da5539, size: 239
RUNNING Pushing BLOB digest: sha256:8e3ba11ec2a2b39ab372c60c16b421536e50e5ce64a0bc81765c2e38381bcff6, size: 2206542
RUNNING Pushing BLOB digest: sha256:df312c74ce16f20eeb87b5640db9b1579a53534bd3e9f3de1e916fc62744bcf4, size: 70581383
RUNNING Building container configuration
Finalizing...
Building container configuration : 0.89 ms
RUNNING Pushing container configuration
RUNNING Pushing BLOB digest: sha256:b2fe9730eabdbde8cf335e0d97f05095bbac43326cfd2405390ce367d5a0ef21, size: 966
Pushing container configuration : 43.376 ms
BLOB : digest: sha256:311ad0da45338842480bf25c6e6b7bb133b7b8cf709c3470db171ec370da5539, size: 239 already exists on registry
Pushing BLOB digest: sha256:311ad0da45338842480bf25c6e6b7bb133b7b8cf709c3470db171ec370da5539, size: 239 : 744.023 ms
BLOB : digest: sha256:8e3ba11ec2a2b39ab372c60c16b421536e50e5ce64a0bc81765c2e38381bcff6, size: 2206542 already exists on registry
Pushing BLOB digest: sha256:8e3ba11ec2a2b39ab372c60c16b421536e50e5ce64a0bc81765c2e38381bcff6, size: 2206542 : 757.223 ms
BLOB : digest: sha256:df312c74ce16f20eeb87b5640db9b1579a53534bd3e9f3de1e916fc62744bcf4, size: 70581383 already exists on registry
Pushing BLOB digest: sha256:df312c74ce16f20eeb87b5640db9b1579a53534bd3e9f3de1e916fc62744bcf4, size: 70581383 : 1066.132 ms
Pushing BLOB digest: sha256:b2fe9730eabdbde8cf335e0d97f05095bbac43326cfd2405390ce367d5a0ef21, size: 966 : 1453.371 ms
Building and pushing image : 6914.244 ms

> Task :jib FAILED
:jib (Thread[Task worker for ':',5,main]) completed. Took 7.046 secs.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':jib'.
> Build image failed, perhaps you should make sure your credentials for 'registry.hub.docker.com' are set up correctly

* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 10s

### Stacktrace:

Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':jib'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:110)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:77)
        at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59)
        at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101)
        at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44)
        at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91)
        at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.run(EventFiringTaskExecuter.java:51)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:97)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:46)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$ExecuteTaskAction.execute(DefaultTaskExecutionGraph.java:262)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$ExecuteTaskAction.execute(DefaultTaskExecutionGraph.java:246)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:136)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:130)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.execute(DefaultTaskPlanExecutor.java:201)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.executeWithTask(DefaultTaskPlanExecutor.java:192)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:130)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: org.gradle.api.GradleException: Build image failed, perhaps you should make sure your credentials for 'registry.hub.docker.com' are set up correctly
        at com.google.cloud.tools.jib.gradle.BuildImageTask.buildImage(BuildImageTask.java:169)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:46)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:794)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:761)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:131)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:97)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:120)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:99)
        ... 30 more
Caused by: com.google.cloud.tools.jib.registry.RegistryUnauthorizedException: Unauthorized for registry.hub.docker.com/demonian/prime
        at com.google.cloud.tools.jib.registry.RegistryEndpointCaller.call(RegistryEndpointCaller.java:252)
        at com.google.cloud.tools.jib.registry.RegistryEndpointCaller.callWithAllowInsecureRegistryHandling(RegistryEndpointCaller.java:150)
        at com.google.cloud.tools.jib.registry.RegistryEndpointCaller.call(RegistryEndpointCaller.java:140)
        at com.google.cloud.tools.jib.registry.RegistryClient.callRegistryEndpoint(RegistryClient.java:356)
        at com.google.cloud.tools.jib.registry.RegistryClient.pushBlob(RegistryClient.java:305)
        at com.google.cloud.tools.jib.builder.steps.PushBlobStep.call(PushBlobStep.java:100)
        at com.google.cloud.tools.jib.builder.steps.PushBlobStep.call(PushBlobStep.java:35)
        at com.google.common.util.concurrent.CombinedFuture$CallableInterruptibleTask.runInterruptibly(CombinedFuture.java:181)
        at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57)
Caused by: com.google.api.client.http.HttpResponseException: 401 Unauthorized
{"errors":[{"code":"UNAUTHORIZED","message":"authentication required","detail":[{"Type":"repository","Class":"","Name":"demonian/prime","Action":"pull"},{"Type":"repository","Class":"","Name":"demonian/prime","Action":"push"},{"Type":"repository","Class":"","Name":"library/openjdk","Action":"pull"}]}]}
        at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1070)
        at com.google.cloud.tools.jib.http.Connection.send(Connection.java:161)
        at com.google.cloud.tools.jib.registry.RegistryEndpointCaller.call(RegistryEndpointCaller.java:213)
        ... 8 more

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:28 (26 by maintainers)

github_iconTop GitHub Comments

1reaction
coollogcommented, Aug 22, 2018

Hi @Demonian , we have resolved this issue in the new release (version 0.9.9).

1reaction
briandealwiscommented, Aug 8, 2018

I think trying to get it to work in the “base case”, where there is no per-from and per-to auth specified, could provide a big win on Docker Hub.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use the gradle jib plugin to push an image to the ...
I am able to build my own docker image as well as run the docker image within google's cloud shell, but I cannot...
Read more >
lime (7.6.0) - Haxelib
This is not the latest stable version of lime. ... loading corrupted PNG images; Fixed an issue where window.cursor = null did not...
Read more >
Release Notes | Google Cloud CLI Documentation
This is a behavior change with the command gcloud app deploy when there is no app.yaml configuration for Java projects (Maven, or Gradle, ......
Read more >
Compare Packages Between Distributions - DistroWatch.com
This page enables us to quickly perform a side-by-side comparison of the packages available in two different distributions, or in two different versions...
Read more >
CVE - Search Results - MITRE
CVE-2022-45481, The default configuration of Lazy Mouse does not require a ... A successful exploit could allow remote code execution within the context...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found