xforty/vagrant-drupal — Issue #1: HTTP request status fails
Author: dkingofpa
Created: 2012-01-13 20:30:05+00:00
State: open
Labels: Known Issue

When doing a stock install of vagrant-drupal, the resulting drupal site's status result page states that the HTTP request status failed.

### Some background on the issue
* http://drupal.org/node/588186
* http://drupal.org/node/245990

### Steps to reproduce
1. Follow Basic Usage steps in readme.
2. Log in to site.
3. Go to http://localhost:4567/admin/reports/status

### Cause of the issue
The system_check_http_request function in modules/system/system.module makes a call to the drupal_http_request function in includes/common.inc that results in a connection refused. drupal_http_request tries to open a socket via php's stream_socket_client. Printing out the socket, options, and result shows that drupal is trying to connect to the port we use in the web browser on the host.

socket: tcp://localhost:4567

options: Array
(
[max_redirects] => 0
[headers] => Array
(
[Host] => localhost:4567
)
[method] => GET
[data] =>
[timeout] => 30
[context] =>
)

result: stdClass Object
(
[code] => -111
[error] => Connection refused
)

### Potential workarounds
1. Ignore the error
2. Bypass the error message so Drupal makes the requests anyway. http://drupal.org/node/245990#comment-1312270
* Manually add that conf variable to settings.php or code it into the non-prod recipes?
3. Some coding to determine if we are using port-forwarding in the Vagrantfile. If yes, apply some magic using opscode's iptables or firewall cookbooks.