Google Cloud Build Maven Artifacts upload failing with 'Broken pipe'

We have a cloud build file that has uploads 4 rather large (75-100 Mb) Maven artifacts.

 

artifacts:
  mavenArtifacts:
    - repository: 'https://europe-maven.pkg.dev/our-project/releases'
      path: 'moduel/target/deploy/artifact-${_MVN_VERSION}.jar'
      artifact_id: 'artifact'
      group_id: 'io.trustbuilder'
      version: '${_MVN_VERSION}'

 

So far this has always worked well.

Since a few days we keep getting these messages

 

Uploading to remote-repository: https://europe-maven.pkg.dev/our-project/releases/io/trustbuilder/artifact/11-fff0dd1/artifact-11-fff0dd1.jar
Progress (1): 0/73 MB
Progress (1): 0.4/73 MB
                       
Uploading to remote-repository: https://europe-maven.pkg.dev/our-project//releases/io/trustbuilder/artifact/11-fff0dd1/artifact-11-fff0dd1.pom
Progress (1): 409 B
                   
Uploaded to remote-repository: https://europe-maven.pkg.dev/our-project/releases/io/trustbuilder/artifact/11-fff0dd1/artifact-11-fff0dd1.pom (409 B at 685 B/s)

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy-file (default-cli) on project tb-suite: Failed to deploy artifacts: Could not transfer artifact io.trustbuilder:artifact:jar:11-fff0dd1 from/to remote-repository (https://europe-maven.pkg.dev/our-project/releases): Broken pipe -> [Help 1]

 

Previously we have gotten similar errors (Broken pipe) if the repository is in 'Release' mode and the artifact already exists, however now we even get these on an empty repository.

So far we have been tinkering with the permissions, but to no avail. How can we find out what the cause of the 'Broken pipe' error is without access to the actual Maven repository server?

1 5 1,010
5 REPLIES 5

Hiย @brecht-y-tb,

Welcome to Google Cloud Community!

Upon checking your error message, there are several factors that result to broken pipe error:

  • Stable internet connection
  • Java/Maven versions are outdated

Here are some suggestions that could potentially fix this issue:

  • Switch to wired internet connection if you're using wireless
  • Update Java SDK/libraries to latest version
  • Verify that the full path of the image that you are pushing is correct.ย Run the following command to print the settings for the defaultย repository:
gcloud artifacts print-settings mvn

ย Make sure that the settings match yourย pom.xmlย file

  • Increase the timeout value on the client side.
  • Make sure the server is able to handle a large number of connections.
  • Verify that the server is not closing the connection prematurely.

You may refer to the links below as your reference:

If the above steps and references did not work, you may refer to this link onย reporting issues and requesting feature requests.

Hi,

As the client is the Google Cloud Build environment, and the server is Google Artifact Registry, I'm afraid there's not much I can do.

Furthermore, it works from my machine to Google Artifact Registry, but not from the Cloud Build environment.

I have created an issue. Thanks.

URE
Bronze 1
Bronze 1

Hi,

I have the same issue:
When executing "mvn deploy:deploy-file" inside a Docker container from my local machine it works.
But when executing inside a Docker container (using exactly the same Docker image) in a machine in the same region of the Artifact Registry, it fails.
It only fails with the artifacts of one product in this repository, other artifacts of other products in the same repository are working well.

Please, how can I follow the issue? Or how can I create another issue to solve that?

Thank you!

Finally, it was my fault. The error was in an environment variable.
Nothing to report.

Can you please explain which environment variable so that others can get benefit from your solution.