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

Artifact Upload with PackageBuildOutputs fails for OSS Nexus #237

Closed
M-DLB opened this issue Apr 15, 2024 · 0 comments · Fixed by #242
Closed

Artifact Upload with PackageBuildOutputs fails for OSS Nexus #237

M-DLB opened this issue Apr 15, 2024 · 0 comments · Fixed by #242

Comments

@M-DLB
Copy link
Collaborator

M-DLB commented Apr 15, 2024

It seems the OSS version of nexus only supports HTTP 1.1, which creates a problem when uploading:

** Uploading /u/ado/workspace/MortgageApplication/main/build-20240329.2/logs/build.20240329.171134.816.tar to http://10.3.20.96:28081/repository/testMD/null/build.20240329.171134.816/build.20240329.171134.816.tar...
Caught: java.util.concurrent.ExecutionException: java.io.IOException: HTTP/1.1 header parser received no bytes                         java.util.concurrent.ExecutionException: java.io.IOException: HTTP/1.1 header parser received no bytes
        at ArtifactRepositoryHelpers.upload(ArtifactRepositoryHelpers.groovy:78)                                                               at PackageBuildOutputs.run(PackageBuildOutputs.groovy:459)
Caused by: java.io.IOException: HTTP/1.1 header parser received no bytes
Caused by: java.io.IOException: EDC5140I Broken pipe.

The solution is to force the HTTPClient to use HTTP 1.1 (version parameter of the Request builder):

    HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("$url"))
    .version(HttpClient.Version.HTTP_1_1)    
    .header("Content-Type", "binary/octet-stream")
    .header("Connection","Keep-Alive")
    .PUT(BodyPublishers.ofFile(Paths.get(fileName)))
    .build();

Is it possible to implement this mechanism via a command-line flag?

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

Successfully merging a pull request may close this issue.

1 participant