DDEV: Can't Access Site Via Hostname, hosts File Not Updated

616 views Asked by At

I created a new DDEV project in an empty directory with ddev config. Then I used ddev start, and confirmed the project was running with ddev describe. So far so good.

When I access the project via http://127.0.0.1:[port number] in the browser it resolves fine. But when I try to access it via http://my-project-name.ddev.site, I get an ERR_CONNECTION_REFUSED error in Chrome.

I checked out the troubleshooting guide in the FAQ and went down the list:

If you’re not connected to the internet, your browser will not be able to look up *.ddev.site hostnames.

I'm connected to the internet.

DDEV assumes that hostnames can be resolved within 3 seconds. That assumption is not valid on all networks or computers, so you can increase the amount of time it waits for resolution.

Increased to 5 seconds as per the recommendation. Still no.

If DDEV detects that it can’t look up one of the hostnames assigned to your project for that or other reasons, it will try to add that to the hosts file on your computer, which requires administrative privileges (sudo or Windows UAC).

DDEV didn't ask me for admin privileges at any point, so I have no idea if it tried to write to the hosts file. If I open my hosts file I don't see any new entries beyond the base localhost settings.

One final note in case it's relevant: when I run ddev start I get an error message

Failed to start [my-project]: unable to listen on required ports, port 443 is already in use

However I've confirmed nothing else is using port 443 except Docker, and when I access the site via https://127.0.0.1:[port number] the site also resolves fine. So maybe it's related or maybe it's an unrelated bug.

System Info:

  • MacOS Catalina 10.15.7
  • Docker 4.15.0
  • DDEV 1.22.3
  • No other servers or virtual machines installed
1

There are 1 answers

0
Kristen Grote On BEST ANSWER

Restarting the entire computer seems to have fixed the issue, I guess it must have killed whatever mysterious process was interfering with DDEV doing a full startup. The port 443 error is gone and I can successfully access my project from the *.ddev.site url.