xerial / sbt-sonatype

A sbt plugin for publishing Scala/Java projects to the Maven central.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Need a retry for 502 errors around bundle upload

xerial opened this issue · comments

Describe the bug
bundleUpload fails when sonatype API is returning 502

Example GH action log:
https://github.com/wvlet/airframe/runs/6703656439?check_suite_focus=true

2022-06-02 07:01:32.078Z  info [SonatypeClient] Uploading bundle /home/runner/work/airframe/airframe/sbt-airframe/target/sonatype-staging/22.6.1 to https://oss.sonatype.org/service/local/staging/deployByRepositoryId/orgwvlet-1415/  - (SonatypeClient.scala:297)
2022-06-02 07:01:35.056Z error [Sonatype] 
java.io.IOException: Failure:java.util.concurrent.ExecutionException: java.io.IOException: Unexpected server response: 502 Bad Gateway
	at org.sonatype.spice.zapper.internal.transport.AbstractChargerClient.doUpload(AbstractChargerClient.java:65)
	at org.sonatype.spice.zapper.internal.transport.AbstractClient.upload(AbstractClient.java:104)
	at org.sonatype.spice.zapper.internal.transport.AbstractClient.upload(AbstractClient.java:61)
	at xerial.sbt.sonatype.SonatypeClient.$anonfun$uploadBundle$2(SonatypeClient.scala:298)
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
	at scala.util.Try$.apply(Try.scala:213)
	at wvlet.airframe.control.Retry$RetryContext.runInternal(Retry.scala:269)
	at wvlet.airframe.control.Retry$RetryContext.run(Retry.scala:[25](https://github.com/wvlet/airframe/runs/6703656439?check_suite_focus=true#step:10:26)4)
	at xerial.sbt.sonatype.SonatypeClient.uploadBundle(SonatypeClient.scala:[27](https://github.com/wvlet/airframe/runs/6703656439?check_suite_focus=true#step:10:28)8)