{"record":{"id":"239b9aa3da48b62a","repo":"linera-io/linera-protocol","slug":"no-subscription-queries-registered","errorCode":null,"errorMessage":"no subscription queries registered","messagePattern":"no subscription queries registered","errorType":"http","errorClass":"async_graphql::Error","httpStatus":null,"severity":"error","filePath":"linera-service/src/node_service.rs","lineNumber":199,"sourceCode":"            .lock()\n            .await\n            .make_chain_client(chain_id)\n            .await?;\n        Ok(client.subscribe()?)\n    }\n\n    /// Subscribes to the result of a pre-registered GraphQL query.\n    /// Re-executes the query on every new block and pushes changed results.\n    async fn query_result(\n        &self,\n        #[graphql(desc = \"Name of the registered subscription query.\")] name: String,\n        #[graphql(desc = \"The chain to watch.\")] chain_id: ChainId,\n        #[graphql(desc = \"The application to query.\")] application_id: ApplicationId,\n    ) -> Result<impl Stream<Item = RawJson>, Error> {\n        let manager = self\n            .query_subscriptions\n            .as_ref()\n            .ok_or_else(|| Error::new(\"no subscription queries registered\"))?;\n\n        let key = crate::query_subscription::SubscriptionKey {\n            name,\n            chain_id,\n            application_id,\n        };\n\n        let receiver = manager\n            .subscribe(\n                &key,\n                Arc::clone(&self.context),\n                self.cancellation_token.clone(),\n            )\n            .map_err(|e| Error::new(e.to_string()))?;\n\n        // `sender.subscribe()` marks the current value as \"already seen\", so\n        // `WatchStream` would skip it and wait for the next change.  Grab the\n        // current snapshot first and prepend it to the stream so that every new","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/linera-io/linera-protocol/blob/6c226ddcb332ef55118dc8d0aafbd093d5420899/linera-service/src/node_service.rs#L181-L217","documentation":"The node service's `queryResult` GraphQL subscription re-executes pre-registered application queries on every new block. Registrations are supplied only at startup: each `--allow-subscription 'query Name { ... }'` CLI flag populates the QuerySubscriptionManager; with no flags, `query_subscriptions` is `None` and any `queryResult(name, chainId, applicationId)` subscription fails immediately with this message.","triggerScenarios":"Subscribing to `queryResult` against a `linera service` process started without any `--allow-subscription` flags; using a subscription name that was registered on a different service instance.","commonSituations":"Deploying the node service with an incomplete launch command; copying a subscription setup from one environment to another that lacks the flag; upgrading and dropping the flag from the service config.","solutions":["Restart the node service with `--allow-subscription 'query <Name> { ... }'` for every query you want registered (the flag is repeatable).","Use the `notifications(chainId)` subscription instead if you only need block notifications, not re-executed query results.","Make sure the operation name in your GraphQL subscription matches the name extracted from the registered query string.","Add `--subscription-ttl-secs <Name>=<secs>` where caching is needed — it presupposes registration."],"exampleFix":"# before\nlinera service ...  # no --allow-subscription flags; queryResult fails\n\n# after\nlinera service ... --allow-subscription 'query CounterValue { getCounter { value } }'","handlingStrategy":"validation","validationCode":"// before subscribing, confirm registration is part of your service config\nconst serviceArgs = readLaunchConfig();\nif (!serviceArgs.allowSubscriptions?.length) throw new Error('queryResult requires --allow-subscription on the service');","typeGuard":null,"tryCatchPattern":"try { const stream = gql.subscribe('queryResult { ... }'); } catch (e) { if (/no subscription queries registered/i.test(e.message)) { /* fall back to notifications(chainId) */ } else throw e; }","preventionTips":["Encode required --allow-subscription flags in the service's deployment manifest/systemd unit.","Prefer notifications(chainId) when query re-execution is not needed.","Smoke-test subscriptions after every service redeploy."],"tags":["node-service","graphql","subscription","configuration"],"backgroundTag":"feature-not-enabled","analyzedSha":"6c226ddcb332ef55118dc8d0aafbd093d5420899","analyzedAt":"2026-08-22T22:49:09.787Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}