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

panic: dial tcp [::1]:5432: connect: connection refused #769

Closed
drifter75 opened this issue Feb 13, 2025 · 4 comments
Closed

panic: dial tcp [::1]:5432: connect: connection refused #769

drifter75 opened this issue Feb 13, 2025 · 4 comments
Labels
question Further information is requested

Comments

@drifter75
Copy link

with versions 2.6.0 & 2.6.1 deployment fails with below error.

Starting Gotify version 2.6.0@2024-11-15-19:19:19
panic: dial tcp [::1]:5432: connect: connection refused

goroutine 1 [running]:
main.main()
        /src/gotify/app.go:47 +0x39c
Starting Gotify version 2.6.0@2024-11-15-19:19:19
panic: dial tcp [::1]:5432: connect: connection refused

same compose works fine with 2.5.0

using postgres as DB.

@drifter75 drifter75 added the a:bug Something isn't working label Feb 13, 2025
@eternal-flame-AD
Copy link
Member

eternal-flame-AD commented Feb 13, 2025

Thanks, Can you post your docker inspect for a working and non working container or a reproducible compose file? I can't immediately connect the dots because we just ship the container (which doesn't define its own network stack nor how the container is supposed to connect to the database, but the [::1] strongly suggest docker network configuration issues)

Also are you using our official image or your custom build?

@eternal-flame-AD eternal-flame-AD added the question Further information is requested label Feb 13, 2025
@drifter75
Copy link
Author

gotify/server:2.5.0 & gotify/server:2.6.1 were the images used, assume these are the official ones.

gotify/server:2.5.0(working)
gotify/server:2.6.1(NotWorking)

@eternal-flame-AD
Copy link
Member

eternal-flame-AD commented Feb 13, 2025

Very likely gotify/website#91 , your docker compose environment variables must be entirely quoted or written in the key-value (dictionary) format, see gotify/website#91 (comment) for the fix and explanation.

It worked before because of a silent 'repair' mechanism present in our previous configuration parsing library that was removed when we moved back to the canonical implementation. Now the database URL wasn't being interpreted correctly.

@drifter75
Copy link
Author

Thanks 👍 resolved by removing the quotes on connection properties.

Changed:

    image: gotify/server:2.6.1
    environment:
      - TZ='Europe/Berlin'
      - GOTIFY_DATABASE_DIALECT=postgres
      - GOTIFY_DATABASE_CONNECTION="host=postgres15 port=5432 user=gotify dbname=gotify password='XXX' sslmode=disable"

to:

    image: gotify/server:2.6.1
    environment:
      - TZ='Europe/Berlin'
      - GOTIFY_DATABASE_DIALECT=postgres
      - GOTIFY_DATABASE_CONNECTION=host=postgres15 port=5432 user=gotify dbname=gotify password='XXX' sslmode=disable

@eternal-flame-AD eternal-flame-AD removed the a:bug Something isn't working label Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Development

No branches or pull requests

2 participants