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 reading from socket #210

Open
AlexAvlonitis opened this issue Feb 17, 2020 · 7 comments
Open

Error reading from socket #210

AlexAvlonitis opened this issue Feb 17, 2020 · 7 comments

Comments

@AlexAvlonitis
Copy link

Intermittent connection issues when updating-deleting records. As a workourand I'm retrying the request.

error reading from socket: Could not parse data (HTTP::ConnectionError)
~/gems/http-4.3.0/lib/http/response/parser.rb:31:in `add'
~/gems/http-4.3.0/lib/http/connection.rb:217:in `read_more'
~/gems/http-4.3.0/lib/http/connection.rb:103:in `read_headers!'
~/gems/http-4.3.0/lib/http/client.rb:75:in `perform'
~/gems/http-4.3.0/lib/http/client.rb:31:in `request'
~/gems/http-4.3.0/lib/http/chainable.rb:41:in `delete'
~/gems/contentful-management-2.11.0/lib/contentful/management/client.rb:496:in `public_send'
~/gems/contentful-management-2.11.0/lib/contentful/management/client.rb:496:in `http_send'
~/gems/contentful-management-2.11.0/lib/contentful/management/client.rb:435:in `block in delete'
~/gems/contentful-management-2.11.0/lib/contentful/management/client.rb:386:in `execute_request'
~/gems/contentful-management-2.11.0/lib/contentful/management/client.rb:434:in `delete'
~/gems/contentful-management-2.11.0/lib/contentful/management/request.rb:56:in `delete'
~/gems/contentful-management-2.11.0/lib/contentful/management/resource_requester.rb:94:in `delete'
~/gems/contentful-management-2.11.0/lib/contentful/management/resource_requester.rb:42:in `destroy'
~/gems/contentful-management-2.11.0/lib/contentful/management/resource.rb:85:in `destroy'
@HQ063
Copy link
Contributor

HQ063 commented Feb 17, 2020

Are you doing batch operations? You may be exceeding the API rate

@AlexAvlonitis
Copy link
Author

I'm trying the same set of data every time, fails intermittently, about 700 entries not faster than 1 entry per second. At some point i'm fetching entries with the paginated data, I added 1 sec throttle there as well. Wouldn't it return rate limit error if it was exceeding the limits?

@dlitvakb
Copy link
Contributor

Hey @AlexAvlonitis,

This is usually related to connection issues on the client's network end. Is it possible for you to run a ping check on your end and check if there's any packet loss? If you're having network issues, this is an easy way to diagnose it.

Cheers

@AlexAvlonitis
Copy link
Author

Thanks for the responses @HQ063 @dlitvakb, i ran ping with 0 packet loss for about half an hour.
Screenshot from 2020-02-17 15-25-16

Also found out this and might be relevant, someone had similar issue with the http gem, and i think they patched it recently
httprb/http#589

@strickland84
Copy link

I have the same error when attempting to retrieve all/any specific content types using this gem:

require 'contentful/management'
client = Contentful::Management::Client.new(@@cma_key)
content_types = client.content_types(@@space, @@environment).all

content_types gives *** HTTP::ConnectionError Exception: error reading from socket: Could not parse data

This code used to work with no problem, and hasn't changed for about 18 months on my end. Lately this call is failing 100% of the time with this HTTP error.

I have tried upgrading the HTTP gem with no luck. All my other API calls work, such as entries. It seems anything related to content_types is not working. Any advice? Thanks!

@kkorach
Copy link

kkorach commented Mar 3, 2020

I was having the same error. Downgrading to v4.1.1 of http solved the problem.

@strickland84
Copy link

thanks @kkorach that fixed it for me.

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

5 participants