简体   繁体   English

升级到 Big Sur 后连接到本地 postgresql 数据库失败

[英]Connection to local postgresql database fails after upgrade to Big Sur

I use IntelliJ IDEA's bundled database client (DataGrip) to manage my database connections, both local and remote.我使用 IntelliJ IDEA 的捆绑数据库客户端 (DataGrip) 来管理我的本地和远程数据库连接。 And using docker to connect to postgres with following settings:并使用 docker 通过以下设置连接到 postgres:

    services:
  postgresql:
    image: postgres:11
    ports:
      - "5432:5432"
    expose:
      - "5432"
    environment:
      - POSTGRES_USER=$user
      - POSTGRES_PASSWORD=$pass
      - POSTGRES_DB=k$db

After upgrading from Catalina to Big Sur, connection to local db fails and it just shows a connection error message as follows:从 Catalina 升级到 Big Sur 后,连接到本地数据库失败,它只显示连接错误消息,如下所示:

    [08001] Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
java.net.ConnectException: Connection refused (Connection refused).

When I run docker-compose up , I get the following error:当我运行docker-compose up ,出现以下错误:

Traceback (most recent call last):
  File "site-packages/urllib3/connectionpool.py", line 677, in urlopen
  File "site-packages/urllib3/connectionpool.py", line 392, in _make_request
  File "http/client.py", line 1252, in request
  File "http/client.py", line 1298, in _send_request
  File "http/client.py", line 1247, in endheaders
  File "http/client.py", line 1026, in _send_output
  File "http/client.py", line 966, in send
  File "site-packages/docker/transport/unixconn.py", line 43, in connect
ConnectionRefusedError: [Errno 61] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "site-packages/requests/adapters.py", line 449, in send
  File "site-packages/urllib3/connectionpool.py", line 727, in urlopen
  File "site-packages/urllib3/util/retry.py", line 403, in increment
  File "site-packages/urllib3/packages/six.py", line 734, in reraise
  File "site-packages/urllib3/connectionpool.py", line 677, in urlopen
  File "site-packages/urllib3/connectionpool.py", line 392, in _make_request
  File "http/client.py", line 1252, in request
  File "http/client.py", line 1298, in _send_request
  File "http/client.py", line 1247, in endheaders
  File "http/client.py", line 1026, in _send_output
  File "http/client.py", line 966, in send
  File "site-packages/docker/transport/unixconn.py", line 43, in connect
urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionRefusedError(61, 'Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "site-packages/docker/api/client.py", line 205, in _retrieve_server_version
  File "site-packages/docker/api/daemon.py", line 181, in version
  File "site-packages/docker/utils/decorators.py", line 46, in inner
  File "site-packages/docker/api/client.py", line 228, in _get
  File "site-packages/requests/sessions.py", line 543, in get
  File "site-packages/requests/sessions.py", line 530, in request
  File "site-packages/requests/sessions.py", line 643, in send
  File "site-packages/requests/adapters.py", line 498, in send
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionRefusedError(61, 'Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "docker-compose", line 3, in <module>
  File "compose/cli/main.py", line 67, in main
  File "compose/cli/main.py", line 123, in perform_command
  File "compose/cli/command.py", line 69, in project_from_options
  File "compose/cli/command.py", line 132, in get_project
  File "compose/cli/docker_client.py", line 43, in get_client
  File "compose/cli/docker_client.py", line 170, in docker_client
  File "site-packages/docker/api/client.py", line 188, in __init__
  File "site-packages/docker/api/client.py", line 213, in _retrieve_server_version
docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', ConnectionRefusedError(61, 'Connection refused'))
[1269] Failed to execute script docker-compose

Connecting to remote db's are not broken somehow, they work.连接到远程数据库并没有以某种方式中断,它们可以工作。 Is there anyone came across this problem?有没有人遇到过这个问题?

After Big Sur upgrade, I also had a warning whenever I open a new terminal: Big Sur 升级后,每次打开新终端时都会收到警告:

    zsh compinit: insecure directories, run compaudit for list.
Ignore insecure directories and continue [y] or abort compinit [n]?

I did not think they are related but the solution to this problem, explained in this thread , also solved the main postgresql connection issue for me.我不认为它们是相关的,但这个问题的解决方案,在这个线程中解释,也为我解决了主要的 postgresql 连接问题。 But my computer keeps restarting occasionally and after this restart, I again get the main problem when I run docker-compose up inside IDE's terminal.但是我的电脑偶尔会重新启动,在重新启动后,当我在 IDE 的终端中运行docker-compose up时,我再次遇到了主要问题。 I then manually restart and it works.然后我手动重新启动它就可以了。 Although not being a permanent soluiton, this solved my problem for now.尽管不是永久解决方案,但这暂时解决了我的问题。

I had this issue after the upgrade and then I realized I haven't started docker yet.升级后我遇到了这个问题,然后我意识到我还没有启动 docker。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM