Comments

twistor’s picture

Component: Feeds Import » Code
Priority: Critical » Normal
Status: Active » Postponed (maintainer needs more info)

Well, 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.

gtothab’s picture

Hi,

:( I'm not able to restart apache as I'm on shared hosting...

Any other suggestions.

Thanks for your input!

twistor’s picture

Ping gdata.youtube.com and replace the domain name with an ip address.

gtothab’s picture

You mean to do something like this: http://173.194.37.128/feeds/api/playlists/PLkpUXlaLsBQDC3llwMFJAWhHqYKlf...

That dosen't work.... :(

sbakshian’s picture

Hi.

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?

sbakshian’s picture

Status: Postponed (maintainer needs more info) » Needs review

Problem 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

codybarr’s picture

I had to push my Youtube feed through Yahoo Pipes in order to get it to work with my Hostmonster account (sister company to BlueHost).

BDaggerhart’s picture

I 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?

TechnoTim2010’s picture

The 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.

twistor’s picture

Issue summary: View changes
Status: Needs review » Needs work

We 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?

twistor’s picture

Title: cURL error (0) Failed to connect » Force IPV4
TechnoTim2010’s picture

After 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).

g016146’s picture

Hi 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.

g016146’s picture

The solution in #6 worked here. Thanks.

TechnoTim2010’s picture

Hi

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

g016146’s picture

Im 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

g016146’s picture

The problem was because PHP config returned to 5.2 version after Bluehost crash this week... now changing againthrough cPanels to v5.4 without problems.

peterofoz’s picture

I used sbakshian's solution from #6 and it worked fine for me. Thank you. Looking forward to an official fix.

fringedgentian’s picture

Issue summary: View changes
Status: Needs work » Needs review
FileSize
881 bytes

Here is a patch file I created to apply the fix in #6, which worked for us as well.

fringedgentian’s picture

FileSize
881 bytes
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 1967240-force-curl-to-use-ipv4.patch. Unable to apply patch. See the log in the details link for more information. View

Status: Needs review » Needs work

The last submitted patch, 20: 1967240-force-curl-to-use-ipv4.patch, failed testing.

The last submitted patch, 20: 1967240-force-curl-to-use-ipv4.patch, failed testing.

g33kg1rl’s picture

The 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.

g33kg1rl’s picture

First attempt at updating a patch. *fingers crossed*

g33kg1rl’s picture

Status: Needs work » Needs review
FileSize
776 bytes

Ok take two.

Status: Needs review » Needs work

The last submitted patch, 25: force-curl-to-use-ipv4-1967240-25.patch, failed testing.

MegaChriz’s picture

diff --git a/modules/feeds/libraries/http_request.inc b/modules/feeds/libraries/http_request.inc
...
--- a/modules/feeds/libraries/http_request.inc
+++ b/modules/feeds/libraries/http_request.inc

Thanks 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:

  1. Clone the feeds git repository.
  2. Make your changes.
  3. 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?