gradle / gradle/plugin-portal-requests

Publication fails with java.io.IOException: Error writing to server (for larger plugin payloads?)

Open
#150 0 comments 0 reactions 0 assignees View on GitHub
a:bug publishing-plugin
Dominant language
No language data
Stars
15
Forks
6
PR merge metrics
No merged PRs in 30d

Description

Sometimes, plugin publication fails with `java.io.IOException: Error writing to server`. Other reports in the wild suggest this may be due to payload size and failing to enabling chunking in HttpURLConnection. See:
* https://support.sonatype.com/hc/en-us/articles/218101688-Ivy-deploy-fails-intermittently-with-java-io-IOException-Error-writing-to-server- and
* https://issues.apache.org/jira/browse/IVY-1197

Even though the cause is likely different, it has similar symptoms to https://github.com/gradle/gradle/issues/14193 and #116 (user can no longer republish, as even though publication failed, we end up with partial changes committed to the database). I will not cover that aspect of the failure mode, as #116 covers that already.

### Expected Behavior

Plugin publication succeeds, or is rejected with a helpful error message ("Plugin file is too large, limit is XYZ").

### Current Behavior

Plugin publication fails with:

```
java.io.IOException: Error writing to server
at com.gradle.publish.upload.Uploader.putStream(Uploader.java:28)
at com.gradle.publish.upload.Uploader.putFile(Uploader.java:14)
at com.gradle.publish.PortalPublisher.uploadArtifactIfNecessary(PortalPublisher.java:122)
at com.gradle.publish.PortalPublisher.publishArtifacts(PortalPublisher.java:113)
at com.gradle.publish.PortalPublisher.publishToPortal(PortalPublisher.java:56)
at com.gradle.publish.PublishTask.publish(PublishTask.java:78)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:104)
... 119 more
```

### Context

User is unable to publish a plugin.

### Steps to Reproduce

Seems to be related to plugin payload size (user's plugin payload size was 90mb).

### Your Environment

Full stacktrace attached.

[plugin-portal-requests-150.txt](https://github.com/gradle/plugin-portal-requests/files/8952780/plugin-portal-requests-150.txt)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.