Skip to content

Force cURL to use ipv4 for Dns resolving#35

Merged
sbezboro merged 1 commit into
rollbar:masterfrom
elfif:patch-1
Jul 30, 2014
Merged

Force cURL to use ipv4 for Dns resolving#35
sbezboro merged 1 commit into
rollbar:masterfrom
elfif:patch-1

Conversation

@elfif

@elfif elfif commented Jul 20, 2014

Copy link
Copy Markdown
Contributor

I had an issue today trying rollbar for the first time. After a few debugs i realised that curl_exec returned false.
curl_error returned it "cannot resolve host". After a few searches i managed to make it works by adding that curl option that forces it to resolve hostname into an IPV4 address.

I tested it on a vagrant VM using virtualBox on Windows 8.1
My VM : Ubuntu server 14.04, PHP 5.5.14, cUrl 7.35.0

I had an issue today trying rollbar for the first time. After a few debugs i realised that curl_exec returned false.
curl_error returned it "cannot resolve host". After a few searches i managed to make it works by adding that curl option that forces it to resolve hostname into an IPV4 address.

I tested it on a vagrant VM using virtualBox on Windows 8.1
My VM : Ubuntu server 14.04, PHP 5.5.14, cUrl 7.35.0
@nodesocket

Copy link
Copy Markdown

Interesting, I've never had to forcefully set CURLOPT_IPRESOLVE in my experience with curl. Are you absolutely sure this was the issue?

@brianr

brianr commented Jul 21, 2014

Copy link
Copy Markdown
Member

@elfif - thanks for the PR!

Interesting. I wouldn't expect this, but I suppose it could matter in some networks. Seems safe to add though.

@elfif, would you mind double-checking that if you remove this setting, you get the cannot resolve host error again?

@elfif

elfif commented Jul 22, 2014

Copy link
Copy Markdown
Contributor Author

hi there.
If you wait tomorrow i can make more checks
The problem occured from my home.
Tomorrow, i will be able to test the same thing from my office and from
production servers.
Then if you are ok i will come back to you.

On Mon, Jul 21, 2014 at 10:18 PM, Brian Rue [email protected]
wrote:

@elfif https://github.com/elfif - thanks for the PR!

Interesting. I wouldn't expect this, but I suppose it could matter in some
networks. Seems safe to add though.

@elfif https://github.com/elfif, would you mind double-checking that if
you remove this setting, you get the cannot resolve host error again?


Reply to this email directly or view it on GitHub
#35 (comment).

@brianr

brianr commented Jul 23, 2014

Copy link
Copy Markdown
Member

@elfif sounds great, we'll wait for your update.

@elfif

elfif commented Jul 23, 2014

Copy link
Copy Markdown
Contributor Author

@brianr @nodesocket, hi guys, i made a few more tests and so far the issue is still here. I tried from my office and had the same result. I tried to change my dns (tried google ones and those of my DSL provider) as it is an ip resolving issue and it goes the same way.....

Do you know if RollBar has upgraded his network to ipv6 ?

I will try on production condition this afternoon ....
I keep you posted

@elfif

elfif commented Jul 28, 2014

Copy link
Copy Markdown
Contributor Author

Hi there,

I can't reproduce on real servers; i tested with 2 and each time Rollbar works fine .....
So far i got the issue on my development environment, testing the same vagrant VM on 4 differents computers with 2 differents ISP.

i use cURL with other libraries to connect to some oAuth providers on the same project, and it works fine in any case.

So it might come from my VM but she's really standard, it s just an up to date Ubuntu Server 14.04 .
I would appreciate the request to be accepted because i can't find a way around from now ...

Thanks guys

@sbezboro sbezboro merged commit e90ded4 into rollbar:master Jul 30, 2014
@sbezboro

Copy link
Copy Markdown
Contributor

Thanks @elfif! Merged and released as version 0.9.7

@Bilge

Bilge commented Jan 8, 2022

Copy link
Copy Markdown

This definitely should not have been accepted 😂

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

Successfully merging this pull request may close these issues.

5 participants