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

Error: Faraday::Error::ParsingError n-1.6.7/lib/json/common.rb:149:in `parse': 757 #37

Closed
pkmishra opened this issue May 18, 2013 · 3 comments

Comments

@pkmishra
Copy link

Initially everything worked fine however after a while I am not able to do anything and getting following error with every command.
Using OSX 1.7.5

 (Faraday::Error::ParsingError)n-1.6.7/lib/json/common.rb:149:in `parse': 757: unexpected token at '<html>
<head><title>302 Found</title></head>
<body bgcolor="white">
<center><h1>302 Found</h1></center>
<hr><center>nginx</center>
</body>
</html>
'
        from /Library/Ruby/Gems/1.8/gems/json-1.6.7/lib/json/common.rb:149:in `parse'
        from /Library/Ruby/Gems/1.8/gems/faraday_middleware-0.9.0/lib/faraday_middleware/response/parse_json.rb:11
        from /Library/Ruby/Gems/1.8/gems/faraday_middleware-0.9.0/lib/faraday_middleware/response_middleware.rb:48:in `call'
        from /Library/Ruby/Gems/1.8/gems/faraday_middleware-0.9.0/lib/faraday_middleware/response_middleware.rb:48:in `parse'
        from /Library/Ruby/Gems/1.8/gems/faraday_middleware-0.9.0/lib/faraday_middleware/response_middleware.rb:39:in `process_response'
        from /Library/Ruby/Gems/1.8/gems/faraday_middleware-0.9.0/lib/faraday_middleware/response_middleware.rb:32:in `call'
        from /Library/Ruby/Gems/1.8/gems/faraday-0.8.7/lib/faraday/response.rb:63:in `on_complete'
        from /Library/Ruby/Gems/1.8/gems/faraday_middleware-0.9.0/lib/faraday_middleware/response_middleware.rb:30:in `call'
        from /Library/Ruby/Gems/1.8/gems/faraday-0.8.7/lib/faraday/response.rb:8:in `call'
        from /Library/Ruby/Gems/1.8/gems/faraday-0.8.7/lib/faraday/request/url_encoded.rb:14:in `call'
        from /Library/Ruby/Gems/1.8/gems/digital_ocean-1.0.1/lib/digital_ocean/authentication_middleware.rb:18:in `call'
        from /Library/Ruby/Gems/1.8/gems/faraday-0.8.7/lib/faraday/connection.rb:247:in `run_request'
        from /Library/Ruby/Gems/1.8/gems/faraday-0.8.7/lib/faraday/connection.rb:100:in `get'
        from /Library/Ruby/Gems/1.8/gems/digital_ocean-1.0.1/lib/digital_ocean/resource/droplet.rb:6:in `list'
        from /Library/Ruby/Gems/1.8/gems/tugboat-0.0.5/lib/tugboat/middleware/list_droplets.rb:8:in `call'
        from /Library/Ruby/Gems/1.8/gems/tugboat-0.0.5/lib/tugboat/middleware/inject_client.rb:14:in `call'
        from /Library/Ruby/Gems/1.8/gems/tugboat-0.0.5/lib/tugboat/middleware/check_configuration.rb:13:in `call'
        from /Library/Ruby/Gems/1.8/gems/tugboat-0.0.5/lib/tugboat/middleware/inject_configuration.rb:10:in `call'
        from /Library/Ruby/Gems/1.8/gems/middleware-0.1.0/lib/middleware/runner.rb:31:in `call'
        from /Library/Ruby/Gems/1.8/gems/middleware-0.1.0/lib/middleware/builder.rb:102:in `call'
        from /Library/Ruby/Gems/1.8/gems/tugboat-0.0.5/lib/tugboat/cli.rb:39:in `droplets'
        from /Library/Ruby/Gems/1.8/gems/thor-0.18.1/lib/thor/command.rb:27:in `__send__'
        from /Library/Ruby/Gems/1.8/gems/thor-0.18.1/lib/thor/command.rb:27:in `run'
        from /Library/Ruby/Gems/1.8/gems/thor-0.18.1/lib/thor/invocation.rb:120:in `invoke_command'
        from /Library/Ruby/Gems/1.8/gems/thor-0.18.1/lib/thor.rb:363:in `dispatch'
        from /Library/Ruby/Gems/1.8/gems/thor-0.18.1/lib/thor/base.rb:439:in `start'
        from /Library/Ruby/Gems/1.8/gems/tugboat-0.0.5/bin/tugboat:10
        from /usr/bin/tugboat:19:in `load'
        from /usr/bin/tugboat:19
@blom
Copy link
Collaborator

blom commented May 18, 2013

Thanks for reporting this!

API requests to https://api.digitalocean.com/ redirects to https://www.digitalocean.com/api/ now, and I think this is a recent change. I could not find documentation regarding it and opened a ticket with DigitalOcean. They confirmed the change and that it is permanent. The underlying library that Tugboat uses for communicating with DigitalOcean does not seem to support redirects.

I will update this ticket when things are functioning again.

@blom
Copy link
Collaborator

blom commented May 18, 2013

https://api.digitalocean.com/ no longer redirects and responds as before. It should be working again.

@blom
Copy link
Collaborator

blom commented May 18, 2013

DigitalOcean updated the ticket and said that they have reverted back to the original behaviour.

@blom blom closed this as completed May 18, 2013
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

No branches or pull requests

2 participants