When attempting to download updates the following error is given (example for trying to update the media module from 7.x-2.10 to 7.x-2.11):

HTTP error 0 occurred when trying to fetch https://ftp.drupal.org/files/projects/media-7.x-2.11.tar.gz.
Downloading updates failed:

Failed to download media from https://ftp.drupal.org/files/projects/media-7.x-2.11.tar.gz

Updates were working fine before and no changes have been made to the file system.

Comments

mjkovacevich created an issue. See original summary.

Guido Forks’s picture

I'm having exactly the same problem today, nothing has changed as far as I know on my system, using Windows 10.

cilefen’s picture

mjkovacevich’s picture

Don't think its related to https://www.drupal.org/node/2907021. Hosting provider seems to be running PHP 5.4.42, cURL 7.19.7 and OpenSSL 1.0.2a. Not sure how to check for TLS 1.2.

cilefen’s picture

How do you know it is not related? The timing matches.

JAINV18’s picture

Hello, I also faced this situation and I found the temporary solution for this problem.

It seems this problem is cause by safemode directive and limitation of Drupal to handle it. For more information please visit these pages:
http://drupal.org/node/1267240
http://drupal.org/project/issues/drupal?text=safe+mode&status=All&versio...

Solution:
Simply turn off the safemode directive off in php.ini

Step by Step Explanation:
1. You need to have php.ini file. If don't, ask your webhost if you're allowed to have it.
2. Set your website to maintenance mode.
3. Backup your php.ini.
4. Edit the php.ini and set safemode to off.
5. Save/upload the 'edited' php.ini file to your website.
6. Make sure the php.ini file permission is 755.
7. Goto Report section and perform the module updates.
8. Fix if there still any issue reported.
9. Quit the maintenance mode.

So far, everything is working fine on my website. Please do necessary backup before you try this solution.

OMD’s picture

I'm having this exact problem and exactly the same error message as well, but across all my Drupal 7 websites, even those in development just sitting on my local set up in MAMP.

dmaclachlan’s picture

I'm having the exact same issue. It doesn't appear to be "safe_mode" - it's already set to OFF in my php.ini file. Also, file permissions for /tmp appear to be correct. Help?

JAINV18’s picture

@dmaclachlan - can you check if your php.ini file is with 755 permission

Nux’s picture

If you are getting error 0 then it's probably something wrong with OpenSSL (if you would be getting -13 then OpenSSL extension might not be enabled).

To debug problems you can attempt to run below code (just put it in a file on your server and run it in your browser or even with command line).


$socket = 'ssl://ftp.drupal.org:443';
$options = array ( 
	'headers' => array ( 'User-Agent' => 'Drupal (+http://drupal.org/)', 'Host' => 'ftp.drupal.org', ),
	'method' => 'GET',
	'data' => NULL,
	'max_redirects' => 3,
	'timeout' => 30,
	'context' => NULL,
);
$fp = stream_socket_client($socket, $errno, $errstr, $options['timeout']);
echo "stream_socket_client error: $errstr [$errno]";

To run from cmd/bash use `php" -f "ssl_test.php"` (assuming you named the file `ssl_test.php`).

If you will get an error like: "SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version" then your OpenSSL is probably too old or something like that.

In any case you will get a lot more information to work with.

BTW. The `$options` is exactly what is used during module update. You can add some debug in `function drupal_http_request` after call to `stream_socket_client`. E.g.:

  drupal_set_message("socket: $socket");
  drupal_set_message("options: " . var_export($options, true));
dmaclachlan’s picture

Sorry for the long delay in responding. Yes, php.ini is set to 755.

Version: 7.5 » 7.x-dev

Core issues are now filed against the dev versions where changes will be made. Document the specific release you are using in your issue comment. More information about choosing a version.