teammates icon indicating copy to clipboard operation
teammates copied to clipboard

PostgreSQL port conflict when running dev server

Open DhiraPT opened this issue 9 months ago • 9 comments

When running ./gradlew serverRun, the application attempts to connect to PostgreSQL. However, if a local PostgreSQL instance is already running on port 5432, it conflicts with the Dockerized PostgreSQL instance, causing authentication failures and preventing the dev server from starting.

Error:

org.postgresql.util.PSQLException: FATAL: password authentication failed for user "teammates"

Possible solutions:

  1. Add this issue in the Developer Troubleshooting Guide instructing developers to manually kill the local PostgreSQL server process if they encounter this issue.
  2. Modify the docker-compose.yml and write a bash script to dynamically find an available port before running the dev server.

DhiraPT avatar Mar 26 '25 15:03 DhiraPT

Good catch – I suggest adding this issue to the developer documentation (option 1) rather than modifying the docker-compose. Should be a relatively simple addition.

xenosf avatar Mar 27 '25 07:03 xenosf

Good First Issue - Notes for Contributors This issue is for first-time contributors only. If you are new to TEAMMATES, feel free to submit a PR for this issue.

Please note that we allow only one good first issue per contributor. If you have already made a prior contribution to TEAMMATES, you may wish to take a look at issues with the help wanted tag instead.

We do not assign issues to contributors. If you would like to pick up this issue, do post a comment below to express your interest and check if there is anyone else who is already working on the issue. We will do our best to reply and give you the go-ahead, but if we don't, feel free to submit a PR as long as there is no one else working on it.

To get started, do read through our contributing guidelines carefully, and set up a development environment on your local machine before making a PR.

If you need any clarifications on our developer guide, or are facing issues that are not found in our troubleshooting guide, please post a message in our discussion forum.

github-actions[bot] avatar Mar 27 '25 07:03 github-actions[bot]

Hey @xenosf is it okay if i take this task?

bpiper02 avatar Mar 30 '25 21:03 bpiper02

Hi @bpiper02 Thank you for your interest in contributing to TEAMMATES! Please go ahead to submit a PR for this issue

jasonqiu212 avatar Mar 31 '25 03:03 jasonqiu212

Should the PR be submitted to documentation.md or development.md?

bpiper02 avatar Mar 31 '25 23:03 bpiper02

Should the PR be submitted to documentation.md or development.md?

You can add it to docs/troubleshooting-guide.md under the Common setup errors and solutions section. This will then be displayed on https://teammates.github.io/teammates/troubleshooting-guide.html.

DhiraPT avatar Apr 01 '25 16:04 DhiraPT

@DhiraPT @bpiper02 can we directly change the Attached port no of PostgreSQL in docker-compose.yml ?

shubham9069 avatar Apr 02 '25 18:04 shubham9069

@DhiraPT @bpiper02 can we directly change the Attached port no of PostgreSQL in docker-compose.yml ?

Yes, we can, but it will still cause a conflict if the port of the running PostgreSQL instance is the same as the one in Docker.

DhiraPT avatar Apr 03 '25 10:04 DhiraPT

Yeah, but if we change the port no of the local machine, it will work.

shubham9069 avatar Apr 03 '25 10:04 shubham9069

Hi @DhiraPT, I noticed this issue hasn't been tackled yet. Is it okay if I take it up?

myrilla12 avatar Jul 04 '25 17:07 myrilla12

@myrilla12 Hi, yes sure!

DhiraPT avatar Jul 04 '25 18:07 DhiraPT