-
-
Notifications
You must be signed in to change notification settings - Fork 397
Description
did anyone see this problem - been going around in circles - is there a setting on postgres?
im on rds / postgres (not aurora)
Bug report
| 1000000
supabase-realtime | Setting RLIMIT_NOFILE to 10000
supabase-realtime | + ulimit -Sn 10000
supabase-realtime | + export ERL_CRASH_DUMP=/tmp/erl_crash.dump
supabase-realtime | + ERL_CRASH_DUMP=/tmp/erl_crash.dump
supabase-realtime | Running migrations...
supabase-realtime | + '[' false = true ']'
supabase-realtime | + echo 'Running migrations...'
supabase-realtime | + sudo -E -u nobody /app/bin/migrate
supabase-realtime | 04:54:43.527 [info] == Running 20210706140551 Realtime.Repo.Migrations.CreateTenants.change/0 forward
supabase-realtime | 04:54:43.529 [info] Starting migration to create tenants table in realtime schema
supabase-realtime | 04:54:43.529 [info] Created tenants table, creating index
supabase-realtime | 04:54:43.529 [info] Created tenants_external_id_index
supabase-realtime | 04:54:43.530 [info] execute "CREATE SCHEMA IF NOT EXISTS realtime"
supabase-realtime | 04:54:43.531 [info] schema "realtime" already exists, skipping
supabase-realtime | 04:54:43.531 [info] execute "SET search_path TO realtime"
supabase-realtime | 04:54:43.532 [info] create table tenants
supabase-realtime | 04:54:43.535 [info] execute "CREATE UNIQUE INDEX tenants_external_id_index ON realtime.tenants (external_id);"
supabase-realtime | 04:54:43.537 [info] == Migrated 20210706140551 in 0.0s
supabase-realtime | ** (DBConnection.EncodeError) Postgrex expected %DateTime{}, got ~N[2025-03-11 04:54:43]. Please make sure the value you are passing matches the definition in your table or in your query or convert the value accordingly.
supabase-realtime | (postgrex 0.19.3) lib/postgrex/type_module.ex:1084: Postgrex.DefaultTypes.encode_params/3
supabase-realtime | (postgrex 0.19.3) lib/postgrex/query.ex:75: DBConnection.Query.Postgrex.Query.encode/3
supabase-realtime | (db_connection 2.7.0) lib/db_connection.ex:1449: DBConnection.encode/5
supabase-realtime | (db_connection 2.7.0) lib/db_connection.ex:1549: DBConnection.run_prepare_execute/5
supabase-realtime | (db_connection 2.7.0) lib/db_connection.ex:772: DBConnection.parsed_prepare_execute/5
supabase-realtime | (db_connection 2.7.0) lib/db_connection.ex:764: DBConnection.prepare_execute/4
supabase-realtime | (postgrex 0.19.3) lib/postgrex.ex:306: Postgrex.query/4
supabase-realtime | ❌ Migration failed, exiting
supabase-realtime | ✅ Migrations completed
supabase-realtime | + echo '❌ Migration failed, exiting'
supabase-realtime | + echo '✅ Migrations completed'
supabase-realtime | + '[' true = true ']'
supabase-realtime | + echo 'Seeding selfhosted Realtime...'
supabase-realtime | + echo 'Checking database connection...'
supabase-realtime | + sudo -E -u nobody /app/bin/realtime eval 'IO.inspect(Realtime.Repo.query("SELECT 1"))'
supabase-realtime | Seeding selfhosted Realtime...
supabase-realtime | Checking database connection...
supabase-realtime | ** (RuntimeError) could not lookup Ecto repo Realtime.Repo because it was not started or it does not exist
supabase-realtime | (ecto 3.11.2) lib/ecto/repo/registry.ex:22: Ecto.Repo.Registry.lookup/1
supabase-realtime | (ecto_sql 3.11.3) lib/ecto/adapters/sql.ex:559: Ecto.Adapters.SQL.query/4
supabase-realtime | nofile:1: (file)
supabase-realtime | (stdlib 6.1.2) erl_eval.erl:904: :erl_eval.do_apply/7
supabase-realtime | (stdlib 6.1.2) erl_eval.erl:1192: :erl_eval.expr_list/7
supabase-realtime | (stdlib 6.1.2) erl_eval.erl:610: :erl_eval.expr/6
supabase-realtime | + echo '❌ Database connection failed'
supabase-realtime | ❌ Database connection failed
supabase-realtime | + exit 1
- 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
migrations fail on realtime docker image
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
connect realtime db to a vanilla rds postgres server -
im running this bootstrap to boot up things
https://gist.github.com/johndpope/62d3229c93bb0bb11d35b538251e8c45
services:
db:
image: supabase/postgres:14.1.0.105
container_name: realtime-db
ports:
- "5432:5432"
volumes:
- ./dev/postgres:/docker-entrypoint-initdb.d/
command: postgres -c config_file=/etc/postgresql/postgresql.conf
environment:
POSTGRES_HOST: /var/run/postgresql
POSTGRES_PASSWORD: postgres
tenant_db:
image: supabase/postgres:14.1.0.105
container_name: tenant-db
ports:
- "5433:5432"
command: postgres -c config_file=/etc/postgresql/postgresql.conf
environment:
POSTGRES_HOST: /var/run/postgresql
POSTGRES_PASSWORD: postgres
realtime:
depends_on:
- db
build: .
container_name: realtime-server
ports:
- "4000:4000"
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
PORT: 4000
DB_HOST: host.docker.internal
DB_PORT: 5432
DB_USER: postgres
DB_PASSWORD: postgres
DB_NAME: postgres
DB_ENC_KEY: supabaserealtime
DB_AFTER_CONNECT_QUERY: 'SET search_path TO _realtime'
API_JWT_SECRET: dc447559-996d-4761-a306-f47a5eab1623
SECRET_KEY_BASE: UpNVntn3cDxHJpq99YMc1T1AQgQpc8kfYTuRgBiYa15BLrx8etQoXz3gZv1/u2oq
ERL_AFLAGS: -proto_dist inet_tcp
RLIMIT_NOFILE: 1000000
DNS_NODES: "''"
APP_NAME: realtime
RUN_JANITOR: true
JANITOR_INTERVAL: 60000
LOG_LEVEL: "info"
SEED_SELF_HOST: true
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
when i boot local docker - and export data - i see it has that format for date
-- Import data for _realtime.tenants
INSERT INTO _realtime.tenants (id, name, external_id, jwt_secret, max_concurrent_users, inserted_at, updated_at, max_events_per_second, postgres_cdc_default, max_bytes_per_second, max_channels_per_client, max_joins_per_second, suspend, jwt_jwks, notify_private_alpha, private_only)
VALUES ('2bdf2307-b9ee-470d-9d92-9a248e6e0b75', 'realtime-dev', 'realtime-dev', 'eGxa2ZKVreSn7eWieRQdp60i5H6KJLiST7splFU6MVHylMSAoQ2SjsTrTTQo/+bmYjQcO4hNnGTU+D1wtlXreA==', 200, '2025-03-11 05:45:03', '2025-03-11 05:45:03', 100, 'postgres_cdc_rls', 100000, 100, 100, false, NULL, false, false)
ON CONFLICT (id) DO NOTHING;