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

Timeout Exception in sbt-sonatype plugin causes release failure to Sonatype Central #518

Open
j5ik2o opened this issue Sep 27, 2024 · 1 comment

Comments

@j5ik2o
Copy link
Contributor

j5ik2o commented Sep 27, 2024

Describe the bug
The sbt-sonatype plugin is failing to release artifacts to Sonatype Central due to a timeout exception. The plugin does not properly handle sttp.client4.SttpClientException$TimeoutException, causing the release process to fail.

How to reproduce the issue

  1. Set up a project with sbt-sonatype plugin configured for release to Sonatype Central.
  2. Attempt to release artifacts using sbt -v ci-release.
  3. The process fails with a sttp.client4.SttpClientException$TimeoutException.
  • sbt version: 1.9.8
  • sbt-sonatype version: 3.11.3
  • sbt-ci-release version: 1.6.1
  • Show your build settings:
$ sbt
sbt:akka-persistence-dynamodb-root> sonatypeProfileName
[info] snapshot-base / sonatypeProfileName
[info]  io.github.j5ik2o
[info] state-v2 / sonatypeProfileName
[info]  io.github.j5ik2o
[info] snapshot-v2 / sonatypeProfileName
[info]  io.github.j5ik2o
[info] benchmark / sonatypeProfileName
[info]  io.github.j5ik2o
[info] example / sonatypeProfileName
[info]  io.github.j5ik2o
[info] test / sonatypeProfileName
[info]  io.github.j5ik2o
[info] base / sonatypeProfileName
[info]  io.github.j5ik2o
[info] snapshot-v1 / sonatypeProfileName
[info]  io.github.j5ik2o
[info] journal-v1 / sonatypeProfileName
[info]  io.github.j5ik2o
[info] journal-base / sonatypeProfileName
[info]  io.github.j5ik2o
[info] state-v1 / sonatypeProfileName
[info]  io.github.j5ik2o
[info] base-v1 / sonatypeProfileName
[info]  io.github.j5ik2o
[info] journal-v2 / sonatypeProfileName
[info]  io.github.j5ik2o
[info] state-base / sonatypeProfileName
[info]  io.github.j5ik2o
[info] base-v2 / sonatypeProfileName
[info]  io.github.j5ik2o
[info] sonatypeProfileName
[info]  io.github.j5ik2o

sbt:akka-persistence-dynamodb-root> sonatypeRepository
[info] snapshot-base / sonatypeRepository
[info]  https://central.sonatype.com/service/local
[info] state-v2 / sonatypeRepository
[info]  https://central.sonatype.com/service/local
[info] snapshot-v2 / sonatypeRepository
[info]  https://central.sonatype.com/service/local
[info] benchmark / sonatypeRepository
[info]  https://central.sonatype.com/service/local
[info] example / sonatypeRepository
[info]  https://central.sonatype.com/service/local
[info] test / sonatypeRepository
[info]  https://central.sonatype.com/service/local
[info] base / sonatypeRepository
[info]  https://central.sonatype.com/service/local
[info] snapshot-v1 / sonatypeRepository
[info]  https://central.sonatype.com/service/local
[info] journal-v1 / sonatypeRepository
[info]  https://central.sonatype.com/service/local
[info] journal-base / sonatypeRepository
[info]  https://central.sonatype.com/service/local
[info] state-v1 / sonatypeRepository
[info]  https://central.sonatype.com/service/local
[info] base-v1 / sonatypeRepository
[info]  https://central.sonatype.com/service/local
[info] journal-v2 / sonatypeRepository
[info]  https://central.sonatype.com/service/local
[info] state-base / sonatypeRepository
[info]  https://central.sonatype.com/service/local
[info] base-v2 / sonatypeRepository
[info]  https://central.sonatype.com/service/local
[info] sonatypeRepository
[info]  https://central.sonatype.com/service/local

Additional context
The error occurs during the status check of the deployment. The current implementation does not properly handle timeout exceptions, causing the release process to fail. The error stack trace shows multiple recursive calls to didDeploySucceed, suggesting that the retry logic may be implemented inefficiently.

Error log snippet:

08:56:05.635 [main] ERROR sttp.client4.logging.slf4j.Slf4jLoggingBackend - Exception when sending request: POST https://central.sonatype.com/api/v1/publisher/status?id=dfc06ac3-f563-47f8-8381-f6037780f0c8, took: 5.103s
sttp.client4.SttpClientException$TimeoutException: Exception when sending request: POST https://central.sonatype.com/api/v1/publisher/status?id=dfc06ac3-f563-47f8-8381-f6037780f0c8

https://github.com/j5ik2o/akka-persistence-dynamodb/actions/runs/11067138584/job/30750697491#step:5:945

The current implementation in SonatypeCentralClient class does not explicitly handle SttpClientException$TimeoutException, leading to unhandled timeouts and failed releases.

@j5ik2o
Copy link
Contributor Author

j5ik2o commented Sep 30, 2024

Regarding the workaround for the bug:
I was able to avoid the Read Timeout by using the following command:

sbt -Dsun.net.client.defaultReadTimeout=60000 -v ci-release

This successfully circumvents the timeout issue.

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

No branches or pull requests

1 participant