hashicorp/nomad · error
Failed to parse %q as octal: %v
Error message
Failed to parse %q as octal: %v
What it means
Appended by template validation when the Perms field cannot be parsed as an octal file mode by strconv.ParseUint with base 8. The permissions string is not a valid octal value (e.g. contains an 8/9 or wrong format).
Source
Thrown at nomad/structs/structs.go:9010
_ = multierror.Append(&mErr, fmt.Errorf("must specify change script configuration value when change mode is script"))
}
if err = t.ChangeScript.Validate(); err != nil {
_ = multierror.Append(&mErr, err)
}
default:
_ = multierror.Append(&mErr, TemplateChangeModeInvalidError)
}
// Verify the splay is positive
if t.Splay < 0 {
_ = multierror.Append(&mErr, fmt.Errorf("Must specify positive splay value"))
}
// Verify the permissions
if t.Perms != "" {
if _, err := strconv.ParseUint(t.Perms, 8, 12); err != nil {
_ = multierror.Append(&mErr, fmt.Errorf("Failed to parse %q as octal: %v", t.Perms, err))
}
}
if err = t.Wait.Validate(); err != nil {
_ = multierror.Append(&mErr, err)
}
return mErr.ErrorOrNil()
}
func (t *Template) Warnings() error {
var mErr multierror.Error
// Deprecation notice for vault_grace
if t.VaultGrace != 0 {
mErr.Errors = append(mErr.Errors, fmt.Errorf("VaultGrace has been deprecated as of Nomad 0.11 and ignored since Vault 0.5. Please remove VaultGrace / vault_grace from template block."))
}
View on GitHub (pinned to 482b49bf1a)
Solutions
- Use valid octal digits only, e.g. perms = "0644"
- Remove the perms field to use the default permissions
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at nomad/structs/structs.go:9010 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04).
Data as JSON: /api/errors/1ac133c12ba819b0.
Report an issue: GitHub.