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.

gradle jibDockerBuild fails with Could not expand ZIP message on second run

See original GitHub issue

Description of the issue: I started to use jib for war files. My war file has read only files. When I run gradle jibDockerBuild second time it fail with message: Execution failed for task ‘:bundle-svc:jibExplodedWar’.

Could not expand ZIP ‘…/bundle-svc/build/libs/bundle-service.war’.

Expected behavior: It shouldn’t fail and should complete successfully

Steps to reproduce: In existing gradle project that produces a war file, change a file to be read only. Run gradle jibDockerBuild

Environment: Mac Os X, Gradle 4.10.3

jib-gradle-plugin Configuration:


jib {
  from.image = 'localhost:5000/repo/bundle-service:latest'
  allowInsecureRegistries = true
  to.image = 'repo/bundle-service-jib'
  // For demonstration only: this directory in the base image contains a Tomcat default
  // app (welcome page), so you may first want to delete this directory in the base image.
  container.appRoot = '/opt/tomcat/webapps'
}

Log output:

Additional Information: Changing original file permission can’t be a workaround to me since I use Perforce as a VCS which sets readonly flag for all files that weren’t checked out.Those files are packed to war as is with the standard gradle war task.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:17 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
chanseokohcommented, Nov 15, 2019

@infa-rbliznet we just released Jib 1.8.0, and I believe it fixes this issue.

@rajovictor thanks for your contribution to fix this!

1reaction
rajovictorcommented, Oct 23, 2019

I am using only ExplodedWarTask#setWarFile along with TempDirectoryProvider as you did in #2069 and it works. I will modify the unit and integration tests and create a PR.

Read more comments on GitHub >

github_iconTop Results From Across the Web

gradle, Could not expand ZIP appcompat-v7:19.0.1
It seems the issue is with directories permissions . Check and try following things : Check whether you have write access on both...
Read more >
Error: Could not expand ZIP *.aar - Gradle Forums
Hello, I've received message trying to run my app in Android Studio. Hierarchy looks like -Project. –MyProjectCore. —build.gradle. –MyProjectMain.
Read more >
google/jib - Gitter
Hello! I'm trying to execute ./gradlew build jibDockerBuild for a Spring Boot app written in Kotlin, targeting Java 11, via the Jib Gradle...
Read more >
How to Solve Unable to Expand Zip File on Mac?
Click “Enter,” and it will then begin the unzipping process. For most cases, If the “No such directory Error” or “cannot find” message...
Read more >
Building Java containers with Jib - Google Cloud
Jib build flow: Diagram showing no intermediary stages from project to container registry using Jib. Jib organizes your application into distinct layers; ...
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