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

Duplicate put requests to registry trigger errors #4291

Open
jtama opened this issue Jul 16, 2024 · 3 comments
Open

Duplicate put requests to registry trigger errors #4291

jtama opened this issue Jul 16, 2024 · 3 comments

Comments

@jtama
Copy link

jtama commented Jul 16, 2024

Environment:

  • Jib version: Jib core 0.27.0
  • Build tool: maven 3.9.1
  • OS: Ubuntu 22.04.4 LTS (in a container)

Description of the issue:
During our ci pipeline, we have an error occuring randomly. Jib triggers the same patch request which generates an error.

We know that the first patch takes a bit long to (1m12s) successfully process, but in the mean time Jib sends a second patch requests. This second request is the one that generates an error.

Expected behavior:

Should ends up fine.

Steps to reproduce:

Unable to reproduce surely the error.

Log output:

Mon, 01 Jul 2024 09:05:44 GMT Caused by: com.google.cloud.tools.jib.http.ResponseException: 404 Not Found
Mon, 01 Jul 2024 09:05:44 GMT PATCH https://.................../blobs/uploads/f7b334b6-be1f-4bfc-bd12-ca739c994a9b?_state=Z4RE2P18shUE5tW_Pk_XmXKYTOAtUlOoUA_G5isOd3l7Ik5hbWUiOiJwcm92b2x5L2RhdGEtdmlydCIsIlVVSUQiOiJmN2IzMzRiNi1iZTFmLTRiZmMtYmQxMi1jYTczOWM5OTRhOWIiLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjQtMDctMDFUMDk6MDQ6MTUuMTQ1NTc4NzcxWiJ9
Mon, 01 Jul 2024 09:05:44 GMT {"errors":[{"code":"BLOB_UPLOAD_INVALID","message":"blob upload invalid"}]}
Mon, 01 Jul 2024 09:05:44 GMT
Mon, 01 Jul 2024 09:05:44 GMT at com.google.cloud.tools.jib.http.FailoverHttpClient.call(FailoverHttpClient.java:355)
Mon, 01 Jul 2024 09:05:44 GMT at com.google.cloud.tools.jib.http.FailoverHttpClient.call(FailoverHttpClient.java:266)
Mon, 01 Jul 2024 09:05:44 GMT at com.google.cloud.tools.jib.registry.RegistryEndpointCaller.call(RegistryEndpointCaller.java:138)
Mon, 01 Jul 2024 09:05:44 GMT ... 48 more
Mon, 01 Jul 2024 09:05:44 GMT Caused by: com.google.api.client.http.HttpResponseException: 404 Not Found
Mon, 01 Jul 2024 09:05:44 GMT PATCH https://........................./blobs/uploads/f7b334b6-be1f-4bfc-bd12-ca739c994a9b?_state=Z4RE2P18shUE5tW_Pk_XmXKYTOAtUlOoUA_G5isOd3l7Ik5hbWUiOiJwcm92b2x5L2RhdGEtdmlydCIsIlVVSUQiOiJmN2IzMzRiNi1iZTFmLTRiZmMtYmQxMi1jYTczOWM5OTRhOWIiLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjQtMDctMDFUMDk6MDQ6MTUuMTQ1NTc4NzcxWiJ9
Mon, 01 Jul 2024 09:05:44 GMT {"errors":[{"code":"BLOB_UPLOAD_INVALID","message":"blob upload invalid"}]}
Mon, 01 Jul 2024 09:05:44 GMT
Mon, 01 Jul 2024 09:05:44 GMT at com.google.api.client.http.HttpResponseException$Builder.build(HttpResponseException.java:293)
Mon, 01 Jul 2024 09:05:44 GMT at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1118)
Mon, 01 Jul 2024 09:05:44 GMT at com.google.cloud.tools.jib.http.FailoverHttpClient.call(FailoverHttpClient.java:349)
Mon, 01 Jul 2024 09:05:44 GMT ... 50 more

Additional Information: The registry is a privately managed harbor

@chanseokoh
Copy link
Member

chanseokoh commented Jul 16, 2024

I don't think they are duplicate PATCH requests. It's just that Jib does concurrent blob uploads. I think for whatever reason, the harbor registry sometimes fails to handle concurrent uploads correctly. I guess retrying Jib in a loop or even completely disabling concurrency in Jib (slow, of course, particularly bad for first-time build and uploads) would be a workaround.

@ddittmar
Copy link

I don't think they are duplicate PATCH requests. It's just that Jib does concurrent blob uploads. I think for whatever reason, the harbor registry sometimes fails to handle concurrent uploads correctly. I guess retrying Jib in a loop or even disabling concurrency in Jib (slow, of course, particularly for initial uploads) would be a workaround.

Hi @chanseokoh ... I think this looks like the problem we have too. I could not find howto "disable concurrency" in Jib.

@chanseokoh
Copy link
Member

chanseokoh commented Jul 18, 2024

@ddittmar to disable Jib concurrency, set the system property jib.serialize to false, like -Djib.serialize=false on the command line. See this example. Note it's a system property only; no Maven or Gradle configuration for this Jib system property.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants