Paketo build-pack failing upon update - spring-boot

I have a quite simple Spring Boot app building Docker images for Azure. Probably Azure is not relevant to the problem. The image is built using the Spring Boot Gradle plugin, using the bootBuildImage task.
Now, suddenly, with otherwise unchanged code, the build started to fail:
> Task :backend:bootBuildImage FAILED
…
… Invalid response received when loading image "pack.local/builder/uxjmhhddud:latest"
The name of the image changes with each run, looks like a temporary intermediate image that cannot be read.
What causes this failure and what can be done about it?
Edit: More log context:
> Task :backend:bootBuildImage
Building image 'docker.io/library/backend:latest'
> Pulling builder image 'docker.io/paketobuildpacks/builder#sha256:edb18b93f138def92ada50bebdffa05983b13a5f5c4df6af75a40f2275d092ed' ..................................................
> Pulled builder image 'paketobuildpacks/builder#sha256:edb18b93f138def92ada50bebdffa05983b13a5f5c4df6af75a40f2275d092ed'
> Pulling run image 'docker.io/paketobuildpacks/run#sha256:c6a219b27b2009cf99d92bc4a667ceb81822074406809d6c87e3dce906349546' ..................................................
> Pulled run image 'paketobuildpacks/run#sha256:c6a219b27b2009cf99d92bc4a667ceb81822074406809d6c87e3dce906349546'
> Pulling buildpack image 'gcr.io/paketo-buildpacks/java-azure:latest' ..................................................
> Pulled buildpack image 'gcr.io/paketo-buildpacks/java-azure#sha256:704f74c1cc11cbe8cc5702a63cd77aa4c476d9051f022aabb7188bdc5e3fd2fc'
> Task :backend:bootBuildImage FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':backend:bootBuildImage'.
> Invalid response received when loading image "pack.local/builder/xojqjhijta:latest"

After ruling out Docker daemon problems or proxies and so on, I decided that perhaps the version of the Paketo builder is just buggy. And indeed, pinning the version to the last known good worked:
tasks.bootBuildImage {
// Pin version to known working
builder = "paketobuildpacks/builder#sha256:855aaa00a7eadca9c6cdba72550889f7c618c2bf1489c29fb9e7e01588665db7"
…
}
Newer runner and base images worked fine.

Related

Error code 20 when I execute bootBuildImage with APM (NewRelic) on CircleCI

I have a gradle based Spring Boot 3 application named "task-scheduler". I want to build a docker image of my application with NewRelic as APM service.
To do so, I added at the root of my project the folder platform/bindings/new-relic. In that folder, I created a type file and I put in it NewRelic.
Secondly, I modified the build.gradle by adding this :
tasks.named('bootBuildImage') {
buildpacks = ['urn:cnb:builder:paketo-buildpacks/java', 'gcr.io/paketo-buildpacks/new-relic']
bindings = [project.rootDir.absolutePath + '/platform/bindings/new-relic:/platform/bindings/new-relic']
}
When I launch the bootBuildImage task on my local machine, everything is ok but when CircleCI build it I have this error:
> Running creator
[creator] ===> ANALYZING
[creator] Previous image with name "******************/task-scheduler:preprod-20230201T141038Z" not found
[creator] ===> DETECTING
[creator] ERROR: No buildpack groups passed detection.
[creator] ERROR: Please check that you are running against the correct path.
[creator] ERROR: failed to detect: no buildpacks participating
> Task :bootBuildImage FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':bootBuildImage'.
> Builder lifecycle 'creator' failed with status code 20
Why I have this status code 20?

How to solve the problem with docker run while running image of Spring Boot App

I am new at Docker and trying to build and run my own container with Spring Boot Application. It runs on Kotlin and Gradle.
I have built the image with simply this command, provided by gradle with spring boot plugin (id("org.springframework.boot") version "2.7.0-SNAPSHOT")
gradlew bootBuildImage
As a result i am getting this. Here are the logs: https://pastebin.com/xMW82vcw
The problem is, while trying to run my built image i am getting this error.
C:\projects\monetka-app>docker run docker.io/library/monetka-app:0.0.1-SNAPSHOT
Setting Active Processor Count to 6
unable to determine class count
unable to walk /workspace
unable to open ZIP /workspace/META-INF/licenses/client-2.1.jar
read /workspace/META-INF/licenses/client-2.1.jar: is a directory
ERROR: failed to launch: exec.d: failed to execute exec.d file at path '/layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/memory-calculator': exit status 1
Here are the docker images i have locally
in docker desktop.
My gradle version is 7.4.1, and JDK in use is 17.
When you run gradlew bootBuildImage, you're using Cloud-Native buildpacks to generate the image. This is a bug in a tool installed by the buildpack.
The Java Cloud-Native buildpack will install a tool called memory-calculator. This tool runs prior to your application starting up and sets up all the JVM memory flags that are required to keep the JVM from going past the defined memory limit you set. For example, if you set the memory limit of your container to be 1G, the memory calculator will adjust settings like -Xmx accordingly.
To do this, the memory calculator needs to know how many class files you have in your application, so it searches for them. This process is failing because it sees something with an extension of .jar and so it's trying to read the number of class files in that JAR, however, what it's seeing META-INF/licenses/client-2.1.jar isn't actually a JAR. It's a directory.
I opened a bug report for you here: https://github.com/paketo-buildpacks/libjvm/issues/160
If you are able to remove the file META-INF/licenses/client-2.1.jar (or change so it doesn't have a .jar extension) you should be able to work around this until we can resolve the issue.

Gradle Jib : Additional build artifacts generated by Jib

I have a SpringBoot(2.6.2)/Gradle(7.3.3) application. I am using Jib(3.1.4) to create the docker image. After the image is created and pushed to the registry (successfully), my build would fail with this error -
java.nio.file.NoSuchFileException: <Project-Dir>\build\jib-image.digest
After much trial-and-error and some help from this documentation, I figured out how to make the error go away. What was needed on my build.gradle was this -
jib {
outputPaths.digest = "${buildDir}/jib-image.digest"
outputPaths.imageId = "${buildDir}/jib-image.id"
outputPaths.imageJson = "${buildDir}/jib-image.json"
}
This forces these files to be created in the specified directories.
My questions are -
What are these files?
Why is my build not able to create them under my project diretory (as is the default)?
Why don't I see any discussion on these files anywhere?
Is there another way to avoid this error?

Error Building APK build Error> Task :app:packageRelease FAILED

I am trying to generate android APK build, and I am getting different errors every time, from different libraries
for example here it says > Task :react-native-fast-image:mergeReleaseResources FAILED
after that I didn't do anything I just re-run ./gradlew clean && ./gradlew assembleRelease and it shows me different error
and I am in the loop since yesterday, any clue what's the problem or maybe solution?
This can be fixed by configuring the max heap size for your project.
Add this to your android/gradle.properties
org.gradle.jvmargs=-Xmx2560m
For more options prefer this.

Running mule application in MuleStudio

While running mule application in MuleStudio, I see 2 options.
Run As > Mule Application
Run As > Mule Application with Maven
I always used first option which worked fine, until a point of time when I defined maven filter. Using the first option the filters were not getting resolved, so I tried to run using second option which resulted in the following error --
[12:04:57] Starting build...
Error: Could not find or load main class local
I created a test project for sharing this problem and uploaded it on github https://github.com/hshira/mule-mvn-filter
pom.xml > https://github.com/hshira/mule-mvn-filter/blob/master/pom.xml
Please suggest me, what is the right way to resolve filters in MuleStudio.
FYI ... the filtered property is resolved correctly if I build on terminal using mvn command
it could be issue with maven setup on your local machine.

Resources