supabase/postgres

Issue using nix start-client to spin up supabase local db

aigrinder opened this issue · 4 comments

Bug report

Ran this command
nix run github:supabase/postgres#start-client -- --file <BACKUP FILE>
after following this guide https://supabase.com/docs/guides/platform/upgrading

Getting this error

error: builder for '/nix/store/4szhr8gl1jkk537w9nlvrp5sy3lp4mlg-supabase-wrappers-0.4.3.drv' failed with exit code 1;
       last 25 log lines:
       > Executing cargoSetupPostUnpackHook
       > Finished cargoSetupPostUnpackHook
       > Running phase: patchPhase
       > Executing cargoSetupPostPatchHook
       > Validating consistency between /private/tmp/nix-build-supabase-wrappers-0.4.3.drv-0/source/Cargo.lock and /private/tmp/nix-build-supabase-wrappers-0.4.3.drv-0/cargo-vendor-dir/Cargo.lock
       > Finished cargoSetupPostPatchHook
       > Running phase: updateAutotoolsGnuConfigScriptsPhase
       > Running phase: configurePhase
       > {"success":"true"}
       > Running phase: buildPhase
       > Processing git tags...
       > Executing cargo-pgrx buildPhase
       >    Validating /nix/store/asnw23gkzy84llpljdz8jspwrdg5ixdf-postgresql-17_5/bin/pg_config
       >  Initializing data directory at /private/tmp/nix-build-supabase-wrappers-0.4.3.drv-0/tmp.WJlKy4C9yX/data-17
       > waiting for server to start....2024-12-20 05:04:05.036 GMT [13567] LOG:  starting PostgreSQL 17.0 on aarch64-apple-darwin22.4.0, compiled by clang version 16.0.6, 64-bit
       > 2024-12-20 05:04:05.037 GMT [13567] LOG:  could not bind IPv6 address "::1": Address already in use
       > 2024-12-20 05:04:05.037 GMT [13567] HINT:  Is another postmaster already running on port 5435? If not, wait a few seconds and retry.
       > 2024-12-20 05:04:05.037 GMT [13567] LOG:  could not bind IPv4 address "127.0.0.1": Address already in use
       > 2024-12-20 05:04:05.037 GMT [13567] HINT:  Is another postmaster already running on port 5435? If not, wait a few seconds and retry.
       > 2024-12-20 05:04:05.037 GMT [13567] WARNING:  could not create listen socket for "localhost"
       > 2024-12-20 05:04:05.037 GMT [13567] FATAL:  could not create any TCP/IP sockets
       > 2024-12-20 05:04:05.037 GMT [13567] LOG:  database system is shut down
       >  stopped waiting
       > pg_ctl: could not start server
       > Examine the log output.
       For full logs, run 'nix log /nix/store/4szhr8gl1jkk537w9nlvrp5sy3lp4mlg-supabase-wrappers-0.4.3.drv'.
error: 1 dependencies of derivation '/nix/store/paivdr8yvvajh11wil78yyjpqg0r2342-postgresql-and-plugins-17_5.drv' failed to build
error: 1 dependencies of derivation '/nix/store/rv3jb4yplr5nbs4s7hl4vv93smwz1iy5-postgresql-and-plugins-17_5.drv' failed to build
error: 1 dependencies of derivation '/nix/store/4mwcnybbfcghz5rrg9raa4y8ibkimql1-start-postgres-client.drv' failed to build

This is complaining about port 5435 existing, but it doesn't exist when I run this command netstat -an -p tcp | grep 5435 --> shows nothing

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

A clear and concise description of what the bug is.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Go to '…'
  2. Click on '…'
  3. Scroll down to '…'
  4. See error

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

System information

  • OS: [e.g. macOS, Windows]
  • Browser (if applies) [e.g. chrome, safari]
  • Version of supabase-js: [e.g. 6.0.2]
  • Version of Node.js: [e.g. 10.10.0]

Additional context

Add any other context about the problem here.

Full log output

nix log /nix/store/4szhr8gl1jkk537w9nlvrp5sy3lp4mlg-supabase-wrappers-0.4.3.drv
@nix { "action": "setPhase", "phase": "unpackPhase" }
Running phase: unpackPhase
unpacking source archive /nix/store/86gvkm7ah3wxbxwcz3x7fi1mvw5m4fjl-source
source root is source
Executing cargoSetupPostUnpackHook
Finished cargoSetupPostUnpackHook
@nix { "action": "setPhase", "phase": "patchPhase" }
Running phase: patchPhase
Executing cargoSetupPostPatchHook
Validating consistency between /private/tmp/nix-build-supabase-wrappers-0.4.3.drv-0/source/Cargo.lock and /private/tmp/nix-build-supaba>
Finished cargoSetupPostPatchHook
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
Running phase: updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "configurePhase" }
Running phase: configurePhase
{"success":"true"}
@nix { "action": "setPhase", "phase": "buildPhase" }
Running phase: buildPhase
Processing git tags...
Executing cargo-pgrx buildPhase
   Validating /nix/store/asnw23gkzy84llpljdz8jspwrdg5ixdf-postgresql-17_5/bin/pg_config
 Initializing data directory at /private/tmp/nix-build-supabase-wrappers-0.4.3.drv-0/tmp.WJlKy4C9yX/data-17
waiting for server to start....2024-12-20 05:04:05.036 GMT [13567] LOG:  starting PostgreSQL 17.0 on aarch64-apple-darwin22.4.0, compil>
2024-12-20 05:04:05.037 GMT [13567] LOG:  could not bind IPv6 address "::1": Address already in use
2024-12-20 05:04:05.037 GMT [13567] HINT:  Is another postmaster already running on port 5435? If not, wait a few seconds and retry.
2024-12-20 05:04:05.037 GMT [13567] LOG:  could not bind IPv4 address "127.0.0.1": Address already in use
2024-12-20 05:04:05.037 GMT [13567] HINT:  Is another postmaster already running on port 5435? If not, wait a few seconds and retry.
2024-12-20 05:04:05.037 GMT [13567] WARNING:  could not create listen socket for "localhost"
2024-12-20 05:04:05.037 GMT [13567] FATAL:  could not create any TCP/IP sockets
2024-12-20 05:04:05.037 GMT [13567] LOG:  database system is shut down
 stopped waiting
pg_ctl: could not start server
Examine the log output.

Also doesn't work when I run this

 nix run 'github:supabase/postgres#start-server' -- 15


error: builder for '/nix/store/4szhr8gl1jkk537w9nlvrp5sy3lp4mlg-supabase-wrappers-0.4.3.drv' failed with exit code 1;
       last 25 log lines:
       > Executing cargoSetupPostUnpackHook
       > Finished cargoSetupPostUnpackHook
       > Running phase: patchPhase
       > Executing cargoSetupPostPatchHook
       > Validating consistency between /private/tmp/nix-build-supabase-wrappers-0.4.3.drv-0/source/Cargo.lock and /private/tmp/nix-build-supabase-wrappers-0.4.3.drv-0/cargo-vendor-dir/Cargo.lock
       > Finished cargoSetupPostPatchHook
       > Running phase: updateAutotoolsGnuConfigScriptsPhase
       > Running phase: configurePhase
       > {"success":"true"}
       > Running phase: buildPhase
       > Processing git tags...
       > Executing cargo-pgrx buildPhase
       >    Validating /nix/store/asnw23gkzy84llpljdz8jspwrdg5ixdf-postgresql-17_5/bin/pg_config
       >  Initializing data directory at /private/tmp/nix-build-supabase-wrappers-0.4.3.drv-0/tmp.0qdYEWdX9P/data-17
       > waiting for server to start....2024-12-20 05:18:45.816 GMT [14430] LOG:  starting PostgreSQL 17.0 on aarch64-apple-darwin22.4.0, compiled by clang version 16.0.6, 64-bit
       > 2024-12-20 05:18:45.816 GMT [14430] LOG:  could not bind IPv6 address "::1": Address already in use
       > 2024-12-20 05:18:45.816 GMT [14430] HINT:  Is another postmaster already running on port 5435? If not, wait a few seconds and retry.
       > 2024-12-20 05:18:45.816 GMT [14430] LOG:  could not bind IPv4 address "127.0.0.1": Address already in use
       > 2024-12-20 05:18:45.816 GMT [14430] HINT:  Is another postmaster already running on port 5435? If not, wait a few seconds and retry.
       > 2024-12-20 05:18:45.816 GMT [14430] WARNING:  could not create listen socket for "localhost"
       > 2024-12-20 05:18:45.816 GMT [14430] FATAL:  could not create any TCP/IP sockets
       > 2024-12-20 05:18:45.816 GMT [14430] LOG:  database system is shut down
       >  stopped waiting
       > pg_ctl: could not start server
       > Examine the log output.
       For full logs, run 'nix log /nix/store/4szhr8gl1jkk537w9nlvrp5sy3lp4mlg-supabase-wrappers-0.4.3.drv'.
error: 1 dependencies of derivation '/nix/store/paivdr8yvvajh11wil78yyjpqg0r2342-postgresql-and-plugins-17_5.drv' failed to build
error: 1 dependencies of derivation '/nix/store/rv3jb4yplr5nbs4s7hl4vv93smwz1iy5-postgresql-and-plugins-17_5.drv' failed to build
error: 1 dependencies of derivation '/nix/store/b6gyn0c3l9lfczjnr2z7k3pfwv6kjlm7-start-postgres-server.drv' failed to build

Running this command works tho
nix run 'github:supabase/postgres?ref=15.6.1.115#start-server' 15

Looks like the other commands that don't work are running on postgres 17, whereas the command thta works runs on postgres 15