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

Staging repository is not in desired state (not_found): StagingRepository(id=orgpostgresql-1612804902325, state=released, transitioning=false) #52

Closed
vlsi opened this issue Feb 8, 2021 · 7 comments · Fixed by #53
Assignees
Milestone

Comments

@vlsi
Copy link
Contributor

vlsi commented Feb 8, 2021

I've the following (I use https://github.com/vlsi/nexus-stub as a poorman's Nexus).

Are you sure state=release, transitioning=false is not valid state for Nexus as it promotes a staging repository?

AFAIK GNSP required either not_found or released state (see (expected [released, not_found]) in Codearte/gradle-nexus-staging-plugin#110 (comment) )

publish-plugin:

    Execution failed for task ':releaseNexusStagingRepository':
        io.github.gradlenexus.publishplugin.RepositoryTransitionException: Staging repository is not in desired state (not_found): StagingRepository(id=orgpostgresql-1612804902325, state=released, transitioning=false). It is unexpected. Please checkNexus logs using its web interface - it can be caused by validation rules violation. If not, please report it to https://github.com/gradle-nexus/publish-plugin/issues/ with '--info' logs
            at io.github.gradlenexus.publishplugin.internal.StagingRepositoryTransitioner.assertRepositoryInDesiredState(StagingRepositoryTransitioner.kt:62)
            at io.github.gradlenexus.publishplugin.internal.StagingRepositoryTransitioner.effectivelyChangeState(StagingRepositoryTransitioner.kt:42)
            at io.github.gradlenexus.publishplugin.internal.StagingRepositoryTransitioner.effectivelyRelease(StagingRepositoryTransitioner.kt:35)
            at io.github.gradlenexus.publishplugin.ReleaseNexusStagingRepository.transitionStagingRepo(ReleaseNexusStagingRepository.kt:40)
            at io.github.gradlenexus.publishplugin.AbstractTransitionNexusStagingRepositoryTask.transitionStagingRepo(AbstractTransitionNexusStagingRepositoryTask.kt:66)
            at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:104)
            at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:58)
            at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:51)
            at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:29)
@vlsi
Copy link
Contributor Author

vlsi commented Feb 8, 2021

See Codearte/gradle-nexus-staging-plugin#37 for autoDropAfterRelease.
However, it is not clear if release+drop should be atomic or not.
If release and drop are handled separately, then it might be possible to observe the repository in state=release, transitioning=false state.

@marcphilipp marcphilipp added this to the 0.1.0 milestone Feb 8, 2021
@marcphilipp
Copy link
Member

@szpak Could you please take a look?

@szpak
Copy link
Contributor

szpak commented Feb 8, 2021

When I was writing that code the Nexus API v2 documentation was quite poor. AFAIR, I needed to take a look in the source code of a Maven counterpart plugin to use some features (e.g. autoDrop). Most likely, I had a reason to implement it that way and your case tends to confirm that. I will tweak the implementation in GNPP.

And thanks for the report :-).

@vlsi
Copy link
Contributor Author

vlsi commented Feb 8, 2021

I needed to take a look in the source code of a Maven counterpart plugin

I'm afraid Maven plugin uses "the official Nexus client" which has closed sources.

@szpak
Copy link
Contributor

szpak commented Feb 8, 2021

I'm afraid Maven plugin uses "the official Nexus client" which has closed sources.

AFAIR, in the past, only the crucial part communicating to Nexus was closed source, not the whole plugin. Nevertheless, that didn't stop me from getting some knowledge from that project ;-).

@goncalossilva
Copy link

goncalossilva commented May 16, 2021

I'm facing a similar issue in a Kotlin Multiplatform project, using version 1.1.0 of the plugin. It is built and released simultaneously across 3 different hosts (Linux/macOS/Windows). They all fail late in the process with a similar message, for example:

> Task :publishToSonatype
> Task :closeSonatypeStagingRepository

> Task :releaseSonatypeStagingRepository FAILED

FAILURE: Build failed with an exception.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

Use '--warning-mode all' to show the individual deprecation warnings.
* What went wrong:
See docs.gradle.org/7.0.2/userguide/command_line_interface.html#sec:command_line_warnings
Execution failed for task ':releaseSonatypeStagingRepository'.

> Staging repository is not in desired state [released, not_found]: StagingRepository(id=comdoist-1024, state=closed, transitioning=false). It is unexpected. Please checkNexus logs using its web interface - it can be caused by validation rules violation. If not, please report it to gradle-nexus/publish-plugin/issues with '--info' logs
Execution optimizations have been disabled for 7 invalid unit(s) of work during this build to ensure correctness.

When I check Nexus, they show up as closed, and after a few seconds, they are released. The workflow itself is very basic. Configuration too [1] [2].

Can there be a race condition, or is this misconfiguration on my part?

@szpak
Copy link
Contributor

szpak commented May 16, 2021

Updated. I created a separate issue as it is not directly related to the already fixed case originally reported here. @goncalossilva, please put your reply there.

This issue was closed.
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

Successfully merging a pull request may close this issue.

4 participants