{"record":{"id":"0efacc98f6b9229d","repo":"databendlabs/databend","slug":"endpoint-url-is-required-for-storage-cos","errorCode":null,"errorMessage":"endpoint_url is required for storage cos","messagePattern":"endpoint_url is required for storage cos","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/query/sql/src/planner/binder/location.rs","lineNumber":340,"sourceCode":"    });\n\n    l.connection\n        .check()\n        .map_err(|err| Error::new(ErrorKind::InvalidInput, err.to_string()))?;\n\n    Ok(sp)\n}\n\nfn parse_cos_params(l: &mut UriLocation, root: String) -> Result<StorageParams> {\n    let endpoint = l\n        .connection\n        .get(\"endpoint_url\")\n        .cloned()\n        .map(secure_omission)\n        .ok_or_else(|| {\n            Error::new(\n                ErrorKind::InvalidInput,\n                anyhow!(\"endpoint_url is required for storage cos\"),\n            )\n        })?;\n    let sp = StorageParams::Cos(StorageCosConfig {\n        endpoint_url: endpoint,\n        bucket: l.name.to_string(),\n        secret_id: l.connection.get(\"secret_id\").cloned().unwrap_or_default(),\n        secret_key: l.connection.get(\"secret_key\").cloned().unwrap_or_default(),\n        root,\n        network_config: None,\n    });\n\n    l.connection\n        .check()\n        .map_err(|err| Error::new(ErrorKind::InvalidInput, err.to_string()))?;\n\n    Ok(sp)\n}\n","sourceCodeStart":322,"sourceCodeEnd":358,"githubUrl":"https://github.com/databendlabs/databend/blob/288d84d76e20a2f8f7173bda9691eb6ece301aa9/src/query/sql/src/planner/binder/location.rs#L322-L358","documentation":"When parsing a Tencent Cloud COS URI location, the endpoint_url connection option is required; parse_cos_params throws this InvalidInput error when it is absent. COS endpoints encode the region and app-id, so Databend does not guess a default.","triggerScenarios":"CREATE STAGE / CREATE CONNECTION with URL='cos://bucket/path' and no ENDPOINT_URL in CONNECTION options.","commonSituations":"Setting up Tencent COS stages without the regional endpoint like cos.ap-guangzhou.myqcloud.com; forgetting the option when copying an S3 stage template.","solutions":["Add ENDPOINT_URL to CONNECTION options, e.g. CONNECTION=(ENDPOINT_URL='cos.ap-guangzhou.myqcloud.com')","Use the endpoint matching your COS bucket region and app-id","If you meant S3-compatible access, use an s3:// URL with the COS S3-compatible endpoint"],"exampleFix":"-- before\nCREATE STAGE s URL='cos://mybucket/path';\n-- after\nCREATE STAGE s URL='cos://mybucket/path' CONNECTION=(ENDPOINT_URL='cos.ap-guangzhou.myqcloud.com' SECRET_ID='..' SECRET_KEY='..');","handlingStrategy":"validation","validationCode":"if url.starts_with(\"cos://\") && !opts.contains_key(\"endpoint_url\") {\n    return Err(\"ENDPOINT_URL is required for cos:// locations\".into());\n}","typeGuard":null,"tryCatchPattern":"match err.kind() { ErrorKind::InvalidInput if msg.contains(\"endpoint_url\") => /* add ENDPOINT_URL and retry */, _ => return Err(err) }","preventionTips":["Always include ENDPOINT_URL for cos:// locations","Match endpoint to the COS bucket region/app-id","Reuse validated connection templates per provider"],"tags":["storage","cos","config","sql"],"backgroundTag":"missing-required-config-field","analyzedSha":"288d84d76e20a2f8f7173bda9691eb6ece301aa9","analyzedAt":"2026-09-11T11:29:36.208Z","contentChangedAt":"2026-09-11T11:29:36.208Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}