New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERR_CONNECTION_REFUSED since 2.0.3 #326

Closed
faustbrian opened this Issue Feb 21, 2017 · 8 comments

Comments

Projects
None yet
6 participants
@faustbrian
Copy link

faustbrian commented Feb 21, 2017

I updated to 2.0.3 today and now nothing is working anymore, all sites respond with ERR_CONNECTION_REFUSED. There are no errors in the error logs of valet, php or nginx.

I tried to reinstall valet and even completely delete the .valet folder and install it again but still the connection gets refused.

Is that a know issue and if so how would I fix that? Currently trying to figure it out so I can continue to work..

Running on latest macOS Sierra and PHP 7.1.2.

@faustbrian

This comment has been minimized.

Copy link

faustbrian commented Feb 21, 2017

The weird part is that I can even ping the sites but they do not work in the browser.

→ ping app.dev
PING wihz.dev (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.028 ms
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.059 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.082 ms
64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.078 ms
64 bytes from 127.0.0.1: icmp_seq=4 ttl=64 time=0.071 ms
64 bytes from 127.0.0.1: icmp_seq=5 ttl=64 time=0.067 ms
64 bytes from 127.0.0.1: icmp_seq=6 ttl=64 time=0.073 ms
64 bytes from 127.0.0.1: icmp_seq=7 ttl=64 time=0.076 ms
64 bytes from 127.0.0.1: icmp_seq=8 ttl=64 time=0.068 ms
64 bytes from 127.0.0.1: icmp_seq=9 ttl=64 time=0.076 ms
64 bytes from 127.0.0.1: icmp_seq=10 ttl=64 time=0.078 ms
^C
--- app.dev ping statistics ---
11 packets transmitted, 11 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.028/0.069/0.082/0.014 ms
@faustbrian

This comment has been minimized.

Copy link

faustbrian commented Feb 21, 2017

I ran the following and now I can access sites over HTTP again but as soon as I run valet secure app those sites refuse connection in any browser.

valet stop
valet uninstall
rm -rf ~/.valet
composer global remove laravel/valet

brew unlink nginx && brew remove nginx && brew uninstall --ignore-dependencies nginx
brew unlink php71 && brew remove php71 && brew uninstall --ignore-dependencies php71
brew unlink dnsmasq && brew remove dnsmasq && brew uninstall --ignore-dependencies dnsmasq

brew update
brew upgrade
brew cleanup
brew doctor

brew install nginx
brew install php71
brew install dnsmasq

sudo brew services start --all

composer global require laravel/valet
valet install
@vijaythecoder

This comment has been minimized.

Copy link

vijaythecoder commented Feb 21, 2017

@faustbrian you saved almost 10 hours of clueless problem. Yes valet secure is still a problem.

@aliajoudanian

This comment has been minimized.

Copy link

aliajoudanian commented Feb 25, 2017

I have the same problem but it couldn't help me. I can ping my sites but browser responds ERR_EMPTY_RESPONSE .

@fabianhenzler

This comment has been minimized.

Copy link

fabianhenzler commented Feb 28, 2017

Same for me :(

@fabianhenzler

This comment has been minimized.

Copy link

fabianhenzler commented Feb 28, 2017

GOT IT =)
The Problem is OpenSSL and the certificates. I had cascading duplicates of .key and .crt in my ../Certificates folder and they seemed to be corrupted.
I deleted all of them and recreated them with e.g. this http://brianflove.com/2014/12/01/self-signed-ssl-certificate-on-mac-yosemite/

@cjconnor24

This comment has been minimized.

Copy link

cjconnor24 commented Mar 30, 2017

@faustbrian you have seriously made my day. Wasted about six hours on this yesterday and another 3 today. Following your uninstall and reinstall done the trick.

Excellent work - THANK YOU!

@aaemnnosttv

This comment has been minimized.

Copy link
Contributor

aaemnnosttv commented May 9, 2017

I just ran into this again after trying to upgrade to php71 with Valet 2.0.4 with ERR_CONNECTION_REFUSED for http/https.

The problem seems to be one or more broken Nginx configuration files which are causing fatal errors in Nginx when it is loading initially, preventing any connections from working at all. Not sure how those files are breaking but it seems others have had the same problem.

You can find your Nginx logs here: /usr/local/var/log/nginx. Take a look at the error.log file there and you might see some lines like this:

[emerg] 75086#0: unexpected end of file, expecting ";" or "}" in /Users/aaemnnosttv/.valet/Nginx/1337.dev.conf.conf.conf:26

Here's what I did to fix it (substitute dev for your domain):

cd ~/.valet
mkdir nginxTrash
mv Nginx/*.conf.* trashNginx
mv Nginx/*.dev trashNginx 

This should leave only *.dev.conf files in Nginx

Now run valet restart

If you're still having problems, you probably have new errors in /usr/local/var/log/nginx/error.log. Keep working through those and then restart valet and that should do it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment