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.

Improve error message when `from` image cannot be found

See original GitHub issue

Description of the issue: When jib cannot find image specified in from build fails with this not very explanatory message. I also think that it is a little bit missleading because Getting base image ghostbuster91/test-jib2.. looks fine.

❯ ./gradlew jib
warning: Base image 'ghostbuster91/test-jib2' does not use a specific image digest - build may not be reproducible

Containerizing application to ghostbuster91/test-jib...

Retrieving registry credentials for registry.hub.docker.com...
Getting base image ghostbuster91/test-jib2... <-- HERE IT LOOKS OK
Building dependencies layer...
Building classes layer...
Building resources layer...
Retrieving registry credentials for registry.hub.docker.com...

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':jib'.
> Build image failed

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --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 11s
2 actionable tasks: 1 executed, 1 up-to-date

Expected behavior: IMO the best way would be to fail when executing Getting base image ghostbuster91/test-jib2.. At least some better error message should be provided.

Steps to reproduce: Just make a type when declaring from image. Environment: Ubuntu 18.04

jib-gradle-plugin Configuration:

plugins {
    id 'com.google.cloud.tools.jib' version '0.9.6'
}
apply plugin: 'java'

group 'test-jib'
version '1.0-SNAPSHOT'

sourceCompatibility = 1.8

repositories {
    mavenCentral()
}

dependencies {
    testCompile group: 'junit', name: 'junit', version: '4.12'
}

jib {
    from {
        image = 'ghostbuster91/test-jib2'
    }
    to {
        image = 'ghostbuster91/test-jib'
    }
    container {
        mainClass = 'Main'
    }
}

Log output:

Additional Information:

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
briandealwiscommented, Jul 23, 2018

Great! We can provide a better message for RegistryErrorExceptions:

Caused by: com.google.cloud.tools.jib.registry.RegistryErrorException: Tried to pull image manifest for registry.hub.docker.com/ghostbuster91/test-jib-2:latest but failed because: manifest unknown | If this is a bug, please file an issue at https://github.com/GoogleContainerTools/jib/issues/new

0reactions
briandealwiscommented, Aug 1, 2018

I meant to close this: #697 surfaces the RegistryErrorException which addresses the opaque Execution failed for task ':jib'. message in this issue. The problem with the misleading registry auth is #758.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to handle loading of images that may not exist?
Another way to handle this issue is by listening to the error event that gets fired when the image fails to load. In...
Read more >
Remove Bad Image Error in Windows 7/8/10/11
A problem for Windows users is the bad image error leading them to a stranded point. The article provides practical solutions to fix...
Read more >
The image [image] cannot be displayed because it contains ...
I'm using Firefox ESR 24.5.0 on Red Hat Enterprise Linux 6.3 with GNOME 2.28.2. It gives me that error when I try to...
Read more >
Error Message: There are errors below. Hover over each for ...
This error message can occur because of: File size and width - Images with a file size larger than 5MB or wider than...
Read more >
How to Fix the 'File Could Not Be Found' Error in Lightroom
If you're seeing the error on one photo, simply click the exclamation point on the top right of the photo and select 'Locate.'...
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