Flaky CI Failure: Sonatype staging repository stuck in 'closed' state
Workflow: Release
Failed run: https://github.com/xmtp/libxmtp/actions/runs/30073285144
Commit: 53bc30e
Failed jobs: release-android / publish
Summary
The release-android / publish job failed at the :releaseSonatypeStagingRepository Gradle task. The Sonatype staging repository was created and closed successfully, but the release step could not transition the repository from closed to released. According to the error message, this is commonly caused by a Nexus validation rule violation (e.g., attempting to publish artifacts with the same version again) or an unexpected Sonatype service issue.
Error Details
> Task :releaseSonatypeStagingRepository FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':releaseSonatypeStagingRepository'.
> Staging repository is not in desired state [released, not_found]:
StagingRepository(id=***--49917875-78ca-4c55-9272-5940bbfc63fb, state=closed, transitioning=false).
It is unexpected. Please check the Nexus logs using its web interface - it can be caused by
validation rules violation (e.g. publishing artifacts with the same version again). If not,
please report it to https://github.com/gradle-nexus/publish-plugin/issues/ with the '--info' logs.
BUILD FAILED in 2m 38s
The staging repository was created successfully earlier in the build:
> Task :initializeSonatypeStagingRepository
Created staging repository '***--49917875-78ca-4c55-9272-5940bbfc63fb' at
https://ossrh-staging-api.central.sonatype.com/service/local/repositories/.../content/
Analysis
This is a release pipeline failure (not a test/code failure). All build and publication tasks succeeded (compile, test, assemble, sign, upload to staging). The failure occurred only at the final :releaseSonatypeStagingRepository step — the staging repository was closed but could not be promoted to released.
Root cause candidates:
- Duplicate version: If a nightly/dev build already published the same version to Maven Central, Sonatype rejects re-publication.
- Sonatype transient issue: Sonatype OSSRH occasionally has reliability problems with the promote/release API, leaving staging repos in limbo.
- Validation rule violation: The artifact set may be missing required metadata or have a structural issue only caught at the release gate.
Checking the Sonatype OSSRH web interface for the staging repository ***--49917875-78ca-4c55-9272-5940bbfc63fb would reveal the specific validation failure reason.
Reported by Flaky Failure Watcher
Flaky CI Failure: Sonatype staging repository stuck in 'closed' state
Workflow: Release
Failed run: https://github.com/xmtp/libxmtp/actions/runs/30073285144
Commit: 53bc30e
Failed jobs: release-android / publish
Summary
The
release-android / publishjob failed at the:releaseSonatypeStagingRepositoryGradle task. The Sonatype staging repository was created and closed successfully, but the release step could not transition the repository fromclosedtoreleased. According to the error message, this is commonly caused by a Nexus validation rule violation (e.g., attempting to publish artifacts with the same version again) or an unexpected Sonatype service issue.Error Details
The staging repository was created successfully earlier in the build:
Analysis
This is a release pipeline failure (not a test/code failure). All build and publication tasks succeeded (compile, test, assemble, sign, upload to staging). The failure occurred only at the final
:releaseSonatypeStagingRepositorystep — the staging repository was closed but could not be promoted toreleased.Root cause candidates:
Checking the Sonatype OSSRH web interface for the staging repository
***--49917875-78ca-4c55-9272-5940bbfc63fbwould reveal the specific validation failure reason.Reported by Flaky Failure Watcher