{"record":{"id":"3d97609ad659d2c4","repo":"jdx/mise","slug":"url-must-use-s3-scheme-got","errorCode":null,"errorMessage":"URL must use s3:// scheme, got: {}","messagePattern":"URL must use s3:// scheme, got: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/backend/s3.rs","lineNumber":77,"sourceCode":"use std::path::{Path, PathBuf};\nuse std::sync::Arc;\nuse tokio::sync::OnceCell;\nuse url::Url;\n\n/// Parsed S3 URL components\n#[derive(Debug, Clone)]\nstruct S3Url {\n    bucket: String,\n    key: String,\n}\n\nimpl S3Url {\n    /// Parse an S3 URL like \"s3://bucket/path/to/object?region=us-west-2\"\n    fn parse(url_str: &str) -> Result<Self> {\n        let url = Url::parse(url_str).map_err(|e| eyre!(\"Invalid S3 URL: {e}\"))?;\n\n        if url.scheme() != \"s3\" {\n            bail!(\"URL must use s3:// scheme, got: {}\", url.scheme());\n        }\n\n        let bucket = url\n            .host_str()\n            .ok_or_else(|| eyre!(\"S3 URL must include bucket name\"))?\n            .to_string();\n\n        if bucket.is_empty() {\n            bail!(\"S3 URL must include bucket name\");\n        }\n\n        let key = url.path().trim_start_matches('/').to_string();\n\n        Ok(Self { bucket, key })\n    }\n}\n\n/// S3 backend for downloading tools from Amazon S3 or S3-compatible storage","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/backend/s3.rs#L59-L95","documentation":"S3Url::parse validates that a supplied artifact URL uses the s3:// scheme before extracting bucket and key. Any other scheme (https://, file://, a typo like s4://) is rejected with this error so the S3 backend never receives a URL it cannot address.","triggerScenarios":"Configuring an S3 backend URL in mise settings/mirror config with a non-s3 scheme, e.g. an https endpoint URL pasted where s3://bucket/key is expected.","commonSituations":"Copying an https S3 console or presigned URL into S3 backend config; omitting the scheme entirely so the parser infers the wrong scheme; mixing up HTTP-endpoint config with s3:// URL config.","solutions":["Rewrite the URL to use the s3:// scheme: s3://bucket/path/to/object (region can be a query param)","Use the correct backend/config field for https-based endpoints if that is what you have","Check for typos in the scheme (s3://, not s4:// or 3s://)"],"exampleFix":"// before\nMISE_S3_URL=https://my-bucket.s3.us-west-2.amazonaws.com/tool.tar.gz\n// after\nMISE_S3_URL=s3://my-bucket/tool.tar.gz?region=us-west-2","handlingStrategy":"validation","validationCode":"// validate S3 backend URL before configuring\nfunction isS3Url(s) { return /^s3:\\/\\/[^/]+\\/.+/.test(s); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always write S3 backend locations as s3://bucket/key","Keep https endpoints in the endpoint/region config, not the s3:// URL field","Double-check scheme spelling when copying URLs"],"tags":["s3","url","config"],"backgroundTag":"invalid-url-format","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}