{"record":{"id":"ce9d08d3a30016d0","repo":"risingwavelabs/risingwave","slug":"oss-endpoint-not-found-from-environment-variables","errorCode":null,"errorMessage":"OSS_ENDPOINT not found from environment variables","messagePattern":"OSS_ENDPOINT not found from environment variables","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"src/object_store/src/object/opendal_engine/oss.rs","lineNumber":38,"sourceCode":"use risingwave_common::config::ObjectStoreConfig;\n\nuse super::{MediaType, OpendalObjectStore, new_operator};\nuse crate::object::ObjectResult;\nuse crate::object::object_metrics::ObjectStoreMetrics;\n\nimpl OpendalObjectStore {\n    /// create opendal oss engine.\n    pub fn new_oss_engine(\n        bucket: String,\n        root: String,\n        config: Arc<ObjectStoreConfig>,\n        metrics: Arc<ObjectStoreMetrics>,\n    ) -> ObjectResult<Self> {\n        // Create oss backend builder.\n        let mut builder = Oss::default().bucket(&bucket).root(&root);\n\n        let endpoint = std::env::var(\"OSS_ENDPOINT\")\n            .unwrap_or_else(|_| panic!(\"OSS_ENDPOINT not found from environment variables\"));\n        let access_key_id = std::env::var(\"OSS_ACCESS_KEY_ID\")\n            .unwrap_or_else(|_| panic!(\"OSS_ACCESS_KEY_ID not found from environment variables\"));\n        let access_key_secret = std::env::var(\"OSS_ACCESS_KEY_SECRET\").unwrap_or_else(|_| {\n            panic!(\"OSS_ACCESS_KEY_SECRET not found from environment variables\")\n        });\n\n        builder = builder\n            .endpoint(&endpoint)\n            .access_key_id(&access_key_id)\n            .access_key_secret(&access_key_secret);\n\n        let op = new_operator(\n            &config,\n            Operator::new(builder)?.layer(LoggingLayer::default()),\n        );\n\n        Ok(Self {\n            op,","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/object_store/src/object/opendal_engine/oss.rs#L20-L56","documentation":"new_oss_engine panics when the OSS_ENDPOINT environment variable is unset or empty. The OSS object store engine requires an explicit endpoint URL (e.g. https://oss-cn-hangzhou.aliyuncs.com) to configure the OpenDAL OSS builder. The panic happens inside unwrap_or_else on std::env::var, so it aborts the process/task rather than returning ObjectResult::Err.","triggerScenarios":"Calling new_oss_engine (via ObjectStore::new / S3ObjectStore selection with OSS engine) when the OSS_ENDPOINT env var is not set in the process environment.","commonSituations":"Starting RisingWave with object_store=oss but forgetting to export OSS_ENDPOINT in the shell, systemd unit, or container image; running tests locally where only S3 env vars are set.","solutions":["Export OSS_ENDPOINT to the regional OSS HTTPS endpoint before starting the process, e.g. export OSS_ENDPOINT='https://oss-cn-hangzhou.aliyuncs.com'.","Add the variable to the deployment config (docker-compose env, k8s env, systemd Environment=) so it is always present.","If the panic-on-missing behavior is undesirable, switch to a supported object store (S3, MinIO) or modify oss.rs to return an ObjectError instead of panicking."],"exampleFix":"// before\nlet endpoint = std::env::var(\"OSS_ENDPOINT\")\n    .unwrap_or_else(|_| panic!(\"OSS_ENDPOINT not found from environment variables\"));\n// after (shell, before launch)\nexport OSS_ENDPOINT=https://oss-cn-hangzhou.aliyuncs.com","handlingStrategy":"validation","validationCode":"if std::env::var(\"OSS_ENDPOINT\").map(|v| v.is_empty()).unwrap_or(true) {\n    return Err(anyhow!(\"OSS_ENDPOINT must be set to use object_store=oss\"));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Add a startup preflight that asserts all OSS_* env vars before object store init.","Document required OSS env vars in deployment templates (docker-compose/k8s).","Never run oss-profiles without sourcing the credentials env file."],"tags":["object-store","oss","env","panic"],"backgroundTag":"missing-env-var","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"}