Whenever I install PostgreSQL, it stops working after about 6 months. This is the second time this happened! Last time this happened, I uninstalled and then installed version 4.29. How can I debug the PostgreSQL client or server and get a stack trace?
Splash screen opens and never closes unless I click on it.
I can't show more of the top section of the log because the error dialog pops up. When closing the error, the system tray icon for PostgreSQL crashes and closes everything.
After further troubleshooting, I found 8 "PostgreSQL Server" tasks, 1 pg_ctl task, 1 pgAdmin 4 Desktop Runtime in the Task Manager. Killed them all and restarted this and restarted the service in Admin Tools > Services. Same behavior.
C:\Program Files\PostgreSQL\12\bin\postgres.exe
Best Answer
Found these. We'll give it a shot.
https://wiki.postgresql.org/wiki/Getting_a_stack_trace_of_a_running_PostgreSQL_backend_on_Linux/BSD
https://wiki.postgresql.org/wiki/Getting_a_stack_trace_of_a_running_PostgreSQL_backend_on_Windows
Windows debugging.
Open Environment Variables (WINDOWS key + BREAK) Set environment variable "_NT_SYMBOL_PATH" for 4.2.
Got a new popup I've never seen before from Visual Studio!
Created new virtual environment based on Python 3.8.
Created a new Visual Studio Project using Python, not C++. I might need a newer version of Python based on this fix.
https://github.com/microsoft/ptvs/issues/5853
https://bugs.python.org/issue37633
Since this new version does not show in the Base Interpreter, I created a new environment based on the zip file.
None of that worked. Then I stumbled upon the registry configuration for pgAdmin. I read that pgAdmin uses Python version 2.7. And the PythonPath variable was blank, so I set it to C:\Python\Python27. So it must be using a value from somewhere else to get the path. It's looking in sys.path in Python whatever that is.
Then I set ApplicationPath to C:\Program Files\pgAdmin 4\v4\web, to the folder where pgadmin4.py is located.
Here is the icon I'm clicking on each time. "C:\Program Files\pgAdmin 4\v4\runtime\pgAdmin4.exe" "C:\Program Files\PostgreSQL\12\pgAdmin 4\bin\pgAdmin4.exe"
There are two pgAdmin folders. There are traces left over from the other pgAdmin uninstall.
FINALLY SOLVED IT! Flask within the Qt framework is NOT getting the port! I put some troubleshooting code into the source code.