Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jib Build with insecure gitea repository doesn't work #47121

Open
Demmtop opened this issue Apr 1, 2025 · 5 comments
Open

Jib Build with insecure gitea repository doesn't work #47121

Demmtop opened this issue Apr 1, 2025 · 5 comments
Labels
area/container-image area/kubernetes kind/bug Something isn't working kind/bug-thirdparty Bugs that are caused by third-party components and not causing a major dysfunction of core Quarkus.

Comments

@Demmtop
Copy link

Demmtop commented Apr 1, 2025

Describe the bug

I use Quarkus 3.15.4 and Gitea action pipeline to build a docker image wit Jib. Jib build a wrong insecure repository URL.

This is my maven build:

mvn install -Pdev -DskipTests=true -DsendCredentialsOverHttp=true
-Dquarkus.application.version=${{gitea.ref_name}} 
-Dquarkus.container-image.build=true 
-Dquarkus.container-image.name=docker/user-rest 
-Dquarkus.container-image.tag=${{gitea.ref_name}} 
-Dquarkus.container-image.push=true 
-Dquarkus.container-image.insecure=true 
-Dquarkus.container-image.registry=gitea.demmtop.local 
-Dquarkus.container-image.username=XXX 
-Dquarkus.container-image.password=xxxx

And this is the answer from maven build:

[INFO] --- quarkus:3.15.4:build (default) @ user-rest ---
[WARNING] [io.quarkus.agroal.deployment.AgroalProcessor] The Agroal dependency is present but no JDBC datasources have been defined.
[WARNING] [io.quarkus.hibernate.orm.deployment.HibernateOrmProcessor] Hibernate ORM is disabled because no JPA entities were found
[INFO] [io.quarkus.kubernetes.deployment.PropertyUtil] Kubernetes manifests are generated with 'The container port http' having default value '8080'. The app and manifests will get out of sync if the property 'quarkus.http.port' is changed at runtime.
[INFO] [io.quarkus.container.image.jib.deployment.JibProcessor] Starting (local) container image build for jar using jib.
[WARNING] [io.quarkus.container.image.jib.deployment.JibProcessor] Base image 'registry.access.redhat.com/ubi8/openjdk-21-runtime:1.20' does not use a specific image digest - build may not be reproducible
[WARNING] [io.quarkus.container.image.jib.deployment.JibProcessor] Cannot verify server at https://gitea.demmtop.local/v2/. Attempting again with no TLS verification.
[WARNING] [io.quarkus.container.image.jib.deployment.JibProcessor] Cannot verify server at https://gitea.demmtop.local/v2/token?service=container_registry&scope=repository:root/docker/user-rest:pull,push. Attempting again with no TLS verification.
[INFO] [io.quarkus.container.image.jib.deployment.JibProcessor] Using base image with digest: sha256:8beb2186d175ec9cede987a467dfa3a1a0b6e6e2db508525d95436cf3f6afbc3
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  21.635 s
[INFO] Finished at: 2025-03-31T22:58:28+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.quarkus.platform:quarkus-maven-plugin:3.15.4:build (default) on project user-rest: Failed to build quarkus application: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[ERROR]     [error]: Build step io.quarkus.container.image.jib.deployment.JibProcessor#buildFromJar threw an exception: java.lang.RuntimeException: Unable to create container image
[ERROR]     at io.quarkus.container.image.jib.deployment.JibProcessor.containerize(JibProcessor.java:273)
[ERROR]     at io.quarkus.container.image.jib.deployment.JibProcessor.buildFromJar(JibProcessor.java:200)
[ERROR]     at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:733)
[ERROR]     at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:856)
[ERROR]     at io.quarkus.builder.BuildContext.run(BuildContext.java:256)
[ERROR]     at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
[ERROR]     at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2516)
[ERROR]     at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2495)
[ERROR]     at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1521)
[ERROR]     at java.base/java.lang.Thread.run(Thread.java:1583)
[ERROR]     at org.jboss.threads.JBossThread.run(JBossThread.java:483)
[ERROR] Caused by: com.google.cloud.tools.jib.registry.RegistryErrorException: Tried to push BLOB for gitea.demmtop.local/root/docker/user-rest with digest sha256:e156c76c7d86756efcdb1a8e08c25fb239738fc045e35a84328a87de0d18d174 but failed because: registry returned error code 404; possible causes include invalid or wrong reference. Actual error output follows:
[ERROR] Not found.
[ERROR] Caused by: com.google.api.client.http.HttpResponseException: 404 Not Found
[ERROR] POST https://gitea.demmtop.local/v2/root/docker/user-rest/blobs/uploads/
[ERROR] Not found

The generated Gitea URL is wrong: https://gitea.demmtop.local/v2/root/docker/user-rest
The generated Gitea URL is wrong: https://gitea.demmtop.local/root/docker/user-rest
The right Gitea URL is: http://gitea.demmtop.local/docker/user-rest
I believe the wrong URL is a Sonatype Nexus Repository URL

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

Start the maven build.

Output of uname -a or ver

No response

Output of java -version

JDK 21

Quarkus version or git rev

3.15.4

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

Copy link

quarkus-bot bot commented Apr 1, 2025

/cc @geoand (jib,kubernetes), @iocanel (kubernetes)

@geoand
Copy link
Contributor

geoand commented Apr 2, 2025

This seems to be Jib issue happens due to the auth functionality

@geoand geoand added the kind/bug-thirdparty Bugs that are caused by third-party components and not causing a major dysfunction of core Quarkus. label Apr 2, 2025
@Demmtop
Copy link
Author

Demmtop commented Apr 2, 2025

I would agree if the HTTP URL's were correct.
I have set the parameter quarkus.container-image.insecure=true but all URL's start with HTTPS.
And then I think that the structure of the URL's does not correspond to the Gitea documentation.

@gsmet
Copy link
Member

gsmet commented Apr 8, 2025

Maybe I'm missing something but I don't see these URLs generated by Quarkus itself.

I think you will have to attach a debugger in JibProcessor#createContainerizer() and figure out what's going on more precisely.

@geoand
Copy link
Contributor

geoand commented Apr 8, 2025

Yeah, that's exactly why I mentioned my previous comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/container-image area/kubernetes kind/bug Something isn't working kind/bug-thirdparty Bugs that are caused by third-party components and not causing a major dysfunction of core Quarkus.
Projects
None yet
Development

No branches or pull requests

3 participants