containers icon indicating copy to clipboard operation
containers copied to clipboard

[bitnami/discourse] Bitnami Discourse image attempts PostgreSQL socket connection instead of TCP/IP

Open nalingovind opened this issue 1 year ago • 3 comments

Name and Version

bitnami/discourse:3.4.2

What architecture are you using?

amd64

What steps will reproduce the bug?

Hi Bitnami team,

I'm encountering an issue with the official Bitnami Discourse Docker image. Upon startup, the container fails to connect to the PostgreSQL server.

It appears that the application is attempting to connect via a local Unix socket instead of using a TCP/IP connection. In many containerized setups (especially when the database is in a separate container or hosted remotely), socket-based connections are not possible or expected.

What is the expected behavior?

Discourse should use the TCP/IP host and port specified in the environment variables to connect to PostgreSQL.

POSTGRESQL_HOST=your-db-host
POSTGRESQL_PORT_NUMBER=5432
DISCOURSE_DATABASE_NAME=bitnami_discourse
DISCOURSE_DATABASE_USERNAME=bn_discourse
DISCOURSE_DATABASE_PASSWORD=your-password

What do you see instead?

I get the error in the logs

URGENT: Failed to initialize site default: ActiveRecord::ConnectionNotEstablished
connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory

Additional information

I went through the bitnami/containers repository and found that the env which we pass to the containers were not being used, I added some additonal env variables and it seems to work now. Due to some constraints from our side we could not specifically find out which variables fixed the issue

DISCOURSE_DB_SOCKET=""
DISCOURSE_DB_HOST=your-db-host
DISCOURSE_DB_PORT=5432
DISCOURSE_DB_NAME=bitnami_discourse
DISCOURSE_DB_USERNAME=bn_discourse
DISCOURSE_DB_PASSWORD=your-password
DISCOURSE_SOCKET_BASE=""

nalingovind avatar Apr 22 '25 05:04 nalingovind

Hi, the issue may not be directly related to the Bitnami container image/Helm chart, but rather to how the application is being utilized, configured in your specific environment, or tied to a particular scenario that is not easy to reproduce on our side.

If you think that's not the case and would like to contribute a solution, we'd like to invite you to create a pull request. The Bitnami team is excited to review your submission and offer feedback. You can find the contributing guidelines here.

Your contribution will greatly benefit the community. Please don't hesitate to contact us if you have any questions or need help.

Suppose you have questions about the application, customizing its content, or using technology and infrastructure. In that case, we strongly recommend that you consult the forums and user guides provided by the project responsible for the application or technology.

With that said, we'll keep this ticket open until the stale bot automatically closes it, in case someone from the community contributes valuable insights.

carrodher avatar Apr 23 '25 08:04 carrodher

This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.

github-actions[bot] avatar May 09 '25 01:05 github-actions[bot]

Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.

github-actions[bot] avatar May 14 '25 01:05 github-actions[bot]