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

HTTParty get request suddenly timeout exception (CURL still working) #717

Open
idev opened this issue Dec 31, 2020 · 2 comments
Open

HTTParty get request suddenly timeout exception (CURL still working) #717

idev opened this issue Dec 31, 2020 · 2 comments

Comments

@idev
Copy link

idev commented Dec 31, 2020

Hello all,

I am stuck on a problem which occured recently.
For over a year the following snippet is working like expected:
return HTTParty.get("https://myip.ms/files/blacklist/htaccess/latest_blacklist.txt", format: :plain, headers: {"Accept" => "application/text" })
But recently it stops working, and now I getting a timeout exception.

The URL is reachable (you can test with your browser), and also curl from CLI is working like it should.
So I don't know if I am missing something else?

Thank you for your help.

@idev
Copy link
Author

idev commented Jan 2, 2021

Looks like a DNS Issue - https://stackoverflow.com/questions/42036133/ruby-netopentimeout-execution-expired/42043142 - for me "require 'resolv-replace'" it fixes my issue.

@d33pjs
Copy link

d33pjs commented Aug 26, 2022

Are you using a Rails App or just plain Ruby? Having the same issue in an Rails App on Mac OS. But I don't know how to add "require resolv-replace" and where.

Why isn't there any options to connect ipv4 only in HTTParty? Sometimes you haven't control over your local network (which could be a bad configured dual stack or even a shitty dual stack lite) or the remote webserver (also not under your control and from a stupid government) is not answering correctly on IPv6. Just let use force HTTParty to connect to IPv4 only.

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