{"record":{"id":"3c5133ed1492a364","repo":"risingwavelabs/risingwave","slug":"stage-is-required","errorCode":null,"errorMessage":"stage is required","messagePattern":"stage is required","errorType":"validation","errorClass":"SinkError::Config","httpStatus":null,"severity":"error","filePath":"src/connector/src/sink/snowflake_redshift/snowflake.rs","lineNumber":395,"sourceCode":"            .snowflake_schema\n            .clone()\n            .ok_or(SinkError::Config(anyhow!(\"schema is required\")))?;\n        let mut snowflake_task_ctx = SnowflakeTaskContext {\n            target_table_name: target_table_name.clone(),\n            database,\n            schema_name,\n            schema: schema.clone(),\n            ..Default::default()\n        };\n\n        let (jdbc_url, connection_properties) = self.build_jdbc_connection_properties()?;\n        let client = JdbcJniClient::new_with_props(jdbc_url, connection_properties)?;\n\n        if self.with_s3 {\n            let stage = self\n                .stage\n                .clone()\n                .ok_or(SinkError::Config(anyhow!(\"stage is required\")))?;\n            snowflake_task_ctx.stage = Some(stage);\n            if is_append_only {\n                snowflake_task_ctx.pipe_name = Some(format!(\"{}_pipe\", target_table_name));\n            }\n        }\n        if !is_append_only {\n            let cdc_table_name = self\n                .snowflake_cdc_table_name\n                .clone()\n                .ok_or(SinkError::Config(anyhow!(\n                    \"intermediate.table.name is required\"\n                )))?;\n            snowflake_task_ctx.cdc_table_name = Some(cdc_table_name.clone());\n            snowflake_task_ctx.writer_target_interval_seconds = self.writer_target_interval_seconds;\n            snowflake_task_ctx.task_serverless = self.task_serverless;\n            snowflake_task_ctx.task_target_completion_interval =\n                self.task_target_completion_interval.clone();\n            if !self.task_serverless {","sourceCodeStart":377,"sourceCodeEnd":413,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/sink/snowflake_redshift/snowflake.rs#L377-L413","documentation":"When the sink is configured with S3 staging (`with_s3` is true), data is unloaded through a Snowflake external stage. `build_snowflake_task_ctx_jdbc_client` reads the `stage` option and fails with this config error if the stage name is missing from the options map.","triggerScenarios":"Creating a Snowflake sink with `snowflake.stage` omitted while S3-based unloading is enabled (e.g., `with_s3 = true` / corresponding flag set).","commonSituations":"Enabling the S3 stage path without creating/configuring the stage in Snowflake, or forgetting the `stage` option key when switching from direct JDBC writes to staged writes.","solutions":["Add `stage = '<stage_name>'` (the Snowflake external stage, e.g., `my_stage`) to the WITH options.","Create the stage in Snowflake if it does not exist: `CREATE STAGE my_stage URL='s3://...' ...`.","If S3 staging is not intended, disable the `with_s3` option so the stage is not required."],"exampleFix":"// before\nWITH (\n  connector = 'snowflake',\n  with_s3 = true\n)\n// after\nWITH (\n  connector = 'snowflake',\n  with_s3 = true,\n  stage = 'my_stage'\n)","handlingStrategy":"validation","validationCode":"if (opts.with_s3 && !opts.stage) throw new Error('stage is required when with_s3 is enabled');","typeGuard":null,"tryCatchPattern":"try { createSink(opts) } catch (e) { if (String(e).includes('stage is required')) { /* configure stage or disable with_s3 */ } }","preventionTips":["Create the Snowflake external stage before enabling with_s3.","Pair `with_s3 = true` with `stage` in the same template snippet.","If staged loading is not needed, keep with_s3 disabled."],"tags":["snowflake","sink","config","s3"],"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"}