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

Retrieving content types throws an HTTP connection error #213

Closed
svignara opened this issue May 1, 2020 · 1 comment
Closed

Retrieving content types throws an HTTP connection error #213

svignara opened this issue May 1, 2020 · 1 comment

Comments

@svignara
Copy link

svignara commented May 1, 2020

Trying to follow along with the readme and the official documentation for retrieving content types by ID. I have this code:

@content_type = client.content_types('<space_id_of_our_space>', 'development').find('<id_of_our_content_type>')

But I'm getting the following error and error trace:

HTTP::ConnectionError: error reading from socket: Could not parse data
/.gem/ruby/2.6.5/gems/http-4.2.0/lib/http/response/parser.rb:31:in `add'
/.gem/ruby/2.6.5/gems/http-4.2.0/lib/http/connection.rb:217:in `read_more'
/.gem/ruby/2.6.5/gems/http-4.2.0/lib/http/connection.rb:103:in `read_headers!'
/.gem/ruby/2.6.5/gems/http-4.2.0/lib/http/client.rb:75:in `perform'
/.gem/ruby/2.6.5/gems/http-4.2.0/lib/http/client.rb:31:in `request'
/.gem/ruby/2.6.5/gems/http-4.2.0/lib/http/chainable.rb:20:in `get'
/.gem/ruby/2.6.5/gems/contentful-management-2.11.0/lib/contentful/management/client.rb:496:in `public_send'
/.gem/ruby/2.6.5/gems/contentful-management-2.11.0/lib/contentful/management/client.rb:496:in `http_send'
/.gem/ruby/2.6.5/gems/contentful-management-2.11.0/lib/contentful/management/client.rb:442:in `block in get'
/.gem/ruby/2.6.5/gems/contentful-management-2.11.0/lib/contentful/management/client.rb:386:in `execute_request'
/.gem/ruby/2.6.5/gems/contentful-management-2.11.0/lib/contentful/management/client.rb:441:in `get'
/.gem/ruby/2.6.5/gems/contentful-management-2.11.0/lib/contentful/management/request.rb:41:in `get'
/.gem/ruby/2.6.5/gems/contentful-management-2.11.0/lib/contentful/management/resource_requester.rb:71:in `get'
/.gem/ruby/2.6.5/gems/contentful-management-2.11.0/lib/contentful/management/resource_requester.rb:19:in `find'
/.gem/ruby/2.6.5/gems/contentful-management-2.11.0/lib/contentful/management/resource.rb:241:in `find'
/.gem/ruby/2.6.5/gems/contentful-management-2.11.0/lib/contentful/management/client_association_methods_factory.rb:33:in `find'

Caused by:
IOError: Could not parse data
/.gem/ruby/2.6.5/gems/http-4.2.0/lib/http/response/parser.rb:31:in `add'
/.gem/ruby/2.6.5/gems/http-4.2.0/lib/http/connection.rb:217:in `read_more'
/.gem/ruby/2.6.5/gems/http-4.2.0/lib/http/connection.rb:103:in `read_headers!'
/.gem/ruby/2.6.5/gems/http-4.2.0/lib/http/client.rb:75:in `perform'
/.gem/ruby/2.6.5/gems/http-4.2.0/lib/http/client.rb:31:in `request'
/.gem/ruby/2.6.5/gems/http-4.2.0/lib/http/chainable.rb:20:in `get'
/.gem/ruby/2.6.5/gems/contentful-management-2.11.0/lib/contentful/management/client.rb:496:in `public_send'
/.gem/ruby/2.6.5/gems/contentful-management-2.11.0/lib/contentful/management/client.rb:496:in `http_send'
/.gem/ruby/2.6.5/gems/contentful-management-2.11.0/lib/contentful/management/client.rb:442:in `block in get'
/.gem/ruby/2.6.5/gems/contentful-management-2.11.0/lib/contentful/management/client.rb:386:in `execute_request'
/.gem/ruby/2.6.5/gems/contentful-management-2.11.0/lib/contentful/management/client.rb:441:in `get'
/.gem/ruby/2.6.5/gems/contentful-management-2.11.0/lib/contentful/management/request.rb:41:in `get'
/.gem/ruby/2.6.5/gems/contentful-management-2.11.0/lib/contentful/management/resource_requester.rb:71:in `get'
/.gem/ruby/2.6.5/gems/contentful-management-2.11.0/lib/contentful/management/resource_requester.rb:19:in `find'
/.gem/ruby/2.6.5/gems/contentful-management-2.11.0/lib/contentful/management/resource.rb:241:in `find'
/.gem/ruby/2.6.5/gems/contentful-management-2.11.0/lib/contentful/management/client_association_methods_factory.rb:33:in `find'

Oddly, retrieving ALL content types in the space and environment works fine and I can see all the content types in the response. I've also noticed a similar error when trying to retrieve content entries as well.

@svignara
Copy link
Author

svignara commented May 1, 2020

Updating the http gem fixed this for me, noticed that this was also a duplicate of #210

@svignara svignara closed this as completed May 1, 2020
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

1 participant