Skip to content

Flaky CI Failure: release-android publish — Sonatype staging repository stuck in 'closed' state #3896

Description

@github-actions

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:

  1. Duplicate version: If a nightly/dev build already published the same version to Maven Central, Sonatype rejects re-publication.
  2. Sonatype transient issue: Sonatype OSSRH occasionally has reliability problems with the promote/release API, leaving staging repos in limbo.
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions