{"record":{"id":"bae0f4bdca828627","repo":"linera-io/linera-protocol","slug":"no-errors-present-but-no-data-returned","errorCode":null,"errorMessage":"no errors present but no data returned","messagePattern":"no errors present but no data returned","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"linera-faucet/client/src/lib.rs","lineNumber":153,"sourceCode":"                .filter_map(|error| {\n                    error\n                        .get(\"message\")\n                        .and_then(|msg| msg.as_str())\n                        .map(|s| s.to_string())\n                })\n                .collect::<Vec<_>>();\n\n            if messages.is_empty() {\n                Err(Error::GraphQl(errors))\n            } else {\n                Err(Error::GraphQl(vec![serde_json::Value::String(\n                    messages.join(\"; \"),\n                )]))\n            }\n        } else {\n            Ok(response\n                .data\n                .expect(\"no errors present but no data returned\"))\n        }\n    }\n\n    /// Fetches the network's genesis configuration from the faucet.\n    pub async fn genesis_config(&self) -> Result<GenesisConfig, Error> {\n        #[derive(serde::Deserialize)]\n        #[serde(rename_all = \"camelCase\")]\n        struct Response {\n            genesis_config: GenesisConfig,\n        }\n\n        Ok(self\n            .query::<Response>(\"query { genesisConfig }\")\n            .await?\n            .genesis_config)\n    }\n\n    /// Fetches the faucet's version information.","sourceCodeStart":135,"sourceCodeEnd":171,"githubUrl":"https://github.com/linera-io/linera-protocol/blob/6c226ddcb332ef55118dc8d0aafbd093d5420899/linera-faucet/client/src/lib.rs#L135-L171","documentation":"linera-faucet-client's query method (linera-faucet/client/src/lib.rs) posts a GraphQL query and inspects the response envelope. When the envelope contains no `errors` but `data` is null, it expects data to be present - so a 200 response whose body has data:null panics the client. This means the server answered successfully but produced no data, which in practice is a client/server schema or version mismatch or a faucet bug, not a transport failure.","triggerScenarios":"Calling faucet client APIs (genesis_config, version_info, claim, etc.) against a faucet server whose GraphQL schema differs from the client's expectation - e.g. renamed fields, different casing, or an older/newer faucet release. Also a proxy or gateway that rewrites the body and drops the data field.","commonSituations":"linera CLI (with built-in faucet client) pointed at a faucet of a different release; devnet faucet updated while the local CLI stayed on an older version; URL pointing at a generic GraphQL endpoint instead of the faucet.","solutions":["Check faucet and client versions match: query `query { version }` via curl and compare with your linera release.","Point the client at the correct faucet URL for your network (the faucet URL shipped with your linera version).","Reproduce with curl to inspect the raw body: `curl -s <url> -H 'content-type: application/json' -d '{\"query\":\"query { version }\"}'` and check whether data is null.","Upgrade or downgrade linera so client and faucet come from the same release."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Probe the faucet before real queries: a cheap query both proves reachability\n// and lets you pin the expected version.\nlet version = faucet_client.version_info().await?;\nif version.major != EXPECTED_FAUCET_MAJOR {\n    anyhow::bail!(\"faucet version {version} does not match client expectation {EXPECTED_FAUCET_MAJOR}\");\n}","typeGuard":null,"tryCatchPattern":"// The library panics rather than returning Err; isolate calls with catch_unwind:\nlet outcome = std::panic::catch_unwind(AssertUnwindSafe(|| {\n    block_on(faucet_client.genesis_config())\n}));\nmatch outcome {\n    Ok(Ok(config)) => Ok(config),\n    Ok(Err(e)) => Err(e.into()),\n    Err(_) => Err(anyhow::anyhow!(\"faucet returned 200 but no data; client/server version mismatch?\")),\n}","preventionTips":["Use faucet URLs shipped with your linera release; don't mix CLI and faucet versions.","After any faucet upgrade, run a probe query (query { version }) before automated claims.","In tests, run a local faucet from the same source tree as the client."],"tags":["linera-faucet","graphql","version-mismatch","panic","rust"],"backgroundTag":"graphql-null-response","analyzedSha":"6c226ddcb332ef55118dc8d0aafbd093d5420899","analyzedAt":"2026-08-22T22:49:09.787Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}