HEAD method failed for "http://drupal.docker.localhost:8000/" with HTTP status 401. When creating new project.

I am getting the following error after filling out a local address in the create new project dialog. The message appears after clicking the next button (see screenshot).  When I click the open button the page opens without problems.

Steps to reproduce

- create new project -> next

- fill out base directory -> next

- fill out 'web server base url' -> next

- error appears

 

Error message

The error message is Connection to 'myproject' failed.
HEAD method failed for "http://drupal.docker.localhost:8000/" with HTTP status 401.

0
8 comments

Hi there,

Have you tried with "Don't check HTTP connection to server" option enabled?

Your server may not be up or whatever else -- that option allows to skip root URL check.

0

When I push the 'open' button next to the field the webpage opens up fine. Also from other browsers. The server is reachable from development machine (on which I run PHPstorm)  and it actually runs from a docker container on the development machine.

I have seen the option to "don't check", but I would expect it to work, especially since the URL is perfectly reachable. I mean if this doesn't even work, how can I ever hope to get xdebug and other tools set up?

0

I would gladly supply some logs, I have seen https://intellij-support.jetbrains.com/hc/en-us/articles/207241115 , but which logs are relevant?

 

Also there was a better way to supply logs than just pasting them, what was it again?

0

In such case I do not know.

I remember reading about it somewhere here on Forums (or maybe it was Issue Tracker...) but unable to find it now. I think it has something to do with the HEAD method used (maybe it's not allowed by your config or something) if normal GET works at the same time in the browser...

Out of curiosity (if you wish and have time) -- see if sending HEAD request to that URL will produce different results using Postman or some RESTful software (e.g. even the one built-in in IDE).

No better ideas from me at the moment -- maybe support team will have some.

1

About logs and stuff -- use "Submit a request" link at the top to make support ticket.

Logs -- it would be the one for deployment subsystem. All logs are saved into idea.log (Help | Show Log in.XX)

1

I checked a HEAD with the RESTed plugin for firefox, that gives me a status 200, so that doesn't seem to be the problem. Thanks for the tip though!

Headers returned seem normal too:

Cache-Control: must-revalidate, no-cache, private
Content-Encoding: gzip
Content-Language: en
Content-Type: text/html; charset=UTF-8
Date: Mon, 27 Nov 2017 20:55:36 GMT
Expires: Sun, 19 Nov 1978 05:00:00 GMT
Server: nginx
Vary: Accept-Encoding
X-Content-Type-Options: nosniff, nosniff
X-Drupal-Dynamic-Cache: UNCACHEABLE
X-Frame-Options: SAMEORIGIN, SAMEORIGIN
X-Generator: Drupal 8 (https://www.drupal.org)
X-Ua-Compatible: IE=edge
X-Xss-Protection: 1; mode=block
0

>I checked a HEAD with the RESTed plugin for firefox,

Can you please also check the web server logs (nginx, right?) for that failed and this successful HEAD requests.

Maybe, just maybe, it's because of the user agent (browser string)? It's possible that Drupal (or one of its' modules) drops connections this way for some generic non-browser UA strings (which IDE most likely be using). Web server log should have that info (if configured to log in, of course).

When you have used that RESTed plugin it most likely have sent proper Firefox UA...

0

I just did a lot of updates. Can't reproduce the error anymore. Thanks for helping out @Andriy !

0

Please sign in to leave a comment.