{"record":{"id":"bd2b39717037fe72","repo":"risingwavelabs/risingwave","slug":"sql-endpoint-is-required","errorCode":null,"errorMessage":"sql endpoint is required","messagePattern":"sql endpoint is required","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/meta/node/src/lib.rs","lineNumber":256,"sourceCode":"        info!(\"> options: {:?}\", opts);\n        let config = load_config(&opts.config_path, &opts);\n        info!(\"> config: {:?}\", config);\n        info!(\"> version: {} ({})\", RW_VERSION, GIT_SHA);\n        let listen_addr = opts.listen_addr.parse().unwrap();\n        let dashboard_addr = opts.dashboard_host.map(|x| x.parse().unwrap());\n        let prometheus_addr = opts.prometheus_listener_addr.map(|x| x.parse().unwrap());\n        let meta_store_config = config.meta.meta_store_config.clone();\n        let backend = match config.meta.backend {\n            MetaBackend::Mem => {\n                if opts.sql_endpoint.is_some() {\n                    tracing::warn!(\"`--sql-endpoint` is ignored when using `mem` backend\");\n                }\n                MetaStoreBackend::Mem\n            }\n            MetaBackend::Sql => MetaStoreBackend::Sql {\n                endpoint: opts\n                    .sql_endpoint\n                    .expect(\"sql endpoint is required\")\n                    .expose_secret()\n                    .clone(),\n                config: meta_store_config,\n            },\n            MetaBackend::Sqlite => MetaStoreBackend::Sql {\n                endpoint: format!(\n                    \"sqlite://{}?mode=rwc\",\n                    opts.sql_endpoint\n                        .expect(\"sql endpoint is required\")\n                        .expose_secret()\n                ),\n                config: meta_store_config,\n            },\n            MetaBackend::Postgres => MetaStoreBackend::Sql {\n                endpoint: format!(\n                    \"postgres://{}:{}@{}/{}{}\",\n                    opts.sql_username,\n                    opts.sql_password.expose_secret(),","sourceCodeStart":238,"sourceCodeEnd":274,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/meta/node/src/lib.rs#L238-L274","documentation":"When the meta node's configured backend is `MetaBackend::Sql` (a generic SQL metadata store), the code unwraps `opts.sql_endpoint` with `.expect(\"sql endpoint is required\")`. The `sql` backend needs a connection endpoint URL to reach the metadata database, so if `--sql-endpoint` was not provided, the meta node panics at startup instead of continuing without a usable store.","triggerScenarios":"Starting the meta node with `--backend sql` (or `meta.backend = \"sql\"` in the config file) without also passing `--sql-endpoint` / env `RW_SQL_ENDPOINT`.","commonSituations":"Switching a deployment from the default `mem` backend to `sql` in the config file but forgetting to add the endpoint flag; secrets-managed env vars not propagated to the meta container; following an older runbook that predates the required endpoint flag.","solutions":["Pass `--sql-endpoint <url>` (or set env `RW_SQL_ENDPOINT`) with the metadata database connection string when using backend `sql`.","Set `meta.backend = \"mem\"` (or omit it) in the config if you did not intend to use a SQL meta store.","If endpoint is provisioned via secret manager, verify the secret is mounted and exported into the process environment.","Check your config file's `[meta]` section matches the flags you actually pass."],"exampleFix":"// before\n./risingwave meta-node --backend sql\n// after\n./risingwave meta-node --backend sql --sql-endpoint \"postgres://user:pass@host:5432/risingwave\"","handlingStrategy":"validation","validationCode":"if [[ \"${BACKEND}\" == \"sql\" && -z \"${RW_SQL_ENDPOINT:-}\" ]]; then\n  echo \"error: --sql-endpoint / RW_SQL_ENDPOINT is required when backend=sql\" >&2\n  exit 1\nfi","typeGuard":"fn sql_endpoint_ready(backend: &str, endpoint: Option<&str>) -> bool {\n    backend != \"sql\" || endpoint.map(|e| !e.trim().is_empty()).unwrap_or(false)\n}","tryCatchPattern":"match config.meta.backend {\n    MetaBackend::Sql if opts.sql_endpoint.is_none() => {\n        eprintln!(\"--sql-endpoint is required when backend=sql\");\n        std::process::exit(1);\n    }\n    _ => {}\n}","preventionTips":["Always pair --backend sql with --sql-endpoint in launch scripts and manifests.","Keep backend choice and endpoint in the same config template/secret bundle.","Set RW_SQL_ENDPOINT in the container env, not just the shell that builds the image.","Catch this in CI by dry-running meta node startup with the production config."],"tags":["rust","config","meta-store","panic","startup"],"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-14T16:17:12.679Z"}