{"record":{"id":"b69202188dca3506","repo":"databendlabs/databend","slug":"endpoint-url-is-required-for-storage-oss","errorCode":null,"errorMessage":"endpoint_url is required for storage oss","messagePattern":"endpoint_url is required for storage oss","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/query/sql/src/planner/binder/location.rs","lineNumber":263,"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_oss_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 oss\"),\n            )\n        })?;\n    let sp = StorageParams::Oss(StorageOssConfig {\n        endpoint_url: endpoint,\n        presign_endpoint_url: \"\".to_string(),\n        bucket: l.name.to_string(),\n        access_key_id: l\n            .connection\n            .get(\"access_key_id\")\n            .cloned()\n            .unwrap_or_default(),\n        access_key_secret: l\n            .connection\n            .get(\"access_key_secret\")\n            .cloned()\n            .unwrap_or_default(),\n        root,\n        role_arn: l.connection.get(\"role_arn\").cloned().unwrap_or_default(),","sourceCodeStart":245,"sourceCodeEnd":281,"githubUrl":"https://github.com/databendlabs/databend/blob/288d84d76e20a2f8f7173bda9691eb6ece301aa9/src/query/sql/src/planner/binder/location.rs#L245-L281","documentation":"When parsing an Alibaba Cloud OSS URI location, Databend requires the endpoint_url connection option because OSS has no default endpoint in this code path. If CONNECTION options for an oss:// location lack endpoint_url, parse_oss_params throws this InvalidInput error.","triggerScenarios":"CREATE STAGE / CREATE CONNECTION with URL='oss://bucket/path' and no ENDPOINT_URL in the CONNECTION options.","commonSituations":"Assuming OSS locations work with bucket name alone; migrating an S3 stage definition to OSS and dropping the endpoint; forgetting the option in a templated DDL.","solutions":["Add ENDPOINT_URL to the CONNECTION options, e.g. CONNECTION=(ENDPOINT_URL='oss-cn-hangzhou.aliyuncs.com')","Use the region-appropriate OSS endpoint from your Alibaba Cloud console","If you meant S3, use an s3:// URL instead of oss://"],"exampleFix":"-- before\nCREATE STAGE s URL='oss://mybucket/path';\n-- after\nCREATE STAGE s URL='oss://mybucket/path' CONNECTION=(ENDPOINT_URL='oss-cn-hangzhou.aliyuncs.com' ACCESS_KEY_ID='..' SECRET_ACCESS_KEY='..');","handlingStrategy":"validation","validationCode":"if url.starts_with(\"oss://\") && !opts.contains_key(\"endpoint_url\") {\n    return Err(\"ENDPOINT_URL is required for oss:// locations\".into());\n}","typeGuard":null,"tryCatchPattern":"match err.kind() { ErrorKind::InvalidInput if msg.contains(\"endpoint_url is required\") => /* prompt user for endpoint */, _ => return Err(err) }","preventionTips":["Always include ENDPOINT_URL for oss:// stages/connections","Keep a per-provider connection template with endpoint pre-filled","Pick the endpoint matching your bucket region"],"tags":["storage","oss","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"}