Valet: Laravel Valet - This Site Can't Be Reached

Created on 11 Aug 2017  路  21Comments  路  Source: laravel/valet

I have successfully followed the Setup a Mac Dev Machine until this tutorial: https://laracasts.com/series/setup-a-mac-dev-machine-from-scratch/episodes/10?autoplay=true

The problem is that when I go to SITENAME.dev, nothing shows up. Instead, I get the following message:

This site can鈥檛 be reached

test2.dev refused to connect. Did you mean http://test2.de/? Search Google for test2 dev ERR_CONNECTION_REFUSED

I've tried this both for a laravel install (using the laravel installer) and a wordpress install. Neither one works.

Any idea why it is not working. I have followed the course step-by-step as well as the comments. For instance, I modified the .zshrc file as follows based on the course and comments:

export PATH=$HOME/bin:/usr/local/bin:$HOME/.composer/vendor/bin:$PATH

And, in case it is relevant, I am on Mac Sierra (freshly updated).

In short, where Jeffrey is able to get a home page of laravel, I get an error.

Any idea how to fix this?

Thanks.

Most helpful comment

It's time to stop using .dev and switch to something else like .test.

https://ma.ttias.be/chrome-force-dev-domains-https-via-preloaded-hsts/

All 21 comments

Sounds like dnsmasq isn't running. Try running ps aux | grep dnsmasq in your terminal, you should see some output similar to this if dnsmasq is running:

nobody           92174   0.0  0.0  2480148   1632   ??  Ss   28Jul17   0:00.08 /usr/local/opt/dnsmasq/sbin/dnsmasq --keep-in-foreground -C /usr/local/etc/dnsmasq.conf

If you don't then try:

sudo brew services stop dnsmasq
sudo brew services start dnsmasq

...to see if that makes a difference. If not you'll have to try and troubleshoot why dnsmasq can't start on your computer.

I ran the command and this is what it output:

nobody           46097   0.0  0.0  2442260    920   ??  Ss    3:28AM   0:00.01 /usr/local/opt/dnsmasq/sbin/dnsmasq --keep-in-foreground -C /usr/local/etc/dnsmasq.conf
moshemo          47089   0.0  0.0  2432804    760 s000  S+    3:29AM   0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn dnsmasq

Still doesn't work, though.

Does that mean I have to troubleshoot dnsmasq? If so, any suggestions of how to do so or where to turn to for that?

Thanks.

I'm having the same issue. I've tried just about everything. Reinstalls, brew reinstalls, etc... with no luck.

Valet stopped working for me yesterday. It was working fine after installing it for a few days before that.

ps aux | grep dnsmasq shows

nobody            6832   0.0  0.0  4332776    428   ??  Ss   Sat03pm   0:00.15 /usr/local/opt/dnsmasq/sbin/dnsmasq --keep-in-foreground -C /usr/local/etc/dnsmasq.conf
sridharkatakam   62013   0.0  0.0  4281080    960 s001  S+    9:31am   0:00.01 grep dnsmasq

screenshot

@moshemo @justalever Did you guys figure it out?

The problem seems to be with SSL certificates.

My valet install suddenly started doing this. I was running valet domains without problems for most of the day until without changing anything they all returned the "This site can't be reached" status. I've restarted valet, dnsmasq and the entire machine with no success. Any .dev domain is affected, wether they are configured with valet park/link or not and wether they are https or not. Also switching the valet TLD with valet domain localhost doesn't make a difference.

If related to https: Since a few days ago my chrome started requiring HTTPS on .dev domains. This was fixable by running valet secure on the projects I was working on. That worked, but now all domains are affected so I don't see a direct connection between these changes.

It's like a nose that comes off when you sneeze.

I got used to running an uninstall bash script that removes everything incl. databases and then reinstall Valet followed by creating the databases and restoring the tables by importing .sql files.

I got it working again after completely uninstalling valet per these instructions: https://stackoverflow.com/questions/40276967/uninstall-laravel-valet, and then reinstalling. It was not necessary to do anything to the databases.

This problem can be reproduced (at least, on my Mac) by running

valet secure full-screen-hero-section-front-page-fixed-shrinking-header

For some reason (probably to do with the char count in the site name), that only creates .conf and .key files but not the .crt and .csr files in ~/.valet/Certificates.

After this, every site will stop working until I uninstall using the steps at https://stackoverflow.com/a/40279538/778809 and reinstall.

@srikat Does it have any effect to do valet unsecure full-screen-hero-section-front-page-fixed-shrinking-header or do things remain broken?

@Frique No. Things remain broken.

also if it matters,

a) I use .test TLD and not the default .dev.

b) full-screen-hero-section-front-page-fixed-shrinking-header is inside a parked functionality-themes folder.

I'm having the same issue. I've uninstalled and reinstalled php71, valet and restarted everything and nothing seems to work.
I don't know if it has anything to do with it forcing https connections which is causing the refusal but none of my parked directories are working.

@lvstross Do you know what triggered the problem?

Well at first it was getting an ERR_CONNECTION_REFUSED. So I uninstalled valet as well as nginx, php71 and dnsmasq via homebrew. Reinstalled everything. Valet installed and then parked my project folder. And now I'm getting an ERR_ICANN_NAME_COLLISION. So I reset the valet domain to something obscure and it has seemed to fix the problem. It's making me wonder if it had anything to do with chrome specifically. Though i'm not sure of that because my projects were also not showing up in safari as well. I don't know man but thanks for hoping on it. :)

Had the same problem - re-installed valet etc. - no change. All sites giving connection-refused errors. terminal ~ ping some-site.dev worked fine, so then tried with Safari instead of Chrome and bingo! it works.
So I suspect issue is Chrome trying to force https on the sites - will now play with valet secure to see if that works - annoying, as don't need https on local dev machine!

Executing the following.

$sitesDirectory> laravel secure siteName

Allowed me to run https://siteName.dev without issue. I can confirm that it is a Chrome related issue. I had rebooted my Mac before this issue came up.

It's time to stop using .dev and switch to something else like .test.

https://ma.ttias.be/chrome-force-dev-domains-https-via-preloaded-hsts/

Agreed.
Chrome is the first to aggressively enforce HTTPS on reserved TLDs. Others will follow soon enough.
We've seen this coming for years, but have devised creative workarounds to avoid the inevitable. Now the inevitable has come.
It's time to switch away from using TLDs you don't own/control.
And valet shouldn't be blamed for any problems encountered when trying to use reserved TLDs.

Safari is apparently doing this too. Valet was working great for me until today. Using valet secure fixed it for local access, but valet share doesn't work. Coming in on the ngrok.io URL, it returns a "too many redirections" error.

Closing; if this remains an issue for anyone once you've upgraded to use a new TLD, please create a new issue. Thanks!

Valet secure resolved the issue apparently

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dannygsmith picture dannygsmith  路  5Comments

pmochine picture pmochine  路  5Comments

idmahbub picture idmahbub  路  3Comments

webartistse picture webartistse  路  4Comments

tomirons picture tomirons  路  4Comments