{"record":{"id":"93f8025789ac7946","repo":"neondatabase/neon","slug":"failed-to-get-list-of-active-logical-replication-s","errorCode":null,"errorMessage":"failed to get list of active logical replication subscriptions: {}","messagePattern":"failed to get list of active logical replication subscriptions: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"compute_tools/src/monitor.rs","lineNumber":316,"sourceCode":"        const LOGICAL_SUBSCRIPTIONS_QUERY: &str =\n            \"select count(*) from pg_stat_subscription where pid is not null;\";\n        match cli.query_one(LOGICAL_SUBSCRIPTIONS_QUERY, &[]) {\n            Ok(row) => match row.try_get::<&str, i64>(\"count\") {\n                Ok(num_subscribers) => {\n                    if num_subscribers > 0 {\n                        self.last_active = Some(Utc::now());\n                        return Ok(());\n                    }\n                }\n                Err(e) => {\n                    return Err(anyhow::anyhow!(\n                        \"failed to parse 'pg_stat_subscription' count: {}\",\n                        e\n                    ));\n                }\n            },\n            Err(e) => {\n                return Err(anyhow::anyhow!(\n                    \"failed to get list of active logical replication subscriptions: {}\",\n                    e\n                ));\n            }\n        }\n\n        // Do not suspend compute if autovacuum is running\n        const AUTOVACUUM_COUNT_QUERY: &str =\n            \"select count(*) from pg_stat_activity where backend_type = 'autovacuum worker'\";\n        match cli.query_one(AUTOVACUUM_COUNT_QUERY, &[]) {\n            Ok(r) => match r.try_get::<&str, i64>(\"count\") {\n                Ok(num_workers) => {\n                    if num_workers > 0 {\n                        self.last_active = Some(Utc::now());\n                        return Ok(());\n                    };\n                }\n                Err(e) => {","sourceCodeStart":298,"sourceCodeEnd":334,"githubUrl":"https://github.com/neondatabase/neon/blob/8f60b04da47ffefe0e52bda2440134b42874eb75/compute_tools/src/monitor.rs#L298-L334","documentation":"check() runs `select count(*) from pg_stat_subscription where pid is not null` so a compute with an active logical replication subscription is not suspended (the pid filter excludes read-only computes and subscriptions on branches). This error means query_one itself failed - broken connection, timeout, server error, or pg_stat_subscription not existing. It marks downtime and triggers the monitor reconnect path.","triggerScenarios":"cli.query_one on pg_stat_subscription returns Err: connection dropped mid-poll, statement timeout, Postgres restarting, or running on a server where the pg_stat_subscription view is absent (it exists only on PG 10+).","commonSituations":"Monitor polling during Postgres restarts or suspend transitions; environments running Postgres forks or versions lacking the subscription stats view; transient 'relation does not exist' during catalog upgrades.","solutions":["Check the appended error string for the SQLSTATE - 'relation does not exist' (42P01) points to a missing view, connection errors point to transport","Confirm the compute runs Postgres 10 or newer when logical subscriptions are used","Let the monitor self-heal via reconnect for transient failures","Reproduce manually as cloud_admin: select count(*) from pg_stat_subscription where pid is not null;"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"match cli.query_one(LOGICAL_SUBSCRIPTIONS_QUERY, &[]) {\n    Ok(row) => { /* parse count, keep alive if > 0 */ }\n    Err(e) => { error!(\"subscriptions check failed: {e}\"); client = conf.connect(NoTls); }\n}","preventionTips":["Run computes on Postgres 10+ when logical replication subscriptions are used","Treat missing-view errors (42P01) as environment problems, not transient ones","Retry on the next monitor tick for connection-level failures"],"tags":["postgres","logical-replication","pg-stat-subscription","rust","connection"],"backgroundTag":"postgres-query-failed","analyzedSha":"8f60b04da47ffefe0e52bda2440134b42874eb75","analyzedAt":"2026-08-16T23:39:28.135Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}