Skip to content
This repository was archived by the owner on Apr 29, 2024. It is now read-only.

Conversation

@steve-chavez
Copy link
Member

Problem

When having a running postgresql, the following error is produced:

$ nix run .#start-server 15
...
2023-08-19 15:25:26.476 -05 [1021103] LOG:  starting PostgreSQL 15.3 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 12.3.0, 64-bit
2023-08-19 15:25:26.476 -05 [1021103] LOG:  could not bind IPv6 address "::1": Address already in use
2023-08-19 15:25:26.476 -05 [1021103] HINT:  Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
2023-08-19 15:25:26.476 -05 [1021103] LOG:  could not bind IPv4 address "127.0.0.1": Address already in use
2023-08-19 15:25:26.476 -05 [1021103] HINT:  Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
2023-08-19 15:25:26.476 -05 [1021103] WARNING:  could not create listen socket for "localhost"
2023-08-19 15:25:26.476 -05 [1021103] FATAL:  could not create any TCP/IP sockets
2023-08-19 15:25:26.479 -05 [1021103] LOG:  database system is shut down

This is because it runs using the default 5432.

Solution

This changes the default port to 5435 to avoid conflicts.

Additionally:

  • Parametrizes the pg default port for all configs(docker and local)
  • Adds a port parameter to #start-client, e.g. nix run .#start-client 15 5433

When having a running postgresql, the following error is produced:

```
$ nix run .#start-server 15
...
2023-08-19 15:25:26.476 -05 [1021103] LOG:  starting PostgreSQL 15.3 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 12.3.0, 64-bit
2023-08-19 15:25:26.476 -05 [1021103] LOG:  could not bind IPv6 address "::1": Address already in use
2023-08-19 15:25:26.476 -05 [1021103] HINT:  Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
2023-08-19 15:25:26.476 -05 [1021103] LOG:  could not bind IPv4 address "127.0.0.1": Address already in use
2023-08-19 15:25:26.476 -05 [1021103] HINT:  Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
2023-08-19 15:25:26.476 -05 [1021103] WARNING:  could not create listen socket for "localhost"
2023-08-19 15:25:26.476 -05 [1021103] FATAL:  could not create any TCP/IP sockets
2023-08-19 15:25:26.479 -05 [1021103] LOG:  database system is shut down
```

This is because it runs using the default 5432.

This changes the default port to 5435 to avoid conflicts.

Additionally:

- Parametrizes the pg default port for all configs(docker and local)
- Adds a port parameter to #start-client, e.g. `nix run .#start-client
  15 5433`
@steve-chavez
Copy link
Member Author

Seems harmless, will merge.

@steve-chavez steve-chavez merged commit 14ac54b into supabase:main Aug 21, 2023
@thoughtpolice
Copy link
Collaborator

Sorry for the lack of review! LGTM though :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants