Skip to content
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 · 13 comments
Closed

ERR_CONNECTION_REFUSED since 2.0.3 #326

faustbrian opened this issue Feb 21, 2017 · 13 comments

Comments

@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
Copy link
Author

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
Copy link
Author

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
Copy link

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

@aliajoudanian
Copy link

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

@fa8ster
Copy link

fa8ster commented Feb 28, 2017

Same for me :(

@fa8ster
Copy link

fa8ster 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
Copy link

@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
Copy link
Contributor

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!

@Artnforces
Copy link

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

First of all thanks for your answer, I'm experiencing this problem now. But in your script as you run unlink command, do we have to link them after that we have install the 3 packages (nginx php and dnsmasq) ?

@xmarkclx
Copy link

xmarkclx commented Dec 7, 2019

Ok, was able to have this issue and fixed this on Valet 2.6

Issue was that when we upgraded to PHP 7.2, we are now using a new version of OpenSSL which was not compatible with the old version of Valet.

♥-> nginx -t    
dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
  Referenced from: /usr/local/bin/nginx
  Reason: image not found
Abort trap: 6

These commands

♥-> sudo brew services stop nginx 
♥-> brew upgrade nginx
♥-> sudo brew services start nginx 

fixed it.

@aaemnnosttv
Copy link
Contributor

@xmarkclx I experienced this yesterday as well although I don't think it was Valet related. I believe it was due to another installation from Homebrew which corrupted/removed a shared dependency.

I fixed it by brew reinstall nginx and a few others. This prevents changing the installed version rather than upgrading which I don't think would work if you're already on the latest.

@yoniyou-1
Copy link

En valet para windows, entre como usuario administrador a la consola de comando y ejecute "valet start" eso detubo algunos procesos y los reinicio y ya se ejecuta Bien.

@lorejojan-git
Copy link

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

Thank YOU

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants