Skip to content

local postgresql testing fails #222

Closed
@elegoupil

Description

@elegoupil

Hi -

I am testing local deployment -

-- I have a local connection tested and working with -

import psycopg2
try:
    conn = psycopg2.connect(host="localhost", dbname="postgres", user="postgres", password="yourpassword")
    print("Connected successfully!")
except Exception as e:
    print(f"Connection failed: {e}")

but when I run the python ./src/backend/fastapi_app/setup_postgres_database.py in local set up (having my .env set) - I get the following error

    tr, pr = await connector
             ^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\asyncio\base_events.py", line 1079, in create_connection
    infos = await self._ensure_resolved(
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\asyncio\base_events.py", line 1455, in _ensure_resolved
    return await loop.getaddrinfo(host, port, family=family, type=type,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\asyncio\base_events.py", line 901, in getaddrinfo
    return await self.run_in_executor(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\concurrent\futures\thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\socket.py", line 976, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
socket.gaierror: [Errno 11003] getaddrinfo failed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions