Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot connect to local PostgreSQL DB running in docker #28

Closed
christoff-linde opened this issue Feb 18, 2024 · 3 comments · Fixed by #29
Closed

Cannot connect to local PostgreSQL DB running in docker #28

christoff-linde opened this issue Feb 18, 2024 · 3 comments · Fixed by #29
Labels
bug Something isn't working

Comments

@christoff-linde
Copy link

christoff-linde commented Feb 18, 2024

Description

I have been trying to connect to a PostgreSQL database running in Docker.

Using the PostgreSQL driver, the connection Test button is working (and reporting a successful test). Clicking on the Connect button, nothing happens (no visual errors).

The behaviour is replicated on local running the project with pnpm tauri:dev (using the setup instructions listed in the contributing guidelines for this repo). No errors are visible in the tauri backend side of the project. The frontend shows the following error in console:

[Error] Unhandled Promise Rejection: No such file or directory (os error 2)
	(anonymous function) (index.esm.mjs:2215)

I suspected that it might be caused by invalid host settings, so I tried:

  • 0.0.0.0
  • 127.0.0.1
  • localhost
    for the host value, and get the same response.

Lastly, I also tried using the DB connection string option (again with different host variants as above) and no luck.

Running docker ps (to confirm docker/db setup) in terminal gives the following (I realise that the DB type is a timescaledb container. I can confirm however that I am getting the same behaviour using a "normal" pg database):

CONTAINER ID   IMAGE                               COMMAND                  CREATED       STATUS       PORTS                                       NAMES
3bdbec6b4163   timescale/timescaledb:latest-pg16   "docker-entrypoint.s…"   3 weeks ago   Up 3 hours   0.0.0.0:5439->5432/tcp, :::5439->5432/tcp   pih-rs-db

Using other tools (such as DataGrip and DBeaver) I can successfully view/access the database as expected.

Environments

  • Latest release
  • Local (running project using pnpm tauri:dev

System Info

  • macOS Sonoma 14.2.1
  • Docker version 25.0.3, build 4debf41

Hope that this helps :)

@kareemmahlees
Copy link
Owner

Thank you for this informative issue 🌟

If there isn't something private there, could you add an example of the docker container configuration you are using so I can reproduce it?

@christoff-linde
Copy link
Author

christoff-linde commented Feb 19, 2024

Definitely! Apologies, should've added this in the initial comment. Regardless, here is my docker-compose.yml:

version: "3"
  db:
    container_name: pih-rs-db
    image: timescale/timescaledb:latest-pg16
    environment:
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
    ports:
      - "5439:5432"
    restart: always
    volumes:
      - db:/var/lib/postgresql/data

volumes:
  db:
    driver: local

@kareemmahlees
Copy link
Owner

@christoff-linde Thank you again for your insightful issue.
I was able to reproduce the problem and hotfixed it, I pushed a new patch release and the assets are building as we speak 🚀
I hope you find some use in TableX and continue to help TableX improve 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants