vectordotdev/vector · error
Invalid short volume mount format
Error message
Invalid short volume mount format: {s} What it means
Thrown while preparing Docker Compose volumes for integration tests. Short-form volume mounts (strings) must contain a `:` separator so the host source side can be extracted and validated against the top-level `volumes:` map. A short mount string without any colon cannot be parsed, so vdev rejects it with this message.
Solutions
- Rewrite the offending short mount to include both parts, e.g. `mydata:/var/lib/data`.
- Or convert the mount to long-form syntax `{ type: volume, source: mydata, target: /var/lib/data }` which takes the `source` field path instead.
- Ensure the volume source (left side of `:`) is declared in the compose top-level `volumes:` map, since the parsed source is looked up there next.
Example fix
# before
services:
test:
volumes:
- mydata
# after
services:
test:
volumes:
- mydata:/var/lib/data Defensive patterns
Strategy: validation
Validate before calling
def valid_short_mount(v):
return isinstance(v, str) and ':' in v and v.split(':', 1)[0]
for s in service_volumes:
assert valid_short_mount(s), f"short volume mount needs 'source:target': {s}" Prevention
- Never list a bare volume name in compose `volumes:`; always include the container target path.
- Lint compose files (docker compose config) before feeding them to integration tooling.
- Ensure every short mount source exists in the top-level `volumes:` map.
When it happens
Trigger: A compose service in the integration config declares `volumes: ["mydata"]` (or any string without `:`) and `prepare_compose_volumes` iterates it: `s.split_once(':')` returns None, triggering the error.
Common situations: Hand-editing a docker-compose test file and adding an anonymous/named volume as a bare string instead of `name:/container/path`; copy-pasting a long-form mount into the short list; YAML quoting issues collapsing `a:b` incorrectly.
Understand the failure class
Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.
Related errors
- Could not find environment named
- environment is already up
- Integration has no environments
- No environment for is up.
- a record with a next ID must have an event count
AI-assisted analysis of vectordotdev/vector@bdb87aeaa4 (2026-09-16).
Data as JSON: /api/errors/7a27f687ad526319.
Report an issue: GitHub.
Appendix: source
Thrown at vdev/src/testing/integration.rs:443
/// Unix permissions mask to allow everybody to read a file
const ALL_READ: u32 = 0o444;
/// Unix permissions mask to allow everybody to read a directory
const ALL_READ_DIR: u32 = 0o555;
/// Fix up potential issues before starting a compose container
pub fn prepare_compose_volumes(
config: &ComposeConfig,
test_dir: &Path,
environment: &Environment,
) -> Result<()> {
for service in config.services.values() {
if let Some(volumes) = &service.volumes {
for volume in volumes {
let source = match volume {
VolumeMount::Short(s) => {
s.split_once(':').map(|(s, _)| s).ok_or_else(|| {
anyhow::anyhow!("Invalid short volume mount format: {s}")
})?
}
VolumeMount::Long { source, .. } => source,
};
let source = resolve_placeholders(source, environment);
if !config.volumes.contains_key(&source)
&& !source.starts_with('/')
&& !source.starts_with('$')
{
let path: PathBuf = [test_dir, Path::new(&source)].iter().collect();
add_read_permission(&path)?;
}
}
}
}
Ok(())
}
View on GitHub (pinned to bdb87aeaa4)