jdx/mise · error
S3 URL must include bucket name
Error message
S3 URL must include bucket name
What it means
S3Url::parse requires both a bucket (URL host) and a non-empty bucket name. This second check fires when the host parses but is empty, guaranteeing the backend always has an addressable bucket before any S3 request is built.
Solutions
- Include the bucket in the URL: s3://my-bucket/key
- Fix the templating/env var that produced an empty bucket name
- Validate the URL before handing it to mise
Example fix
// before MISE_S3_URL=s3:///tools/mise.tar.gz // after MISE_S3_URL=s3://my-company-bucket/tools/mise.tar.gz
Defensive patterns
Strategy: validation
Validate before calling
// require a bucket before use
function hasBucket(s) { const m = s.match(/^s3:\/\/([^/]+)\//); return !!m && m[1].length > 0; } Prevention
- Never template bucket names from possibly-empty env vars without a fallback check
- Validate s3:// URLs include a bucket segment before saving config
- Test templated config by echoing expanded values
When it happens
Trigger: Passing an s3:// URL with no host portion that resolves to an empty bucket string, e.g. "s3:///key" or a malformed URL where the host component is blank after parsing.
Common situations: Hand-editing an s3:// URL and deleting the bucket; templated config where the bucket variable expanded to empty (unset env var); copy/paste truncation.
Understand the failure class
Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.
Related errors
- URL must use s3:// scheme, got
- remote cache URL must use HTTPS
- a provided source resolves to a path
- additional asset ' ' is not an archive
- agent ' ' `start_calendar_interval. ` must be between and
AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17).
Data as JSON: /api/errors/1f93caf983d84978.
Report an issue: GitHub.
Appendix: source
Thrown at src/backend/s3.rs:86
key: String,
}
impl S3Url {
/// Parse an S3 URL like "s3://bucket/path/to/object?region=us-west-2"
fn parse(url_str: &str) -> Result<Self> {
let url = Url::parse(url_str).map_err(|e| eyre!("Invalid S3 URL: {e}"))?;
if url.scheme() != "s3" {
bail!("URL must use s3:// scheme, got: {}", url.scheme());
}
let bucket = url
.host_str()
.ok_or_else(|| eyre!("S3 URL must include bucket name"))?
.to_string();
if bucket.is_empty() {
bail!("S3 URL must include bucket name");
}
let key = url.path().trim_start_matches('/').to_string();
Ok(Self { bucket, key })
}
}
/// S3 backend for downloading tools from Amazon S3 or S3-compatible storage
#[derive(Debug)]
pub(crate) struct S3Backend {
ba: Arc<BackendArg>,
/// Cached S3 client, lazily initialized
client: OnceCell<S3Client>,
}
#[derive(Debug, Clone, Copy)]
struct S3Options<'a> {View on GitHub (pinned to 533346cc37)