nektos/act · error
%s is not an absolute path
Error message
%s is not an absolute path
What it means
The final check in validateLinuxPath requires the container-side path to be absolute (path.IsAbs). If it is relative, the original value is returned with '%s is not an absolute path' naming the container path.
Source
Thrown at pkg/container/docker_cli.go:1135
if isValid := validator(split[1]); isValid {
containerPath = split[0]
mode = split[1]
val = fmt.Sprintf("%s:%s", path.Clean(containerPath), mode)
} else {
containerPath = split[1]
val = fmt.Sprintf("%s:%s", split[0], path.Clean(containerPath))
}
case 3:
containerPath = split[1]
mode = split[2]
if isValid := validator(split[2]); !isValid {
return val, fmt.Errorf("bad mode specified: %s", mode)
}
val = fmt.Sprintf("%s:%s:%s", split[0], containerPath, mode)
}
if !path.IsAbs(containerPath) {
return val, fmt.Errorf("%s is not an absolute path", containerPath)
}
return val, nil
}
// validateAttach validates that the specified string is a valid attach option.
func validateAttach(val string) (string, error) {
s := strings.ToLower(val)
if slices.Contains([]string{"stdin", "stdout", "stderr"}, s) {
return s, nil
}
return val, errors.New("valid streams are STDIN, STDOUT and STDERR")
}
func toNetipAddrSlice(ips []string) []netip.Addr {
if len(ips) == 0 {
return nil
}
netIPs := make([]netip.Addr, 0, len(ips))View on GitHub (pinned to 4f41128141)
Solutions
- Prefix the container path with '/', e.g. /dev/foo
- Double-check the third segment is a valid rwm mode so segments are classified correctly
- Remember the one-segment form maps the same path on both sides: --device /dev/foo
Example fix
# before --device /dev/foo:dev/foo # after --device /dev/foo:/dev/foo
Defensive patterns
Strategy: validation
Validate before calling
// Go: check container-side path is absolute before passing to act
parts := strings.SplitN(deviceVal, ":", 3)
containerPath := parts[len(parts)-1]
if len(parts) == 3 || (len(parts) == 2 && !isValidDeviceMode(parts[1])) {
containerPath = parts[1]
}
if !path.IsAbs(containerPath) { return fmt.Errorf("container path %q must be absolute", containerPath) } Prevention
- Always write the in-container path with a leading slash
- In the 2-part form, the second segment is mode-or-path: make sure it is unambiguous
When it happens
Trigger: Passing a container path without a leading slash, e.g. --device /dev/foo:dev/foo, or a two-part value whose second segment is a relative path (which the mode validator rejects, causing it to be treated as the container path).
Common situations: Omitting the leading / when writing the in-container name; or intending a mode but typing something the validator rejects, so the parser misclassifies the segment as a path.
Related errors
- bad format for path: %s
- unknown server OS: %s
- invalid device specification: %s
- bad mode specified: %s
- --pid: invalid PID mode
AI-assisted analysis of nektos/act@4f41128141 (2026-08-15).
Data as JSON: /api/errors/23e2e7a92b029501.
Report an issue: GitHub.