{"record":{"id":"ae3302c105f1d350","repo":"risingwavelabs/risingwave","slug":"missing-connector-in-with-clause","errorCode":null,"errorMessage":"missing 'connector' in with clause","messagePattern":"missing 'connector' in with clause","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/ctl/src/cmd_impl/meta/connection.rs","lineNumber":65,"sourceCode":"            }\n        );\n    }\n    Ok(())\n}\n\npub async fn validate_source(context: &CtlContext, props: String) -> anyhow::Result<()> {\n    let with_props: HashMap<String, String> =\n        serde_json::from_str::<HashMap<String, Value>>(props.as_str())\n            .expect(\"error parsing with props json\")\n            .into_iter()\n            .map(|(key, val)| match val {\n                Value::String(s) => (key, s),\n                _ => (key, val.to_string()),\n            })\n            .collect();\n    let source_type = match with_props\n        .get(\"connector\")\n        .expect(\"missing 'connector' in with clause\")\n        .as_str()\n    {\n        \"kafka\" => Ok(SourceType::Kafka),\n        _ => Err(anyhow!(\n            \"unsupported source type, only kafka sources are supported\"\n        )),\n    }?;\n    let meta_client = context.meta_client().await?;\n    let resp = meta_client\n        .rw_cloud_validate_source(source_type, with_props)\n        .await?;\n    if !resp.ok {\n        eprintln!(\"{}\", serde_json::to_string(&resp).unwrap());\n        std::process::exit(1);\n    }\n    Ok(())\n}\n","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/ctl/src/cmd_impl/meta/connection.rs#L47-L83","documentation":"validate_source parses a CREATE SOURCE's WITH properties and reads the 'connector' key to determine the source type. This expect() panic means the WITH clause passed to the risectl/meta connection validation had no 'connector' entry at all, so the source type cannot be classified.","triggerScenarios":"Calling the source-validation command path with a WITH props map that lacks the 'connector' key (e.g. an empty or hand-built props map omitting 'connector' => 'kafka').","commonSituations":"Hand-crafting a with-clause JSON for risectl testing; a config migration or CLI wrapper that drops connector properties; copy-pasted props from another system that uses a different key name.","solutions":["Add \"connector\" = \"<type>\" (e.g. 'kafka') to the WITH clause before invoking validation","Verify the props JSON passed to the command is the full source WITH clause, not a subset","Replace the CLI path that builds props so it always includes the connector field"],"exampleFix":"// before\nWITH (topic = 'events')\n// after\nWITH (connector = 'kafka', topic = 'events')","handlingStrategy":"validation","validationCode":"if !with_props.contains_key(\"connector\") {\n    return Err(anyhow!(\"with clause must include 'connector'\"));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always include connector in WITH clauses for sources","Validate props JSON keys before passing to risectl commands"],"tags":["rust","risingwave","missing-key","cli"],"backgroundTag":"missing-required-config-field","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}