~/logs/realtime.logs.prod
- 1770825926622838 1024 event body
- 1770825926623156 + echo 'Running migrations' event body
- 1770825926623584 + sudo -E -u nobody /app/bin/migrate event body
- 1770825927937719 info == Running 20210706140551 Realtime.Repo.Migrations.CreateTenants.change/0 forward event body
- 1770825928015454 info == Migrated 20220410212326 in 0.0s event body
- 1770825928055657 info == Migrated 20220818141501 in 0.0s event body
- 1770825928063676 info == Running 20221102172703 Realtime.Repo.Migrations.RenamePgType.up/0 forward event body
- 1770825928063696 info execute "update extensions set type = 'postgres_cdc_rls'" event body
- 1770825928073122 info == Migrated 20230110180046 in 0.0s event body
- 1770825928084846 info == Migrated 20230810220924 in 0.0s event body
- 1770825928105336 info alter table tenants event body
- 1770825928128113 info == Running 20250811121559 Realtime.Repo.Migrations.AddMaxPresenceEventsPerSecond.change/0 forward event body
- 1770825928129580 info == Migrated 20250811121559 in 0.0s event body
- 1770825928139220 info alter table tenants event body
- 1770825928157416 + '[' true = true ']' event body
- 1770825928157447 + echo 'Seeding selfhosted Realtime' event body
- 1770825929009344 info Loading 142 CA(s) from :otp store event body
- 1770825929164994 info event=server_setup_successfully driver=tcp port=5369 socket="#Port<0.5>" event body
- 1770825929532607 notice SYN[nonode@nohost|registry<Elixir.Realtime.Tenants.Connect>] Discovering the cluster event body
- 1770825929534392 notice SYN[nonode@nohost|registry<users_3>] Discovering the cluster event body
- 1770825929769066 info [libcluster:postgres] Connected to Postgres database event body
- 1770825929995281 notice SYN[nonode@nohost] Adding node to scope <realtime_postgres_cdc_3> event body
- 1770825929996167 notice SYN[nonode@nohost|registry<realtime_postgres_cdc_4>] Discovering the cluster event body
- 1770825930162261 info == Running 20211116024918 Realtime.Tenants.Migrations.CreateRealtimeSubscriptionTable.change/0 forward event body
- 1770825930201716 info == Migrated 20211116045059 in 0.0s event body
- 1770825930215706 info execute "DO $$\nBEGIN\n IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'wal_column') THEN\n CREATE TYPE realtime.wal_column AS (\n name text,\n type text,\n value jsonb,\n is_pkey boolean,\n is_selectable boolean\n );\n END IF;\nEND$$;\n" event body
- 1770825930232473 info == Running 20211116214523 Realtime.Tenants.Migrations.CreateRealtimeApplyRlsFunction.change/0 forward event body
- 1770825930292814 info execute "alter type realtime.wal_rls rename attribute users to subscription_ids cascade;" event body
- 1770825930336006 info == Migrated 20211228014915 in 0.0s event body
- 1770825930346240 info == Running 20220228202821 Realtime.Tenants.Migrations.UpdateSubscriptionCheckFiltersFunctionDynamicTableName.change/0 forward event body
- 1770825930355701 info == Migrated 20220312004840 in 0.0s event body
- 1770825930359394 info == Running 20220603231003 Realtime.Tenants.Migrations.AddQuotedRegtypesSupport.change/0 forward event body
- 1770825930397888 info == Migrated 20220908172859 in 0.0s event body
- 1770825930413383 info == Migrated 20230119133233 in 0.0s event body
- 1770825930420166 info execute "\n create or replace function realtime.subscription_check_filters()\n returns trigger\n language plpgsql\n as $$\n /*\n Validates that the user defined filters for a subscription:\n - refer to valid columns that the claimed role may access\n - values are coercable to the correct column type\n */\n declare\n col_names text[] = coalesce(\n array_agg(c.column_name order by c.ordinal_position),\n '{}'::text[]\n )\n from\n information_schema.columns c\n where\n format('%I.%I', c.table_schema, c.table_name)::regclass = new.entity\n and pg_catalog.has_column_privilege(\n (new.claims ->> 'role'),\n format('%I.%I', c.table_schema, c.table_name)::regclass,\n c.column_name,\n 'SELECT'\n );\n filter realtime.user_defined_filter;\n col_type regtype;\n\n in_val jsonb;\n begin\n for filter in select * from unnest(new.filters) loop\n -- Filtered column is valid\n if not filter.column_name = any(col_names) then\n raise exception 'invalid column for filter %', filter.column_name;\n end if;\n\n -- Type is sanitized and safe for string interpolation\n col_type = (\n select atttypid::regtype\n from pg_catalog.pg_attribute\n where attrelid = new.entity\n and attname = filter.column_name\n );\n if col_type is null then\n raise exception 'failed to lookup type for column %', filter.column_name;\n end if;\n\n -- Set maximum number of entries for in filter\n if filter.op = 'in'::realtime.equality_op then\n in_val = realtime.cast(filter.value, (col_type::text || '[]')::regtype);\n if coalesce(jsonb_array_length(in_val), 0) > 100 then\n raise exception 'too many values for `in` filter. Maximum 100';\n end if;\n end if;\n\n -- raises an exception if value is not coercable to type\n perform realtime.cast(filter.value, col_type);\n end loop;\n\n -- Apply consistent order to filters so the unique constraint on\n -- (subscription_id, entity, filters) can't be tricked by a different filter order\n new.filters = coalesce(\n array_agg(f order by f.column_name, f.op, f.value),\n '{}'\n ) from unnest(new.filters) f;\n\n return new;\n end;\n $$;\n " event body
- 1770825930444228 info == Migrated 20230228184745 in 0.0s event body
- 1770825930448205 info execute "\n create or replace function realtime.apply_rls(wal jsonb, max_record_bytes int = 1024 * 1024)\n returns setof realtime.wal_rls\n language plpgsql\n volatile\n as $$\n declare\n -- Regclass of the table e.g. public.notes\n entity_ regclass = (quote_ident(wal ->> 'schema') || '.' || quote_ident(wal ->> 'table'))::regclass;\n\n -- I, U, D, T: insert, update ...\n action realtime.action = (\n case wal ->> 'action'\n when 'I' then 'INSERT'\n when 'U' then 'UPDATE'\n when 'D' then 'DELETE'\n else 'ERROR'\n end\n );\n\n -- Is row level security enabled for the table\n is_rls_enabled bool = relrowsecurity from pg_class where oid = entity_;\n\n subscriptions realtime.subscription[] = array_agg(subs)\n from\n realtime.subscription subs\n where\n subs.entity = entity_;\n\n -- Subscription vars\n roles regrole[] = array_agg(distinct us.claims_role)\n from\n unnest(subscriptions) us;\n\n working_role regrole;\n claimed_role regrole;\n claims jsonb;\n\n subscription_id uuid;\n subscription_has_access bool;\n visible_to_subscription_ids uuid[] = '{}';\n\n -- structured info for wal's columns\n columns realtime.wal_column[];\n -- previous identity values for update/delete\n old_columns realtime.wal_column[];\n\n error_record_exceeds_max_size boolean = octet_length(wal::text) > max_record_bytes;\n\n -- Primary jsonb output for record\n output jsonb;\n\n begin\n perform set_config('role', null, true);\n\n columns =\n array_agg(\n (\n x->>'name',\n x->>'type',\n x->>'typeoid',\n realtime.cast(\n (x->'value') #>> '{}',\n coalesce(\n (x->>'typeoid')::regtype, -- null when wal2json version <= 2.4\n (x->>'type')::regtype\n )\n ),\n (pks ->> 'name') is not null,\n true\n )::realtime.wal_column\n )\n from\n jsonb_array_elements(wal -> 'columns') x\n left join jsonb_array_elements(wal -> 'pk') pks\n on (x ->> 'name') = (pks ->> 'name');\n\n old_columns =\n array_agg(\n (\n x->>'name',\n x->>'type',\n x->>'typeoid',\n realtime.cast(\n (x->'value') #>> '{}',\n coalesce(\n (x->>'typeoid')::regtype, -- null when wal2json version <= 2.4\n (x->>'type')::regtype\n )\n ),\n (pks ->> 'name') is not null,\n true\n )::realtime.wal_column\n )\n from\n jsonb_array_elements(wal -> 'identity') x\n left join jsonb_array_elements(wal -> 'pk') pks\n on (x ->> 'name') = (pks ->> 'name');\n\n for working_role in select * from unnest(roles) loop\n\n -- Update `is_selectable` for columns and old_columns\n columns =\n array_agg(\n (\n c.name,\n c.type_name,\n c.type_oid,\n c.value,\n c.is_pkey,\n pg_catalog.has_column_privilege(working_role, entity_, c.name, 'SELECT')\n )::realtime.wal_column\n )\n from\n unnest(columns) c;\n\n old_columns =\n array_agg(\n (\n c.name,\n c.type_name,\n c.type_oid,\n " <> ... event body
- 1770825930461364 info == Running 20231018144023 Realtime.Tenants.Migrations.CreateChannels.change/0 forward event body
- 1770825930486805 info == Migrated 20231204144024 in 0.0s event body
- 1770825930494987 info == Running 20240108234812 Realtime.Tenants.Migrations.AddChannelsColumnForWriteCheck.change/0 forward event body
- 1770825930517034 info execute "GRANT INSERT ON realtime.broadcasts TO postgres, anon, authenticated, service_role\n" event body
- 1770825930530145 info execute "GRANT UPDATE ON realtime.presences TO postgres, anon, authenticated, service_role" event body
- 1770825930532045 info == Migrated 20240321100241 in 0.0s event body
- 1770825930585310 info execute "-- Commented to have oriole compatability\n-- ALTER TABLE realtime.messages SET UNLOGGED;\n" event body
- 1770825930604444 info alter table realtime.messages event body
- 1770825930615369 info execute "DO $$\nDECLARE\n rec record;\n sql text;\n role_list text;\nBEGIN\n FOR rec IN\n SELECT *\n FROM pg_policies\n WHERE schemaname = 'realtime'\n AND tablename = 'messages'\n LOOP\n -- Start constructing the create policy statement\n sql := 'CREATE POLICY ' || quote_ident(rec.policyname) ||\n ' ON realtime.messages_new ';\n\n IF (rec.permissive = 'PERMISSIVE') THEN\n sql := sql || 'AS PERMISSIVE ';\n ELSE\n sql := sql || 'AS RESTRICTIVE ';\n END IF;\n\n sql := sql || ' FOR ' || rec.cmd;\n\n -- Include roles if specified\n IF rec.roles IS NOT NULL AND array_length(rec.roles, 1) > 0 THEN\n role_list := (\n SELECT string_agg(quote_ident(role), ', ')\n FROM unnest(rec.roles) AS role\n );\n sql := sql || ' TO ' || role_list;\n END IF;\n\n -- Include using clause if specified\n IF rec.qual IS NOT NULL THEN\n sql := sql || ' USING (' || rec.qual || ')';\n END IF;\n\n -- Include with check clause if specified\n IF rec.with_check IS NOT NULL THEN\n sql := sql || ' WITH CHECK (' || rec.with_check || ')';\n END IF;\n\n -- Output the constructed sql for debugging purposes\n RAISE NOTICE 'Executing: %', sql;\n\n -- Execute the constructed sql statement\n EXECUTE sql;\n END LOOP;\nEND\n$$\n" event body
- 1770825930617224 info execute "ALTER TABLE realtime.messages RENAME TO messages_old" event body
- 1770825930622941 info execute "GRANT SELECT ON realtime.messages TO postgres, anon, authenticated, service_role" event body
- 1770825930630414 info alter table realtime.messages event body
- 1770825930644647 info execute "do $$\nbegin\n create index concurrently if not exists ix_realtime_subscription_entity on realtime.subscription using btree (entity);\nexception\n when others then\n create index if not exists ix_realtime_subscription_entity on realtime.subscription using btree (entity);\nend$$;\n" event body
- 1770825930667580 info == Running 20250107150512 Realtime.Tenants.Migrations.RealtimeSubscriptionUnlogged.change/0 forward event body
- 1770825930673585 info == Running 20250123174212 Realtime.Tenants.Migrations.RemoveUnusedPublications.change/0 forward event body
- 1770825930681881 info == Migrated 20250506224012 in 0.0s event body
- 1770825930685103 info == Migrated 20250523164012 in 0.0s event body
- 1770825930693051 info == Running 20250905041441 Realtime.Tenants.Migrations.CreateMessagesReplayIndex.change/0 forward event body
- 1770825932627663 info ["$kind": :gen_rpc_dispatcher_start] event body
- 1770825932627886 info ["$kind": :gen_rpc_dispatcher_start] event body
- 1770825932628253 info ["$kind": :gen_rpc_dispatcher_start] event body
- 1770825932657263 notice SYN[realtime@127.0.0.1] Adding node to scope <Elixir.Realtime.Tenants.Connect> event body
- 1770825932658099 notice SYN[realtime@127.0.0.1] Creating tables for scope <users_0> event body
- 1770825932658322 notice SYN[realtime@127.0.0.1|registry<users_0>] Discovering the cluster event body
- 1770825932659559 notice SYN[realtime@127.0.0.1|pg<users_2>] Discovering the cluster event body
- 1770825932743114 info Access RealtimeWeb.Endpoint at http://realtime.supabase.co:443 event body
- 1770825932746139 notice SYN[realtime@127.0.0.1|pg<realtime_postgres_cdc_2>] Discovering the cluster event body
- 1770825932746443 notice SYN[realtime@127.0.0.1|registry<realtime_postgres_cdc_3>] Discovering the cluster event body
- 1770825932747214 info Janitor started event body
- 1770856232749090 info Janitor started event body
- 1770954692754970 info Janitor started event body
- 1771003472758422 info Janitor started event body
- 1771019132759064 info Janitor started event body
- 1771069532762194 info Janitor started event body
- 1771305572775915 info Janitor started event body
- 1771434632784102 info Janitor started event body
- 1771468112786242 info Janitor started event body
- 1771648592797224 info Janitor started event body
- 1771831112808094 info Janitor started event body
- 1772452532846133 info Janitor started event body
- 1772518292850145 info Janitor started event body
- 1772878052872048 info Janitor started event body
- 1773020852880908 info Janitor started event body
- 1773375692903217 info Janitor started event body
- 1773520112912156 info Janitor started event body
- 1773632132919079 info Janitor started event body
- 1773650072920160 info Janitor started event body
- 1773666992921161 info Janitor started event body
- 1773698072923181 info Janitor started event body
- 1773973592940074 info Janitor started event body
- 1774007132942040 info Janitor started event body
- 1774021712943066 info Janitor started event body
- 1774218932955135 info Janitor started event body
- 1774647812981101 info Janitor started event body
- 1775062653006206 info Janitor started event body
- 1775228193016527 info Janitor started event body
- 1775260713018180 info Janitor started event body
- 1775437653029053 info Janitor started event body
- 1775717553046158 info Janitor started event body
- 1775863293054863 info Janitor started event body
- 1775993013063154 info Janitor started event body
- 1776009453063769 info Janitor started event body
- 1776074013068255 info Janitor started event body
random(tips): Timestamps are automatically converted to UTC if local time is displayed.