valet-linux-plus icon indicating copy to clipboard operation
valet-linux-plus copied to clipboard

📬 MailHog service not working

Open ibra-hassan opened this issue 3 years ago • 10 comments

Hi, I'm Ibrahim, I installed valet successfully, and everything works fine except MailHog service it gives me "502 Bad Gateway", please see the below image: image

On error logs:

2022/07/18 23:03:18 [error] 30313#30313: *18 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: mailhog.test, request: "GET / HTTP/2.0", upstream: "http://127.0.0.1:8025/", host: "mailhog.test"
2022/07/18 23:03:18 [error] 30313#30313: *18 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: mailhog.test, request: "GET / HTTP/2.0", upstream: "http://127.0.0.1:8025/", host: "mailhog.test"

When I use valet start it gives me all green:

Restarting dnsmasq...
Restarting php7.4-fpm...
Restarting nginx...
Restarting mailhog...
Restarting mysql...
Restarting redis-server...
Valet services have been started.

I'm running on WSL2 with Ubuntu-20.04.

Any help, please.

ibra-hassan avatar Jul 18 '22 20:07 ibra-hassan

@ibra-hassan

Can you please share the status of Mailhog service? It should be as shown on below screenshot.

Command: sudo service mailhog status

image

uttamrabadiya avatar Jul 20 '22 17:07 uttamrabadiya

@uttamrabadiya

It gives me that the service is not recognized as below: mailhog: unrecognized service

Is the service not installed ?!, but I'm sure from install valet with all steps successfully.

ibra-hassan avatar Jul 21 '22 21:07 ibra-hassan

I have run valet update Now and the output is like the below:

There is a new release of Valet Linux
Updating now...
Changed current directory to /home/hemo/.config/composer
Loading composer repositories with package information
Info from https://repo.packagist.org: #StandWithUkraine
Updating dependencies
Nothing to modify in lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Generating autoload files
14 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
[sudo] password for hemo:
Nginx was already enabled
Stopping nginx...
Restarting php7.4-fpm...
Dnsmasq was already enabled
Installing Valet DNS service...
Valet-dns was already enabled
Systemd-resolved was already disabled
Stopping systemd-resolved...
Restarting network-manager...
Restarting dnsmasq...
Restarting valet-dns...
Restarting nginx...
Installing Mailhog service...
Mailhog was already enabled
Restarting nginx...
Starting mailhog...
Redis-server was already enabled
Looks like MySQL already installed to your system, please enter MySQL [root] user password to connect MySQL with us:

Valet installed successfully!

ibra-hassan avatar Jul 21 '22 21:07 ibra-hassan

@ibra-hassan Strange, Mailhog service is not installed on your machine. We will give it a shot on WSL2 with Ubuntu-20.04, will try to figure out the issue.

uttamrabadiya avatar Jul 22 '22 17:07 uttamrabadiya

@uttamrabadiya thank you bro, I'm waiting for feedback.

ibra-hassan avatar Jul 23 '22 07:07 ibra-hassan

@uttamrabadiya Hi, any updates here ?

ibra-hassan avatar Aug 05 '22 17:08 ibra-hassan

@ibra-hassan I have fixed this issue, I forgot to mention but it seems the only redirection is not working from http to https. please try https://mailhog.localhost I believe it will work.

uttamrabadiya avatar Sep 07 '22 17:09 uttamrabadiya

@uttamrabadiya Hi again, the problem is still with the same error 🥲

2022/09/07 20:29:50 [error] 14653#14653: *600 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: mailhog.test, request: "GET / HTTP/2.0", upstream: "http://127.0.0.1:8025/", host: "mailhog.test"
2022/09/07 20:29:50 [error] 14653#14653: *600 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: mailhog.test, request: "GET / HTTP/2.0", upstream: "http://127.0.0.1:8025/", host: "mailhog.test"

image

ibra-hassan avatar Sep 07 '22 17:09 ibra-hassan

@ibra-hassan If you are openning http://localhost:8025, does it works? And can you please share output of following command: sudo lsof -i -P | grep mailhog

uttamrabadiya avatar Sep 12 '22 05:09 uttamrabadiya

@uttamrabadiya I'm sorry for being late, No it does not work, and no output on the command.

ibra-hassan avatar Oct 02 '22 06:10 ibra-hassan

@ibra-hassan This is due to the mailhog service is not running on your machine, I believe you could find some error by following command: sudo systemctl status mailhog

uttamrabadiya avatar Dec 07 '22 05:12 uttamrabadiya

Closing this issue as long inactivity.

uttamrabadiya avatar Dec 30 '22 14:12 uttamrabadiya