r/webdev • u/_Blazic • 21h ago
PgAdmin4
Guys does anyone know how to fix this? It randomly stopped working yesterday and keeps showing this whenever I try to start it again from services.msc. Please help.
3
u/jake_robins 21h ago
Im
Not sure you’re exact issue here, but a lot of these kinds of problems can be sidestepped by running Postgres in docker. It’s a good practice and habit to get in to.
1
u/Pitiful_Vehicle2538 21h ago
Postgres does that sometimes when the data directory gets corrupted or the port is already in use. Check the event viewer logs, usually gives a better clue than that generic error message
Also try starting it from command line instead of services, sometimes you get the actual error right there in the terminal
0
u/TheLastRaza 17h ago
what's the actual error you're hitting? that dialog text is pretty garbled in the screenshot. pgadmin4 connection issues are usually either the server service not running, wrong credentials, or the pg_hba.conf not allowing the connection method you're using. if you can paste the real error message someone can probably pinpoint it.
1
u/UlviShabanbayli 16h ago
Fastest way to see the actual error: skip services.msc and start it from a terminal, it prints the reason instead of that useless popup:
"C:\Program Files\PostgreSQL\18\bin\pg_ctl.exe" start -D "C:\Program Files\PostgreSQL\18\data"
"Started and then stopped" after it was working fine yesterday is usually one of these:
- stale postmaster.pid in the data folder. Happens after a crash or forced shutdown — if nothing postgres-related is actually running in task manager, delete that file and start again
- something else grabbed port 5432 (netstat -ano | findstr 5432)
- disk full
If pg_ctl prints something different, paste it here and I'll take a look.
8
u/Miserable-Money642 21h ago
That started and then stopped message is Postgres telling you it tried to boot and hit something it couldn't recover from. The service screen won't tell you what, but the log will, and that's where the real answer is.
Look in your Postgres data folder, there's a log subfolder (something like C:\Program Files\PostgreSQL\18\data\log --or anywhere else you installed the postgres on your coputer). Open the newest file and read the last 20 or so lines. It almost always spells out the exact reason in plain English.
The most common causes when it dies suddenly like this: the machine got shut down hard while Postgres was mid-write and now a file is corrupt, something else grabbed port 5432, or the data folder permissions got changed. The log will point at whichever one it is.
Docker is a fine long-term move like the other commenter said, but if you have data in there you care about, don't wipe anything yet. Read the log first, then we can figure out the fix.