Skip to content
This repository was archived by the owner on Aug 14, 2023. It is now read-only.
This repository was archived by the owner on Aug 14, 2023. It is now read-only.

Can't connect to database at 127.0.0.1 with docker run supabase/pgadmin-schema-diff #26

@karolzlot

Description

@karolzlot

Bug report

Describe the bug

Can't connect to database at 127.0.0.1 with docker run supabase/pgadmin-schema-diff

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

I have local database running in docker. I can easily connect to it using either psql connection_string or psycopg2.connect(connection_string), but when I use the same connection_string with docker run supabase/pgadmin-schema-diff I am getting:

docker run supabase/pgadmin-schema-diff 'postgres://XXX:[email protected]:5432/postgres' 'postgres://postgres:[email protected]:6543/postgres' > diff_demo1.sql
Starting schema diff...
Traceback (most recent call last):
  File "cli.py", line 398, in <module>
    src_db_id, src_schema_id = get_db_and_schema_id(
  File "cli.py", line 227, in get_db_and_schema_id
    conn = psycopg2.connect(connection_string)
  File "/venv/lib/python3.8/site-packages/psycopg2/__init__.py", line 127, in connect  
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: could not connect to server: Connection refused
        Is the server running on host "127.0.0.1" and accepting
        TCP/IP connections on port 5432?

It seems to me that because this tool runs in docker it has it's own 127.0.0.1.

Expected behavior

It should connect and make diff

Screenshots

n/a

System information

  • OS: I tested on both Windows and Ubuntu on WSL2
  • Browser (if applies) n/a
  • Version of supabase-js: n/a
  • Version of Node.js: n/a

Additional context

n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions