{"record":{"id":"31cb1b4b087558d4","repo":"risingwavelabs/risingwave","slug":"source-validation-failed","errorCode":null,"errorMessage":"source validation failed","messagePattern":"source validation failed","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/connector/src/source/cdc/enumerator/mod.rs","lineNumber":144,"sourceCode":"                };\n\n                let validate_source_request_bytes =\n                    env.byte_array_from_slice(&Message::encode_to_vec(&validate_source_request))?;\n\n                let validate_source_response_bytes = call_static_method!(\n                    env,\n                    {com.risingwave.connector.source.JniSourceValidateHandler},\n                    {byte[] validate(byte[] validateSourceRequestBytes)},\n                    &validate_source_request_bytes\n                )?;\n\n                let validate_source_response: ValidateSourceResponse = Message::decode(\n                    risingwave_jni_core::to_guarded_slice(&validate_source_response_bytes, env)?\n                        .deref(),\n                )?;\n\n                if let Some(error) = validate_source_response.error {\n                    return Err(anyhow!(error.error_message).context(\"source validation failed\"));\n                }\n\n                Ok(())\n            })\n        })\n        .await\n        .context(\"failed to validate source\")??;\n\n        tracing::debug!(\"validate cdc source properties success\");\n        Ok(Self {\n            source_id,\n            worker_node_addrs: server_addrs,\n            metrics: context.metrics.clone(),\n            pg_cdc_upstream_max_lsn: None,\n            pg_cdc_confirmed_flush_lsn: None,\n            mysql_cdc_binlog_file_seq_min: None,\n            mysql_cdc_binlog_file_seq_max: None,\n            sqlserver_cdc_upstream_min_lsn: None,","sourceCodeStart":126,"sourceCodeEnd":162,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/source/cdc/enumerator/mod.rs#L126-L162","documentation":"During CDC source validation, RisingWave invokes the Java (Debezium) connector via JNI and decodes a ValidateSourceResponse. If the response carries an error field, the inner error_message is wrapped with the context 'source validation failed', meaning the external connector rejected the source configuration (bad broker address, credentials, topic, table, etc.).","triggerScenarios":"CREATE SOURCE ... CONNECTOR TYPE CDC (JDBC/Postgres/MySQL/SQL Server) where the Debezium-side validation returns error — unreachable database, wrong hostname/port/user/password, missing table, or unsupported connector config; raised in CdcSplitEnumerator::new validation path.","commonSituations":"Wrong JDBC connection parameters; database firewall blocking access; user lacks replication privileges; typos in CDC config options.","solutions":["Read the inner error_message (shown below the context) and fix the Debezium config it points at (hostname, port, user, password, database, table)","Verify the upstream database is reachable from RisingWave (network/firewall/DNS)","Confirm the CDC user has required privileges (e.g. REPLICATION for Postgres)","Fix or remove invalid options in the WITH clause and retry CREATE SOURCE"],"exampleFix":"// before\nWITH (connector='cdc', hostname='db.internal', port='5433', ...)\n// after\nWITH (connector='cdc', hostname='db.internal', port='5432', username='rw', password='***', ...)","handlingStrategy":"validation","validationCode":"// pre-check upstream DB before CREATE SOURCE ... CONNECTOR TYPE CDC\nlet client = tokio_postgres::connect(&pg_config, NoTls).await?; // verifies host/port/credentials","typeGuard":null,"tryCatchPattern":"match create_source_result {\n    Err(e) if e.root_cause().to_string() != \"source validation failed\" => return Err(e),\n    Err(e) => {\n        // surface the nested Debezium error_message to the user\n        tracing::error!(\"CDC validation: {}\", e);\n        Err(e)\n    }\n    ok => ok,\n}","preventionTips":["Verify hostname/port/user/password/replication privileges for the upstream database before creating a CDC source","Ensure RisingWave can reach the database over the network (firewall, DNS)","Read the inner Debezium error_message; it names the exact misconfiguration"],"tags":["cdc","jni","debezium","validation","postgres"],"backgroundTag":"schema-validation-failed","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}