{"id":"83961d6618ab7eaf","repo":"gohugoio/hugo","slug":"invalid-deployment-orderings-pattern-v","errorCode":null,"errorMessage":"invalid deployment.orderings.pattern: %v","messagePattern":"invalid deployment\\.orderings\\.pattern: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"deploy/deployconfig/deployConfig.go","lineNumber":173,"sourceCode":"\t\t}\n\t\tif err := tgt.ParseIncludeExclude(); err != nil {\n\t\t\treturn dcfg, err\n\t\t}\n\t}\n\tvar err error\n\tfor _, m := range dcfg.Matchers {\n\t\tif *m == (Matcher{}) {\n\t\t\treturn dcfg, errors.New(\"empty deployment matcher\")\n\t\t}\n\t\tm.Re, err = regexp.Compile(m.Pattern)\n\t\tif err != nil {\n\t\t\treturn dcfg, fmt.Errorf(\"invalid deployment.matchers.pattern: %v\", err)\n\t\t}\n\t}\n\tfor _, o := range dcfg.Order {\n\t\tre, err := regexp.Compile(o)\n\t\tif err != nil {\n\t\t\treturn dcfg, fmt.Errorf(\"invalid deployment.orderings.pattern: %v\", err)\n\t\t}\n\t\tdcfg.Ordering = append(dcfg.Ordering, re)\n\t}\n\n\treturn dcfg, nil\n}\n","sourceCodeStart":155,"sourceCodeEnd":180,"githubUrl":"https://github.com/gohugoio/hugo/blob/8a468df065a75c1c7cf9f6850f32148746590ea5/deploy/deployconfig/deployConfig.go#L155-L180","documentation":"Raised at deployConfig.go:173 when compiling an entry of `deployment.order` (config key `order`, error text says orderings) fails. Each ordering string is compiled with `regexp.Compile` and appended to `dcfg.Ordering`, which later groups uploads into sequential batches during deploy; an invalid regex aborts config decoding.","triggerScenarios":"`hugo deploy` with a `deployment.order = [\"...\"]` list containing a string that is not valid Go RE2 regex — same failure class as matchers: bad escapes, unbalanced groups, PCRE-only syntax.","commonSituations":"Using glob patterns instead of regexes in `order`; escaping issues in TOML/YAML; copying `.*` patterns with stray metacharacters like an unmatched `)`.","solutions":["Correct the invalid entry in `deployment.order` so each string is a valid RE2 regex, e.g. `order = ['.*\\.jpg$', '.*\\.gif$']`.","Use single-quoted TOML strings to keep backslashes literal.","If you meant simple suffix matching, a regex like `\\.jpg$` suffices — avoid unnecessary metacharacters."],"exampleFix":"# before\n[deployment]\norder = [\"*.jpg\", \"*.gif\"]\n\n# after\n[deployment]\norder = ['.*\\.jpg$', '.*\\.gif$']","handlingStrategy":"validation","validationCode":"for i, o := range cfg.Deployment.Order {\n    if _, err := regexp.Compile(o); err != nil {\n        return fmt.Errorf(\"deployment.order[%d] %q: %w\", i, o, err)\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["deployment.order entries are RE2 regexps; compile-check each one before committing config","Keep ordering patterns simple (prefix/suffix anchors) to reduce syntax-error risk","Cover config parsing with a smoke test that loads hugo.toml and validates the deployment section"],"tags":["hugo","deploy","regex","config-validation"],"analyzedSha":"8a468df065a75c1c7cf9f6850f32148746590ea5","analyzedAt":"2026-07-31T21:23:07.045Z","schemaVersion":2}