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.
Can't select Bootswatch style. The message: ERROR: Unable to reach Bootswatch API. Please ensure the server your website is hosted on is able to initiate HTTP requests. Appears
Comments
Comment #1
valkum CreditAttribution: valkum commentedHmm should not be a bug, but to be sure. Are you getting update informations for modules?
Comment #2
markhalliwellIndeed, this is an explicitly defined error and only informs those when a sever cannot send an HTTP request and retrieve data. There is really nothing that we can do about this and has to be fixed on the server level (via PHP).
Comment #3
PascalAnimateur CreditAttribution: PascalAnimateur commentedHumm... I experience the same thing on both my dev and production sites...
@Mark Caver : what PHP configuration are you thinking about?
Comment #4
PascalAnimateur CreditAttribution: PascalAnimateur commentedUpon inspecting the issue, I discovered that http://api.bootswatch.com/3/ can't be reached even from the browser.. is this normal ?
The demo on bootswatch.com doesn't work either : http://bootswatch.com/help/#api
Comment #5
valkum CreditAttribution: valkum commentedI can reach api.bootswatch.com/3/
It resolves to: af-us01-2-146473721.us-east-1.elb.amazonaws.com
Comment #6
PascalAnimateur CreditAttribution: PascalAnimateur commentedping: unknown host api.bootswatch.com
Is this normal ? (I'm in Canada it that has anything to do with it)
Comment #7
markhalliwellIt could be that your ISP is blocking it. It could be that your server has safe_mode on? It could be... a number of things, I'm not entirely sure. Regardless, this "error" says exactly what it means: it cannot establish a connection to the Bootswatch API server. Here is my output:
Comment #8
PascalAnimateur CreditAttribution: PascalAnimateur commentedThat's really strange.. anyways thanks for the help.
I managed to get it working with the following line in /etc/hosts :
54.236.159.122 api.bootswatch.com
Comment #9
perohu CreditAttribution: perohu commentedHere in Hungary a can't ping api.bootswatch.com neither, very strange...
I've edited the /etc/hosts too
Comment #10
vzsigmond CreditAttribution: vzsigmond commentedI can confirm the error, it's still present in 7.x-3.0.
In bootstrap/includes/settings.inc (line 433):
drupal_http_request() returns an integer as status code for the request. You are checking the type too and $request->code === '200' will be false. Update your if clause from
$request->code === '200'to $request->code == 200 and it should work as designed! :-)Comment #11
vzsigmond CreditAttribution: vzsigmond commentedComment #12
markhalliwellDo not change meta information on closed issues.
Also, this has already been addressed in the latest code: https://www.drupal.org/node/2452617