Codearte / gradle-nexus-staging-plugin

Automatize releasing Gradle projects to Maven Central.
Apache License 2.0
172 stars 26 forks source link

Fails to close/release #69

Closed pavolloffay closed 5 years ago

pavolloffay commented 6 years ago

Hi,

we are using this plugin and it seems that closing/releasing does not work.

Here is our configuration https://github.com/jaegertracing/jaeger-client-java/blob/master/build.gradle#L81

> Task :releaseRepository FAILED
POST request failed. 500: Server Error, body: [errors:[[id:*, msg:Unhandled: Repository: iojaegertracing-1018 has invalid state: open]]]

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':closeRepository'.
> Wrong 'iojaegertracing-1018' repository state 'open' after transition (expected [closed]). Possible staging rules violation. Check repository status using Nexus UI.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':releaseRepository'.
> 500: Server Error, body: [errors:[[id:*, msg:Unhandled: Repository: iojaegertracing-1018 has invalid state: open]]]

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================

* Get more help at https://help.gradle.org
szpak commented 6 years ago

It seems you have some open staging repositories in Nexus. As suggested in the error message, please login to Nexus, remove all staging repositories and try again. If occurred again, disable running tasks in parallel and try once more (of course purging staging repositories via UI again before that).

Somehow strange is that both tasks closeRepository and releaseRepository failed. They should not be executed in parallel. Can you provided a link to a Travis build (if available)?

szpak commented 6 years ago

I have found a Travis build in a referenced issue.

Attempt 51/51 failed. WrongNumberOfRepositories was thrown with message 'Wrong number of received repositories in state 'open'. Expected 1, received 8'. Giving up. Configure longer timeout if necessary.

Definitely remove open repositories from Nexus.

pavolloffay commented 6 years ago

@szpak thanks for looking into it.

I run into two problems:

szpak commented 6 years ago

Changing the IP address during one Travis build sounds suspicious for me. Can you:

or

In the second scenario:

  1. Build your artifacts (in parallel) - build task + whotever you need.
  2. Call upload and closeAndReleaseRepository in not parallel mode?

Of course remove old staging repositories from Nexus before.

yaolingling commented 6 years ago

@szpak I get one error when execute the command "gradle releaseRepository". The error message is as followings. _"Execution failed for task ':releaseRepository'.Wrong 'comdellisgsmi-1073' repository state 'closed' after transition (expected [released, notfound]). Possible staging rules violation. Check repository status using Nexus UI." Besides, the repository has been closed successfully. The lastest version: 0.11.0 of "gradle-nexus-staging-plugin" is used.

szpak commented 6 years ago

@yaolingling Closed (no more files can be added to that repo, prepared for release) is not the same as released (here, push to Maven Central public repo). Has the package visible in the Maven Central?

You can paste a link to public CI logs (if available).

yaolingling commented 6 years ago

@szpak, thanks for your reply. My issue has been resolved. The root cause of this issue is that the same version of jar can't be released to the nexus manager. Change the version of released jar.

szpak commented 6 years ago

@pavolloffay do you still have that problem?

pavolloffay commented 6 years ago

I think it was still present

szpak commented 6 years ago

@pavolloffay Could you try to disable parallel tasks execution (which may potentially cause more than one staging repository) with -Dorg.gradle.parallel=false for the ./gradlew upload task on Travis?

pavolloffay commented 5 years ago

We do not use parallel execution. I do not think this would make a difference.

pavolloffay commented 5 years ago

closing in favor of #76

szpak commented 5 years ago

Yes, now I know that the issue affects also a single treat execution even for a single module.