The pgadmin 4 server could not be contacted ошибка

I need to add this here because I’ve had several issues with this message. If you have recently upgraded to High Sierra you will find the latest (pgadmin 4.20) will keep appearing with the message «Application Server Could Not be Contacted». What this actually means on Macs is that python was unable to configure your environment in ~/.pgadmin

This directory stores all the things you setup and configure and even logs of what was ran on your user copy usage of pgadmin.

The way to fix this issue on High Sierra is down to sqlite3. If you look in that directory you’ll see everything is stored in sqlite3 files.

When version 4.20 of pgadmin was released it was shipped with a version later than sqlite3.19 and the problem arises because High Sierra is shipped with sqlite3.19, so to fix this issue, you need to replace the old version of sqlite3 with the latest on your packager.

Now be aware, MacosX+ all use sqlite to store details for the majority of apps on your mac, so you’ll need to make sure you do not just wipe the old version but you’ll have to have both versions co-existing together in harmony to avoid anything major occurring on your mac.

1) download brew https://brew.sh/

2) update brew and upgrade brew to make sure it’s up-to-date

3) brew install sqlite3

4) mv /usr/bin/sqlite3 /usr/bin/sqlite3.os

5) ln -s /usr/local/Cellar/sqlite/3.21.0/bin/sqlite3 /usr/bin/sqlite3

6) /usr/bin/sqlite3 -version (check version is later than 3.19)

You can now proceed to open up pgadmin as normal

In this guide, we’ll walk you through the process of troubleshooting the «The pgAdmin 4 server could not be contacted» error. This error usually occurs when you’re trying to use the pgAdmin 4 tool to manage your PostgreSQL databases, but the server is unable to establish a connection with pgAdmin.

Follow the steps below to resolve the issue:

Step 1: Check the PgAdmin 4 Configuration File

First, make sure that your pgAdmin 4 configuration file is set up correctly.

Open the config_local.py or config.py file located in the pgAdmin 4 installation folder. The default location is:

  • Windows: C:Program FilespgAdmin 4v5web
  • macOS: /Library/PostgreSQL/pgAdmin 4/web
  • Linux: /usr/local/lib/python3.x/dist-packages/pgadmin4

Verify that the SERVER_MODE and ALLOWED_HOSTS settings are configured correctly. For example, if you’re running pgAdmin 4 in server mode, your configuration should look like this:

SERVER_MODE = True
ALLOWED_HOSTS = ['*']

If you’re running pgAdmin 4 in desktop mode, your configuration should look like this:

SERVER_MODE = False
ALLOWED_HOSTS = ['localhost', '127.0.0.1']

Save the configuration file and restart pgAdmin 4.

Step 2: Verify the PgAdmin 4 Service Status

Make sure the pgAdmin 4 service is running correctly.

Windows: Open the «Services» application and look for the «pgAdmin 4» service. Ensure that its status is set to «Running.»

macOS: Open the «Activity Monitor» and search for «pgAdmin.» Ensure that the process is running.

Linux: Run the following command in the terminal:

systemctl status pgadmin4

Ensure that the service is «active (running).»

Step 3: Check Firewall and Antivirus Settings

Your firewall or antivirus software might be blocking the connection between pgAdmin 4 and the server. Temporarily disable your firewall and antivirus software, then try connecting again. If the issue is resolved, create exceptions for pgAdmin 4 in your firewall and antivirus settings.

Step 4: Examine Log Files

If the issue persists, examine the log files to identify any error messages or other relevant information. The log files are located in the following directories:

  • Windows: C:UsersYourUsernameAppDataRoamingpgAdminpgadmin.log
  • macOS: ~/Library/Application Support/pgAdmin/pgadmin.log
  • Linux: ~/.pgadmin/pgadmin.log

Frequently Asked Questions (FAQs)

How do I install pgAdmin 4?

Refer to the official pgAdmin 4 documentation for detailed installation instructions for your specific operating system.

How do I update pgAdmin 4 to the latest version?

To update pgAdmin 4, simply download the latest version from the pgAdmin 4 download page and follow the installation instructions.

Can I use pgAdmin 4 to manage multiple PostgreSQL servers?

Yes, pgAdmin 4 supports managing multiple PostgreSQL servers. You can add multiple servers by clicking on the «Add New Server» button in the «Servers» tab.

Why is my pgAdmin 4 interface slow or unresponsive?

This issue might be due to insufficient system resources or an outdated version of pgAdmin 4. Try closing other applications to free up system resources, or update pgAdmin 4 to the latest version.

Can I use pgAdmin 4 with other databases like MySQL or Oracle?

No, pgAdmin 4 is specifically designed for managing PostgreSQL databases. To manage other databases, consider using alternative tools such as MySQL Workbench for MySQL or Oracle SQL Developer for Oracle.

  • PgAdmin 4 Official Documentation
  • PostgreSQL Official Documentation
  • PgAdmin 4 Configuration
  • PgAdmin 4 Troubleshooting Guide

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.

C:Program FilesPostgreSQL12debug_symbols;SRV*c:localsymbols*http://msdl.microsoft.com/download/symbols
  • open pgAdmin 4 > look for process in Task Manager and get process id
  • open Microsoft Visual Studio (run as administrator) > Debug > Attach to Process > check «Show processes from all users» > sort by process id > Attach
  • now go back in pgAdmin

enter image description here

Got a new popup I’ve never seen before from Visual Studio!

enter image description here

Created new virtual environment based on Python 3.8.

enter image description here

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.

enter image description here

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:PythonPython27. 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.

enter image description here

Then I set ApplicationPath to C:Program FilespgAdmin 4v4web, to the folder where pgadmin4.py is located.

Here is the icon I’m clicking on each time.
«C:Program FilespgAdmin 4v4runtimepgAdmin4.exe»
«C:Program FilesPostgreSQL12pgAdmin 4binpgAdmin4.exe»

ERROR flask.app: Error starting the app server: (<class ‘OSError’>,
OSError(10013, ‘An attempt was made to access a socket in a way
forbidden by its access permissions’, None, 10013, None),

There are two pgAdmin folders. There are traces left over from the other pgAdmin uninstall.

C:Program Files (x86)pgAdmin 4files.txt
C:Program Files (x86)pgAdmin 4v4
C:Program Files (x86)pgAdmin 4v4venv
C:Program Files (x86)pgAdmin 4v4venvLib
C:Program Files (x86)pgAdmin 4v4venvLibcollections
C:Program Files (x86)pgAdmin 4v4venvLibencodings
C:Program Files (x86)pgAdmin 4v4venvLibimportlib
C:Program Files (x86)pgAdmin 4v4venvLibjson
C:Program Files (x86)pgAdmin 4v4venvLibsite-packages
C:Program Files (x86)pgAdmin 4v4venvLib__pycache__
C:Program Files (x86)pgAdmin 4v4venvLibcollections__pycache__
C:Program Files (x86)pgAdmin 4v4venvLibcollections__pycache____init__.cpython-38.pyc
C:Program Files (x86)pgAdmin 4v4venvLibencodings__pycache__
C:Program Files (x86)pgAdmin 4v4venvLibencodings__pycache__aliases.cpython-38.pyc
C:Program Files (x86)pgAdmin 4v4venvLibencodings__pycache__cp1252.cpython-38.pyc
C:Program Files (x86)pgAdmin 4v4venvLibencodings__pycache__latin_1.cpython-38.pyc
C:Program Files (x86)pgAdmin 4v4venvLibencodings__pycache__utf_8.cpython-38.pyc
C:Program Files (x86)pgAdmin 4v4venvLibencodings__pycache____init__.cpython-38.pyc
C:Program Files (x86)pgAdmin 4v4venvLibimportlib__pycache__
C:Program Files (x86)pgAdmin 4v4venvLibimportlib__pycache__abc.cpython-38.pyc
C:Program Files (x86)pgAdmin 4v4venvLibimportlib__pycache__machinery.cpython-38.pyc
C:Program Files (x86)pgAdmin 4v4venvLibimportlib__pycache__util.cpython-38.pyc
C:Program Files (x86)pgAdmin 4v4venvLibimportlib__pycache____init__.cpython-38.pyc
C:Program Files (x86)pgAdmin 4v4venvLibjson__pycache__
C:Program Files (x86)pgAdmin 4v4venvLibjson__pycache__decoder.cpython-38.pyc
C:Program Files (x86)pgAdmin 4v4venvLibjson__pycache__encoder.cpython-38.pyc
C:Program Files (x86)pgAdmin 4v4venvLibjson__pycache__scanner.cpython-38.pyc
C:Program Files (x86)pgAdmin 4v4venvLibjson__pycache____init__.cpython-38.pyc
C:Program Files (x86)pgAdmin 4v4venvLibsite-packages__pycache__
C:Program Files (x86)pgAdmin 4v4venvLibsite-packages__pycache___virtualenv.cpython-38.pyc
C:Program Files (x86)pgAdmin 4v4venvLib__pycache__abc.cpython-38.pyc
C:Program Files (x86)pgAdmin 4v4venvLib__pycache__codecs.cpython-38.pyc
C:Program Files (x86)pgAdmin 4v4venvLib__pycache__contextlib.cpython-38.pyc
C:Program Files (x86)pgAdmin 4v4venvLib__pycache__copyreg.cpython-38.pyc
C:Program Files (x86)pgAdmin 4v4venvLib__pycache__datetime.cpython-38.pyc
C:Program Files (x86)pgAdmin 4v4venvLib__pycache__enum.cpython-38.pyc
C:Program Files (x86)pgAdmin 4v4venvLib__pycache__functools.cpython-38.pyc
C:Program Files (x86)pgAdmin 4v4venvLib__pycache__genericpath.cpython-38.pyc
C:Program Files (x86)pgAdmin 4v4venvLib__pycache__heapq.cpython-38.pyc
C:Program Files (x86)pgAdmin 4v4venvLib__pycache__io.cpython-38.pyc
C:Program Files (x86)pgAdmin 4v4venvLib__pycache__keyword.cpython-38.pyc
C:Program Files (x86)pgAdmin 4v4venvLib__pycache__ntpath.cpython-38.pyc
C:Program Files (x86)pgAdmin 4v4venvLib__pycache__operator.cpython-38.pyc
C:Program Files (x86)pgAdmin 4v4venvLib__pycache__os.cpython-38.pyc
C:Program Files (x86)pgAdmin 4v4venvLib__pycache__re.cpython-38.pyc
C:Program Files (x86)pgAdmin 4v4venvLib__pycache__reprlib.cpython-38.pyc
C:Program Files (x86)pgAdmin 4v4venvLib__pycache__signal.cpython-38.pyc
C:Program Files (x86)pgAdmin 4v4venvLib__pycache__site.cpython-38.pyc
C:Program Files (x86)pgAdmin 4v4venvLib__pycache__sre_compile.cpython-38.pyc
C:Program Files (x86)pgAdmin 4v4venvLib__pycache__sre_constants.cpython-38.pyc
C:Program Files (x86)pgAdmin 4v4venvLib__pycache__sre_parse.cpython-38.pyc
C:Program Files (x86)pgAdmin 4v4venvLib__pycache__stat.cpython-38.pyc
C:Program Files (x86)pgAdmin 4v4venvLib__pycache__subprocess.cpython-38.pyc
C:Program Files (x86)pgAdmin 4v4venvLib__pycache__threading.cpython-38.pyc
C:Program Files (x86)pgAdmin 4v4venvLib__pycache__types.cpython-38.pyc
C:Program Files (x86)pgAdmin 4v4venvLib__pycache__warnings.cpython-38.pyc
C:Program Files (x86)pgAdmin 4v4venvLib__pycache___bootlocale.cpython-38.pyc
C:Program Files (x86)pgAdmin 4v4venvLib__pycache___collections_abc.cpython-38.pyc
C:Program Files (x86)pgAdmin 4v4venvLib__pycache___sitebuiltins.cpython-38.pyc
C:Program Files (x86)pgAdmin 4v4venvLib__pycache___weakrefset.cpython-38.pyc
C:Program Files (x86)pgAdmin 4v4venvLib__pycache____future__.cpython-38.pyc

FINALLY SOLVED IT! Flask within the Qt framework is NOT getting the port! I put some troubleshooting code into the source code.

C:Program FilespgAdmin 4v4webpgAdmin4.py

# Initialize Flask service only once
# If `WERKZEUG_RUN_MAIN` is None, i.e: app is initializing for first time
# so set `use_reloader` = False, thus reload won't call.
# Reference:
# https://github.com/pallets/werkzeug/issues/220#issuecomment-11176538
with open("myfile.txt", "w") as file1:
    file1.write("Testing")
    file1.write(config.DEFAULT_SERVER)
    file1.write(config.EFFECTIVE_SERVER_PORT)
try:
    app.run(
        host=config.DEFAULT_SERVER,
        port=config.EFFECTIVE_SERVER_PORT,
        use_reloader=(
            (not app.PGADMIN_RUNTIME) and app.debug and
            os.environ.get("WERKZEUG_RUN_MAIN") is not None
        ),
        threaded=config.THREADED_MODE
    )

except IOError:
    app.logger.error("Error starting the app server: %s", sys.exc_info())

PostgreSQL recently released version 15. Now the pgAdmin comes as a desktop application instead of being opened in a browser. But they have recently been an error that’s roaming around which reads ‘pgAdmin 4 the application server could not be contacted.’ I have to admit, I do not fully know what the causes of this error are (all I know is it has to do with servers) but I’ve also encountered this error myself, and luckily, I found a quick way to fix it, but it might not be the best. I’m going to share with you in this blog post how o did it. Feel free to let me know in the comments if there are any other better fixes.

Here are the steps to take in order to fix the fatal error:

  1. Click the configure button at the bottom right corner.
  2. check the checkbox which reads, Fixed port number.
  3. Change the port number to the one you entered during the installation
  4. click the save button at the bottom right corner of the window.

Now here are details steps:

1. Click the configure button at the bottom right corner.

On the error window, click the configure button at the bottom right corner of the error window.

2. check the checkbox which reads, Fixed port number.

After you click the Configure window, another window will pop up. On this window, check the checkbox which reads, Fixed port number.

3. Change the port number to the one you entered during installation

Clicking the checkbox will enable the port input on the right side. Change the port number to the one you entered during installation, if you used our guide on how to connect PostgreSQL with Django, it’s more likely you’ve used port 5432 because it is the default. If a message that says ‘the port is already in usage pops up’, keep on changing it till you find a port that is free.

4. Click the save button at the bottom right corner of the window.

After changing the port number, click the save button at the bottom right corner of the window.

A window will pop up telling you that pgAdmin has to be restarted in order to apply the changes. Go ahead and click the ‘okay’ button.

And wait for the app to start. Most of the time, it might not restart on its own, so if it takes a long time before it starts, better do that on your own.

Okay, above is what I did to fix the error. Please let me know in the comments section below if you have any other ways of fixing the error. Peace.


посмотрите здесь в поиске

https://beonmax.com/qa/?search=pgadmin

скорее всего поможет если переименовать имя компьютера в имя латинскими буквами


pgAdmin Runtime Environment
———————————————————
Python Path: «C:Program FilesPostgreSQL10pgAdmin 4pythonpython.exe»
Runtime Config File: «C:UsersWindows7AppDataRoamingpgadminruntime_config.json»
pgAdmin Config File: «C:Program FilesPostgreSQL10pgAdmin 4webconfig.py»
Webapp Path: «C:Program FilesPostgreSQL10pgAdmin 4webpgAdmin4.py»
pgAdmin Command: «C:Program FilesPostgreSQL10pgAdmin 4pythonpython.exe -s C:Program FilesPostgreSQL10pgAdmin 4webpgAdmin4.py»
Environment:
— ALLUSERSPROFILE: C:ProgramData
— APPDATA: C:UsersWindows7AppDataRoaming
— asl.log: Destination=file
— CHROME_CRASHPAD_PIPE_NAME: \.pipecrashpad_5748_DWJGWUNRSZQWTUQM
— CHROME_RESTART: NW.js|Произошел сбой NW.js. Перезапустить?|LEFT_TO_RIGHT
— CommonProgramFiles: C:Program FilesCommon Files
— CommonProgramFiles(x86): C:Program Files (x86)Common Files
— CommonProgramW6432: C:Program FilesCommon Files
— COMPUTERNAME: WINDOWS7
— ComSpec: C:Windowssystem32cmd.exe
— FP_NO_HOST_CHECK: NO
— HOMEDRIVE: C:
— HOMEPATH: UsersWindows7
— LOCALAPPDATA: C:UsersWindows7AppDataLocal
— LOGONSERVER: \WINDOWS7
— NUMBER_OF_PROCESSORS: 4
— OS: Windows_NT
— Path: C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSystem32WindowsPowerShellv1.0;C:UsersWindows7AppDataLocalatombin
— PATHEXT: .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
— PGADMIN_INT_KEY: 4cd924ae-b291-48f0-a08f-f65db8f2260b
— PGADMIN_INT_PORT: 49382
— PGADMIN_SERVER_MODE: OFF
— PostgreSQL: C:Program FilesPostgreSQL10bin
— PROCESSOR_ARCHITECTURE: AMD64
— PROCESSOR_IDENTIFIER: Intel64 Family 6 Model 69 Stepping 1, GenuineIntel
— PROCESSOR_LEVEL: 6
— PROCESSOR_REVISION: 4501
— ProgramData: C:ProgramData
— ProgramFiles: C:Program Files
— ProgramFiles(x86): C:Program Files (x86)
— ProgramW6432: C:Program Files
— PSModulePath: C:Windowssystem32WindowsPowerShellv1.0Modules
— PUBLIC: C:UsersPublic
— SESSIONNAME: Console
— SystemDrive: C:
— SystemRoot: C:Windows
— TEMP: C:UsersWindows7AppDataLocalTemp
— TMP: C:UsersWindows7AppDataLocalTemp
— USERDOMAIN: WINDOWS7
— USERNAME: Windows7
— USERPROFILE: C:UsersWindows7
— VBOX_MSI_INSTALL_PATH: C:Program FilesOracleVirtualBox
— windir: C:Windows
— windows_tracing_flags: 3
— windows_tracing_logfile: C:BVTBinTestsinstallpackagecsilogfile.log
———————————————————

не помогло, вот полный текст ошибки


А какую версию PG Admin 4 скачивали/устанавливали?

Обратите внимание:

——————

pgAdmin is available for 64 bit Windows™ 7 SP1 (desktop) or 2008R2 (server) and above, up to v4.30.

v5.0 and later are supported on Windows 8 (desktop) or 2012 (server) and above.

32 bit Windows support is available for versions up to v4.29.

———————

Т.е. вам нужно версию до v.4.30 ставить

https://www.postgresql.org/ftp/pgadmin/pgadmin4/v4.30/windows/

И посмотрите если у вас не 64, а 32 bit windows (32-разрядный), то версию еще ниже выбирайте https://www.postgresql.org/ftp/pgadmin/pgadmin4/


Если здесь https://www.enterprisedb.com/downloads/postgres-postgresql-downloads

то тоже посмотрите разрядность вашей системы и скачайте нужную версию 32 или 64 (возможно вы не ту версию поставили), для win7 — postgresql нужно 10-й версии ставить или ниже, а выше вы написали что 14-ю версию поставили…


спасибо большое. смогла решить этот вопрос так — postgresql поставила для версии 32, а pgadmin4 для 64, вебверсия 4.29, запустилось почему-то только так


Понравилась статья? Поделить с друзьями:
  • The of thieves ошибка lavenderbeard
  • The network location cannot be reached ошибка
  • The mysql extension is missing ошибка
  • The movie database python ошибка
  • The method or operation is not implemented ошибка