What does your Laravel log show? The request seems to be able to hit your application server, but it aborts somewhere before returning the complete response.
Jan 24, 2024
3
Level 1
502 bad Gateway after switching from mysql to postgresql (Valet)
Hi, I am using Valet, Laravel 10, developing locally on a Macbook M2.
When I use mysql, I can access website.test fine. If I switch to a postgresql database (running with dbngin), I get a 502 error access website.test.
The nginx error log shows:
2024/01/24 11:12:03 [error] 482#0: *32 upstream prematurely closed connection while reading response header from upstream, client: 127.0.0.1, server: , request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/Users/petervandijck/.config/valet/valet.sock:", host: "simply-analyze.test"
2024/01/24 11:12:16 [error] 482#0: *32 upstream prematurely closed connection while reading response header from upstream, client: 127.0.0.1, server: , request: "GET /nova/resources/topics HTTP/1.1", upstream: "fastcgi://unix:/Users/petervandijck/.config/valet/valet.sock:", host: "simply-analyze.test"
Also strange: it was working fine connecting to the local postgres a few hours ago, then I started seeeing this error.
This seems to be a known issue (https://github.com/laravel/valet/issues/1433), but at the same time, I can't find a way to fix this.
Any suggestions VERY welcome. I am a relative beginner on the command line.
Please or to participate in this conversation.