Hi team, we encountered `connection reset` error o...
# troubleshoot
b
Hi team, we encountered
connection reset
error occasionally (not all the time) during image build in our CI pipeline, like below.
Copy code
#12 1469. * What went wrong:
#12 1469. Execution failed for task ':datahub-frontend:compilePlayBinaryScala'.
#12 1469. > Could not resolve all files for configuration ':datahub-frontend:play'.
#12 1469.    > Could not download javax.ws.rs-api.jar (<http://javax.ws.rs:javax.ws.rs-api:2.0.1|javax.ws.rs:javax.ws.rs-api:2.0.1>)
#12 1469.       > Could not get resource '<https://plugins.gradle.org/m2/javax/ws/rs/javax.ws.rs-api/2.0.1/javax.ws.rs-api-2.0.1.jar>'.
#12 1469.          > Could not GET '<https://plugins.gradle.org/m2/javax/ws/rs/javax.ws.rs-api/2.0.1/javax.ws.rs-api-2.0.1.jar>'.
#12 1469.             > Connection reset
#12 1469.    > Could not download scala-reflect.jar (org.scala-lang:scala-reflect:2.11.12)
#12 1469.       > Could not get resource '<https://plugins.gradle.org/m2/org/scala-lang/scala-reflect/2.11.12/scala-reflect-2.11.12.jar>'.
#12 1469.          > Could not GET '<https://plugins.gradle.org/m2/org/scala-lang/scala-reflect/2.11.12/scala-reflect-2.11.12.jar>'.
#12 1469.             > Connection reset
#12 1469.    > Could not download jta.jar (javax.transaction:jta:1.1)
#12 1469.       > Could not get resource '<https://plugins.gradle.org/m2/javax/transaction/jta/1.1/jta-1.1.jar>'.
#12 1469.          > Could not GET '<https://repo.gradle.org/artifactory/jcenter/javax/transaction/jta/1.1/jta-1.1.jar>'.
#12 1469.             > Connection reset
#12 1469.    > Could not download osgi-resource-locator.jar (org.glassfish.hk2:osgi-resource-locator:1.0.1)
#12 1469.       > Could not get resource '<https://plugins.gradle.org/m2/org/glassfish/hk2/osgi-resource-locator/1.0.1/osgi-resource-locator-1.0.1.jar>'.
#12 1469.          > Could not GET '<https://repo.gradle.org/artifactory/jcenter/org/glassfish/hk2/osgi-resource-locator/1.0.1/osgi-resource-locator-1.0.1.jar>'.
#12 1469.             > Connection reset
I shared same issue before here. It was similarly reported in this GitHub issue from Gradle project. Before Gradle 6.6,
connection reset
error (or
SocketException
) was not retried and this could easily cause the build to fail. As such, I try to upgrade Gradle from current 5.6.4 to 6.7 to see if it could fix this issue. I ran below cmd to upgrade.
Copy code
./gradlew wrapper --gradle-version 6.7
However, the 4 image build jobs for gms, mae-consumer, mce-consumer, and datahub-frontend all failed with below error when i run with Gradle 6.7.
Copy code
#12 1064. FAILURE: Build failed with an exception.
#12 1064. 
#12 1064. * What went wrong:
#12 1064. Execution failed for task ':metadata-events:mxe-schemas:changedFilesReport'.
#12 1064. > You must declare outputs or use `TaskOutputs.upToDateWhen()` when using the incremental task API
#12 1064.
I am not so familiar with Gradle. Does anyone happen to have some idea how to fix it? I couldn’t find
changedFilesReport
task in any
build.gradle
files in datahub repo.
g
Hey @boundless-student-48844 - i looked into this briefly and it seems like the changedFileReport task is getting pulled in our restli build step from the restli repo: https://github.com/linkedin/rest.li/blob/eb9e0f48162ee2017b40cbcc5f0798dc1848df19/[…]ns/src/main/java/com/linkedin/pegasus/gradle/PegasusPlugin.java
looking at the gradle upgrade from 5->6 guide, they talk about this error a bit:
Copy code
Declaring an incremental task without outputs
Declaring an incremental task without declaring outputs is now deprecated. Declare file outputs or use TaskOutputs.upToDateWhen() instead.

This will become an error in Gradle 6.0.
I think we would need to create a PR on the PegasusPlugin file to update the outputs using TaskOutputs.upToDateWhen() in order to get around this issue.
Hey @boundless-student-48844 great news turns out we have a commit that was just merged that upgrades to gradle 6!
we’re saved 🙌
b
wow!!! that’s truly fabulous. i pulled the master branch and tried the build in our CI pipeline. Issue is gone! Thanks Gabe happy ghost
g
Gotta love it when life works out like that!
💯 1
b
Haha exactly!! was really such a luck