Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Comment | File | Size | Author |
---|---|---|---|
#25 | force-curl-to-use-ipv4-1967240-25.patch | 776 bytes | g33kg1rl |
|
Comments
Comment #1
twistor CreditAttribution: twistor commentedWell, it looks like you're trying to connect to an IPV6 address. I'm not really sure how you could get that error code.
Can you try restarting Apache? I get this error when my IP address changes.
Comment #2
gtothab CreditAttribution: gtothab commentedHi,
:( I'm not able to restart apache as I'm on shared hosting...
Any other suggestions.
Thanks for your input!
Comment #3
twistor CreditAttribution: twistor commentedPing gdata.youtube.com and replace the domain name with an ip address.
Comment #4
gtothab CreditAttribution: gtothab commentedYou mean to do something like this: http://173.194.37.128/feeds/api/playlists/PLkpUXlaLsBQDC3llwMFJAWhHqYKlf...
That dosen't work.... :(
Comment #5
sbakshian CreditAttribution: sbakshian commentedHi.
I think that I am having a similar problem. I have a dev version of the site and it works fine on my local machine but when I attempt to import for the web server, I get the following error:
cURL error (0) Failed to connect to 2a03:2880:2110:cf07:face:b00c:0:1: Network is unreachable for https://www.facebook.com/feeds/page.php?id=91825969660&format=rss20
My provider is bluehost.com and here are some of the things that they have mentioned in my emails back and forth to them with the most recent one on top:
-----------------------
Date: July 11, 2013 12:39:26 PM CDT
Hi-
The configuration has to do with the code in the module itself but php.ini shouldn't have anything to do with it. I downloaded the code for that and ran a search for any instances of 'curl' and also did not come up with anything in any of those files that mentioned it, so it's strange that it should be throwing out an error that refers to cURL.
At the same time, something is using curl to refer to that URL that you'd entered into the settings. I would suggest checking with the developers of that module to see if they have run into that error before and if they know why if nothing referring 'curl' shows up in the code, why it throws an error about curl in the first place.
Our servers themselves are able to connect of course, as I've run into plenty of other sites (some drupal I'm sure, but a mix of different scripts) that do connect successfully to facebook.
Thank you,
Riley
Level II Site/Script Compatibility
BlueHost.com
888.401.4678
-----------------------
Date: July 10, 2013 10:41:17 AM CDT
I was unable to identify the link to display the error or the plugin in your subdomain that would allow me to give you more information.
for instance if I knew the location of the plugin and a place to test we might be able to find the curl itself and tell you whether this line when added directly to the code of the curl will force it to use ipv4
curl_setopt( $ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 );
Thank you,
Jason
Level II Site/Script Compatibility
BlueHost.com
888.401.4678
-----------------------
Date: June 19, 2013 5:34:38 PM CDT
The curl is being run by a module on your drupal. It is set to use an ipv6 address for facebook (this is relatively common but most plugins that are set this way have a fallback mode to ipv4). The particular plugin that you are using is detecting that the utilities for a connection using ipv6 exist on the server (which they do) but when it tries to use that connection it fails because the ipv6 cannot connect the entire way out of the server and network.
The plugin should have a forum that explains what changes to make to have it default to a ipv4 connection, I tried to locate where the code was so that i could possibly direct you to a help page that would explain this from their side and show you the code changes to make that would allow it to connect. But i was unable to identify the link to display the error or the plugin in your subdomain that would allow me to give you more information.
The screenshot gave the address as http://tcrehab.yblimited.com/facebook-feed-0 which gave a not found
http://tcrehab.yblimited.com/facebook-feed had a page there but it just said "FACEBOOK FEED" as the title
the search that i would have made would have been something like:
enable ipv4 with [name of plugin in quotes] for drupal
Port 80 is open already.
Thank you,
Jason
Level II Site/Script Compatibility
BlueHost.com
888.401.4678
So.... since BlueHost.com does not support ipv6 yet, there needs to be something added to the http_request.inc file to allow iPV4?
Comment #6
sbakshian CreditAttribution: sbakshian commentedProblem temporarily fixed for me :D
My hack/patch of adding the following after line 180 "curl_setopt($download, CURLOPT_TIMEOUT, $request_timeout);" to the http_request.inc file located in the libraries directory works well.
The code that I added was:
curl_setopt($download, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 );
This solved my problem for me. Please let me know if you need any more information.
Thanks,
Sam
Comment #7
codybarr CreditAttribution: codybarr commentedI had to push my Youtube feed through Yahoo Pipes in order to get it to work with my Hostmonster account (sister company to BlueHost).
Comment #8
BDaggerhart CreditAttribution: BDaggerhart commentedI used sbakshian's solution from #6 and it worked fine for me. I don't know if this is the best way of handling this (probably not?), but I really needed it to work. Are there any updates or official patches for this issue?
Comment #9
TechnoTim2010 CreditAttribution: TechnoTim2010 commentedThe solution in #6 does indeed solve the issue. If I find five minutes I will work up a patch in git. Of course it needs a caveat that this patch only solves issues where your host does not yet support IPv6. Actually since I updated another site with the same modules it sort of proves that the other host DOES support IPv6.
Comment #10
twistor CreditAttribution: twistor commentedWe need to add a check around CURLOPT_IPRESOLVE, and CURL_IPRESOLVE_V4. They are only available in 5.3 and up. Perhaps this should be configurable?
Comment #11
twistor CreditAttribution: twistor commentedComment #12
TechnoTim2010 CreditAttribution: TechnoTim2010 commentedAfter upgrading to 7.x-2.x-dev (in order to fix other issues) and reapplying the patch in#6,the patch no longer works.
I have workaround for the issue at present but will work on fix when time allows, will then work up a patch that does graceful fallback from IPV6 to IPV4 (unless someone else gets there before me).
Comment #13
g016146 CreditAttribution: g016146 commentedHi guys.. I am stuck with this ipv6 to ipv4 problem because I need to use 7.x-2.x-dev in order to fix other issues. Is there any workaround I can apply just now? Thank you, Gabriel.
Comment #14
g016146 CreditAttribution: g016146 commentedThe solution in #6 worked here. Thanks.
Comment #15
TechnoTim2010 CreditAttribution: TechnoTim2010 commentedHi
I think curiously the fix works again, I reapplied about a week ago after, I think some other related or dependent update made it work, either that or I messed up the original fix.
It certainly works again.
Regards
Tim
Comment #16
g016146 CreditAttribution: g016146 commentedIm tested more today and it is unstable.. it works only in first times, then it suddenly stops working.
Feed Log:
2014-04-18 23:06:08 2014-04-18 23:06:03 cURL error (0) Failed to connect to 2001:4860:4007:800::1005: Network is unreachable for
2014-04-18 23:04:06 2014-04-18 23:04:02 Imported in 1 s
2014-04-18 23:04:06 2014-04-18 23:04:02 Updated 10 nodes.
2014-04-18 23:02:32 2014-04-18 23:02:31 Imported in 0 s
2014-04-18 23:02:32 2014-04-18 23:02:31 Created 10 nodes.
2014-04-18 23:02:04 2014-04-18 23:02:02 cURL error (0) Failed to connect to 2607:f8b0:4007:801::1002: Network is unreachable for
2014-04-18 23:00:07 2014-04-18 23:00:03 cURL error (0) Failed to connect to 2607:f8b0:4007:803::1009: Network is unreachable for
2014-04-18 22:58:03 2014-04-18 22:58:01 cURL error (0) Failed to connect to 2001:4860:4007:800::1004: Network is unreachable for
Comment #17
g016146 CreditAttribution: g016146 commentedThe problem was because PHP config returned to 5.2 version after Bluehost crash this week... now changing againthrough cPanels to v5.4 without problems.
Comment #18
peterofoz CreditAttribution: peterofoz commentedI used sbakshian's solution from #6 and it worked fine for me. Thank you. Looking forward to an official fix.
Comment #19
fringedgentian CreditAttribution: fringedgentian as a volunteer commentedHere is a patch file I created to apply the fix in #6, which worked for us as well.
Comment #20
fringedgentian CreditAttribution: fringedgentian as a volunteer commentedComment #23
g33kg1rl CreditAttribution: g33kg1rl commentedThe latest patch in #19 worked for me, but I think you need to update the patch path:
/sites/all/modules/contrib/feeds/libraries/http_request.inc
This is a non-default module path.
Comment #24
g33kg1rl CreditAttribution: g33kg1rl commentedFirst attempt at updating a patch. *fingers crossed*
Comment #25
g33kg1rl CreditAttribution: g33kg1rl commentedOk take two.
Comment #27
MegaChriz CreditAttribution: MegaChriz at WebCoo commentedThanks for the patch, @g33kg1rl! Your patch currently does not apply, because you have created it from a different directory. The directory 'feeds' should be the root directory here.
To fix:
git diff > feeds-force-curl-to-use-ipv4-1967240-XX.patch
As said in #10, it sounds like that this should be configurable. Else I think it may cause issues for people that want to access an address that is IPV6 only?