{"record":{"id":"350dae65db152587","repo":"nikivdev/code","slug":"flow-codex-maple-hosted-endpoint-and-flow-codex-ma","errorCode":null,"errorMessage":"FLOW_CODEX_MAPLE_HOSTED_ENDPOINT and FLOW_CODEX_MAPLE_HOSTED_INGEST_KEY must both be set","messagePattern":"FLOW_CODEX_MAPLE_HOSTED_ENDPOINT and FLOW_CODEX_MAPLE_HOSTED_INGEST_KEY must both be set","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/codex_telemetry.rs","lineNumber":261,"sourceCode":"            traces_endpoint: endpoint,\n            ingest_key: key,\n        }),\n        (None, None) => {}\n        _ => anyhow::bail!(\n            \"FLOW_CODEX_MAPLE_LOCAL_ENDPOINT and FLOW_CODEX_MAPLE_LOCAL_INGEST_KEY must both be set\"\n        ),\n    }\n\n    match (\n        env_non_empty_with_store(\"FLOW_CODEX_MAPLE_HOSTED_ENDPOINT\", &mut personal_env),\n        env_non_empty_with_store(\"FLOW_CODEX_MAPLE_HOSTED_INGEST_KEY\", &mut personal_env),\n    ) {\n        (Some(endpoint), Some(key)) => targets.push(MapleIngestTarget {\n            traces_endpoint: endpoint,\n            ingest_key: key,\n        }),\n        (None, None) => {}\n        _ => anyhow::bail!(\n            \"FLOW_CODEX_MAPLE_HOSTED_ENDPOINT and FLOW_CODEX_MAPLE_HOSTED_INGEST_KEY must both be set\"\n        ),\n    }\n\n    let csv_endpoints =\n        env_non_empty_with_store(\"FLOW_CODEX_MAPLE_TRACES_ENDPOINTS\", &mut personal_env)\n            .map(|raw| {\n                raw.split(',')\n                    .map(|value| value.trim().to_string())\n                    .filter(|value| !value.is_empty())\n                    .collect::<Vec<_>>()\n            })\n            .unwrap_or_default();\n    let csv_keys = env_non_empty_with_store(\"FLOW_CODEX_MAPLE_INGEST_KEYS\", &mut personal_env)\n        .map(|raw| {\n            raw.split(',')\n                .map(|value| value.trim().to_string())\n                .filter(|value| !value.is_empty())","sourceCodeStart":243,"sourceCodeEnd":279,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/codex_telemetry.rs#L243-L279","documentation":"Same paired-variable contract as the local target but for the hosted Maple ingest: `FLOW_CODEX_MAPLE_HOSTED_ENDPOINT` and `FLOW_CODEX_MAPLE_HOSTED_INGEST_KEY` must be set together or not at all. A half-configured hosted target aborts config parsing in `parse_maple_exporter_config_from_env`, used by `status` and `flush`.","triggerScenarios":"Calling telemetry `status` or `flush` with exactly one of `FLOW_CODEX_MAPLE_HOSTED_ENDPOINT` / `FLOW_CODEX_MAPLE_HOSTED_INGEST_KEY` set (or one present but empty).","commonSituations":"Provisioning hosted Maple and copying only the endpoint into the environment; secrets manager exposing one key but not the other; casing/typo mismatches between the two variable names.","solutions":["Set both FLOW_CODEX_MAPLE_HOSTED_ENDPOINT and FLOW_CODEX_MAPLE_HOSTED_INGEST_KEY to non-empty values","Or remove both variables to disable the hosted target","Verify the variable names character-for-character (HOSTED, not LOCAL)"],"exampleFix":"// before\nFLOW_CODEX_MAPLE_HOSTED_ENDPOINT=https://maple.example.com\n# after (both set)\nFLOW_CODEX_MAPLE_HOSTED_ENDPOINT=https://maple.example.com\nFLOW_CODEX_MAPLE_HOSTED_INGEST_KEY=sk-hosted-456","handlingStrategy":"validation","validationCode":"fn hosted_maple_config_ok() -> bool {\n    let ep = std::env::var(\"FLOW_CODEX_MAPLE_HOSTED_ENDPOINT\").ok().filter(|v| !v.is_empty());\n    let key = std::env::var(\"FLOW_CODEX_MAPLE_HOSTED_INGEST_KEY\").ok().filter(|v| !v.is_empty());\n    ep.is_some() == key.is_some()\n}\nassert!(hosted_maple_config_ok(), \"set both FLOW_CODEX_MAPLE_HOSTED_* vars or neither\");","typeGuard":"fn paired_non_empty(a: Option<&str>, b: Option<&str>) -> Option<(&str, &str)> {\n    match (a.filter(|v| !v.trim().is_empty()), b.filter(|v| !v.trim().is_empty())) {\n        (Some(x), Some(y)) => Some((x, y)),\n        _ => None,\n    }\n}","tryCatchPattern":"match telemetry::flush() {\n    Err(e) if e.to_string().contains(\"HOSTED_ENDPOINT\") => {\n        eprintln!(\"{} — fix FLOW_CODEX_MAPLE_HOSTED_* pair in env\", e);\n        Err(e)\n    }\n    other => other,\n}","preventionTips":["Provision endpoint and ingest key as a single unit in your secrets manager","Keep HOSTED_* and LOCAL_* namespaces separate to avoid copy/paste mixups","Add an env preflight check before enabling hosted Maple export"],"tags":["telemetry","env","config","maple"],"backgroundTag":"missing-env-var","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}