Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

Publish fails with exception RestClient::InternalServerError #22

Closed
kyptin opened this issue Jan 8, 2014 · 5 comments
Closed

Publish fails with exception RestClient::InternalServerError #22

kyptin opened this issue Jan 8, 2014 · 5 comments

Comments

@kyptin
Copy link

kyptin commented Jan 8, 2014

I've been calling apiary publish for a while now, but it recently stopped working.

The command I use is:

apiary publish --api-name <redacted>

It now gives the following stack trace:

/Users/jeff/.rvm/gems/ruby-1.9.2-p136/gems/rest-client-1.6.7/lib/restclient/abstract_response.rb:48:in `return!': 500 Internal Server Error (RestClient::InternalServerError)
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p136/gems/rest-client-1.6.7/lib/restclient/request.rb:230:in `process_result'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p136/gems/rest-client-1.6.7/lib/restclient/request.rb:178:in `block in transmit'
    from /Users/jeff/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/net/http.rb:627:in `start'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p136/gems/rest-client-1.6.7/lib/restclient/request.rb:172:in `transmit'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p136/gems/rest-client-1.6.7/lib/restclient/request.rb:64:in `execute'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p136/gems/rest-client-1.6.7/lib/restclient/request.rb:33:in `execute'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p136/gems/rest-client-1.6.7/lib/restclient.rb:72:in `post'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p136/gems/apiaryio-0.0.8/lib/apiary/command/publish.rb:60:in `query_apiary'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p136/gems/apiaryio-0.0.8/lib/apiary/command/publish.rb:41:in `publish_on_apiary'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p136/gems/apiaryio-0.0.8/lib/apiary/command/publish.rb:29:in `execute'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p136/gems/apiaryio-0.0.8/lib/apiary/command/runner.rb:8:in `run'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p136/gems/apiaryio-0.0.8/lib/apiary/cli.rb:16:in `run'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p136/gems/apiaryio-0.0.8/lib/apiary/cli.rb:10:in `initialize'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p136/gems/apiaryio-0.0.8/bin/apiary:5:in `new'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p136/gems/apiaryio-0.0.8/bin/apiary:5:in `<top (required)>'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p136/bin/apiary:19:in `load'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p136/bin/apiary:19:in `<main>'

As you can tell from the stack trace, this is with Ruby version 1.9.2-p136 and Apiary gem version 0.0.8.

@kyptin
Copy link
Author

kyptin commented Jan 8, 2014

Hmm, I'm also getting a RestClient::BadRequest exception with apiary preview. I'm not sure whether it's related or a red herring, but I'll let you be the judge.

$ apiary preview
/Users/jeff/.rvm/gems/ruby-1.9.2-p136/gems/rest-client-1.6.7/lib/restclient/abstract_response.rb:48:in `return!': 400 Bad Request (RestClient::BadRequest)
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p136/gems/rest-client-1.6.7/lib/restclient/request.rb:230:in `process_result'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p136/gems/rest-client-1.6.7/lib/restclient/request.rb:178:in `block in transmit'
    from /Users/jeff/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/net/http.rb:627:in `start'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p136/gems/rest-client-1.6.7/lib/restclient/request.rb:172:in `transmit'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p136/gems/rest-client-1.6.7/lib/restclient/request.rb:64:in `execute'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p136/gems/rest-client-1.6.7/lib/restclient/request.rb:33:in `execute'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p136/gems/rest-client-1.6.7/lib/restclient.rb:72:in `post'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p136/gems/apiaryio-0.0.8/lib/apiary/command/preview.rb:76:in `query_apiary'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p136/gems/apiaryio-0.0.8/lib/apiary/command/preview.rb:92:in `block in generate_static'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p136/gems/apiaryio-0.0.8/lib/apiary/command/preview.rb:91:in `open'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p136/gems/apiaryio-0.0.8/lib/apiary/command/preview.rb:91:in `generate_static'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p136/gems/apiaryio-0.0.8/lib/apiary/command/preview.rb:37:in `show'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p136/gems/apiaryio-0.0.8/lib/apiary/command/preview.rb:29:in `execute'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p136/gems/apiaryio-0.0.8/lib/apiary/command/runner.rb:8:in `run'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p136/gems/apiaryio-0.0.8/lib/apiary/cli.rb:16:in `run'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p136/gems/apiaryio-0.0.8/lib/apiary/cli.rb:10:in `initialize'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p136/gems/apiaryio-0.0.8/bin/apiary:5:in `new'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p136/gems/apiaryio-0.0.8/bin/apiary:5:in `<top (required)>'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p136/bin/apiary:19:in `load'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p136/bin/apiary:19:in `<main>'

@Almad
Copy link
Contributor

Almad commented Jan 9, 2014

Hi,

this looks like problem with Apiary itself. I can confirm it and we'll take a look.

I'm closing this one as it's unrelated to apiary client, but I'll let you know once it's fixed.

If you'd write to support@apiary.io, it would be awesome as we can talk about particular API/blueprints should it be related (I don't think so in this case) and we'll let you know immediately after the fix.

@Almad Almad closed this as completed Jan 9, 2014
@kyptin
Copy link
Author

kyptin commented Jan 9, 2014

Thanks, Almad. I will email support.

You might consider changing the client to handle this case and print a more understandable error message to the user. Just an idea.

Thanks your work on this library, by the way—the "publish" feature has saved my team and me a lot of time and headache. :-)

@kyptin
Copy link
Author

kyptin commented Jan 13, 2014

For anybody encountering this issue in the future: my problem was invalid syntax. When I copied the contents of the apiary.apib file and pasted it into the "Blueprint" section of my Apiary site, it told me what the syntax error was. Once I fixed the issue, apiary publish worked fine.

@zdne
Copy link
Contributor

zdne commented Jan 13, 2014

@kyptin

For what it's worth: You can also validate your blueprints using http://apiblueprint.org or offline with the snowcrash command line tool.

Alternatively, if you are using Sublime Text 3 make sure to check out the /~https://github.com/apiaryio/api-blueprint-sublime-plugin plugin.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants