docker/cli ยท error
failed to cast to expected type: %w
Error message
failed to cast to expected type: %w
What it means
Error "failed to cast to expected type: %w" thrown in docker/cli.
Source
Thrown at cli/compose/interpolation/interpolation.go:71
}
return out, nil
}
func recursiveInterpolate(value any, path Path, opts Options) (any, error) {
switch value := value.(type) {
case string:
newValue, err := opts.Substitute(value, template.Mapping(opts.LookupValue))
if err != nil || newValue == value {
return value, newPathError(path, err)
}
caster, ok := opts.getCasterForPath(path)
if !ok {
return newValue, nil
}
casted, err := caster(newValue)
if err != nil {
return casted, newPathError(path, fmt.Errorf("failed to cast to expected type: %w", err))
}
return casted, nil
case map[string]any:
out := map[string]any{}
for key, elem := range value {
interpolatedElem, err := recursiveInterpolate(elem, path.Next(key), opts)
if err != nil {
return nil, err
}
out[key] = interpolatedElem
}
return out, nil
case []any:
out := make([]any, len(value))
for i, elem := range value {
interpolatedElem, err := recursiveInterpolate(elem, path.Next(PathMatchList), opts)View on GitHub (pinned to e9452d6e78)
When it happens
Trigger: Thrown at cli/compose/interpolation/interpolation.go:71 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of docker/cli@e9452d6e78 (2026-08-01).
Data as JSON: /data/errors/ab458ced7bd87826.json.
Report an issue: GitHub.