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

Better error message in case of HTTP request failure #5

Closed
szpak opened this issue Mar 6, 2015 · 12 comments
Closed

Better error message in case of HTTP request failure #5

szpak opened this issue Mar 6, 2015 · 12 comments
Milestone

Comments

@szpak
Copy link
Member

szpak commented Mar 6, 2015

No description provided.

@marcingrzejszczak
Copy link

Definite +1 :)

spock-subjects-collaborators-extension (master ⚡→=) ./gradlew closeRepository promoteRepository
Starting a new Gradle Daemon for this build (subsequent builds will be faster).
:closeRepository
POST response data: null
:promoteRepository FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':promoteRepository'.
> Unexpected state of reveived repository. Received open, expected closed

it turned out that I have forgotten to upload my public key but I had to access Nexus to check this out.

also this

POST response data: null

could be changed to sth like this

POST sent successfully

or sth like that - it might seem confusing for some people.

@szpak
Copy link
Member Author

szpak commented May 17, 2015

Thanks for your comment. I hope that REST response from Nexus contains that information (not only plain status 400...).

@szpak
Copy link
Member Author

szpak commented May 17, 2015

Btw, in the meaning in case of similar issues as a workaround you could use a --debug switch to display a complete HTTP communication with the server (it is very verbose, so redirecting to a file is recommended).

@szpak szpak modified the milestone: 0.6.0 Jun 23, 2015
@szpak
Copy link
Member Author

szpak commented Mar 31, 2016

In a case of 500 from the server (with HTML content) a message is also not very meaningful:

:myProject:promoteRepository
Error parsing 'text/html' response
groovy.json.JsonException: Unable to determine the current character, it is not a string, number, array, or object

The current character read is '<' with an int value of 60
Unable to determine the current character, it is not a string, number, array, or object
line number 1
index number 0
<html>
^

More details #15.

@deanhiller
Copy link

fixed in pull request #32

@marcingrzejszczak

I print the entire body, status code and status string and sonatype had some great error message in the body.

@marcingrzejszczak
Copy link

nice! :)

@bartoszwalacik
Copy link

Hi, guys, I'm trying to move my deployment process from bintray back to sonatype
but this error occurs:

Execution failed for task ':promoteRepository'.
> Unexpected state of reveived repository. Received open, expected closed

Sure that error message could be better but what is the roor cause, what I'm doing wrong?

https://travis-ci.org/javers/javers/builds/207844456

@bartoszwalacik
Copy link

ok, got it. I've copied this config from the hermes project and it helped. Looks like you need to adjust the defaults

nexusStaging {
    numberOfRetries = 10
    delayBetweenRetriesInMillis = 3000
}

@szpak
Copy link
Member Author

szpak commented Mar 5, 2017

@bartoszwalacik Have you read FAQ? :)

(Update: the problem described in FAQ is a little bit different - if you think it would be good to add your explicitly it can be done)

@szpak
Copy link
Member Author

szpak commented Mar 5, 2017

Btw, in a case of further problems running with --info can be useful to determine the source of your problem (by yourself). There is a plan to make it more clear even without enabling info logging - #34.

@szpak
Copy link
Member Author

szpak commented Mar 5, 2017

And yes, it will be adjusted: #12 (most likely in Q2 2017 just after 0.6.0 with rewritten backend will be finally released).

moaxcp added a commit to moaxcp/graph-dsl that referenced this issue Mar 6, 2017
moaxcp added a commit to moaxcp/graph-dsl that referenced this issue Mar 6, 2017
Following suggestions from [#5](Codearte/gradle-nexus-staging-plugin#5) to
fix nexus release issue
szpak added a commit that referenced this issue Mar 19, 2017
Also covered by tests.
@szpak szpak modified the milestones: 0.6.0, 0.7.0 Mar 19, 2017
@szpak
Copy link
Member Author

szpak commented Mar 19, 2017

Implemented in #32. Available in 0.6.0.

@szpak szpak closed this as completed Mar 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants