'Failed to get available update data" behind a proxy I am running Drupal 8.1.2 behind proxy in Ubuntu 16.04. There is an error:

Failed to get available update data for one project.


even the following is added in settings.ini:

$settings['http_client_config']['proxy']['http'] = '192.168.1.8:3128';
$settings['http_client_config']['proxy']['https'] = '192.168.1.8:3128';
$settings['http_client_config']['proxy']['no'] = ['127.0.0.1', 'localhost'];


I tried both 192.168.1.8:3128 and http://192.168.1.8:3128/ and neither works.

Both http_proxy and https_proxy work well in bash though.

How can I fix the error?

Update, with screenshot:
I solved the problem on Ubuntu 14.04.5 with Drupal 8.5.6. This should also work for Ubuntu 16.04.4. Install php7.0-curl (or php-curl or php5-curl or php7.2-curl) and write http:// before your proxy name (otherwise GuzzleHttp uses tcp://, I think).

Console/SSH

sudo apt update
# Use php --version to find out what version of PHP you're on
sudo apt install php7.0-curl
sudo service apache2 restart


Config

/var/www/html/&lt;DRUPALFOLDER&gt;/sites/default/settings.php

$settings['http_client_config']['proxy']['http'] = 'http://192.168.1.8:3128';
$settings['http_client_config']['proxy']['https'] = 'http://192.168.1.8:3128';
$settings['http_client_config']['proxy']['no'] = ['127.0.0.1', 'localhost'];


Optional

The old syntax is no longer necessary (but would not hurt either):

$settings['proxy_server'] = '192.168.1.8';  // HERE WITHOUT http:// !!!
$settings['proxy_port'] = 3128;
$settings['proxy_username'] = '';
$settings['proxy_password'] = '';
$settings['proxy_user_agent'] = '';
$settings['proxy_exceptions'] = array('127.0.0.1', 'localhost');


Console/SSH (again)

sudo service apache2 restart


For the Googlers: errors on my way

Show logs with

drush ws --count=100 --extended --tail
# or cd into `&lt;DRUPALFOLDER&gt;` and do
php drush.phar ws --count=100 --extended --tail


►►►

 *****  24/Aug **:**  update    error     GuzzleHttp\Exception\RequestException: Error creating resource: [message]
                                          fopen(http://updates.drupal.org/release-history/drupal/8.x?site_key=****************************
                                          ***************&amp;version=8.5.6&amp;list=**********************************************************...
                                          ...*************************************************************************): failed to open
                                          stream: Connection timed out
                                          [file] /var/www/html/******************/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php
                                          [line] 324 in GuzzleHttp\Exception\RequestException::wrapException() (line 52 of
                                          /var/www/html/******************/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php).
 *****  24/Aug **:**  update    error     GuzzleHttp\Exception\RequestException: Error creating resource: [message]
                                          fopen(http://updates.drupal.org/release-history/admin_toolbar/8.x?site_key=*********************
                                          ***************************************&amp;list=admin_toolbar%2Cadmin_toolbar_tools): failed to
                                          open stream: Connection timed out
                                          [file] /var/www/html/******************/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php
                                          [line] 324 in GuzzleHttp\Exception\RequestException::wrapException() (line 52 of
                                          /var/www/html/******************/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php).


►►►

 *****  24/Aug **:**  notic  user  Session opened for ***.
                      e
 *****  24/Aug **:**  error  upda  GuzzleHttp\Exception\ClientException: Client error: `GET
                             te    http://updates.drupal.org/release-history/admin_toolbar/8.x?site_key=**********************************
                                   *********&amp;version=8.x-1.24&amp;list=admin_toolbar%2Cadmin_toolbar_tools` resulted in a `400 Bad Request`
                                   response:



 *****  24/Aug **:**  error  upda  GuzzleHttp\Exception\ClientException: Client error: `GET
                             te    http://updates.drupal.org/release-history/drupal/8.x?site_key=*****************************************
                                   **&amp;version=8.5.6&amp;list=******************************************************************************...
                                   ...***************************` resulted in a `400 Bad Request` response: