{"record":{"id":"881e70f496fa67c7","repo":"hashicorp/nomad","slug":"s-does-not-meet-systemd-conventions","errorCode":null,"errorMessage":"%s does not meet systemd conventions","messagePattern":"(.+?) does not meet systemd conventions","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"command/agent/monitor/export_monitor.go","lineNumber":163,"sourceCode":"\t\t\t\"device\",\n\t\t\t\"mount\",\n\t\t\t\"automount\",\n\t\t\t\"swap\",\n\t\t\t\"target\",\n\t\t\t\"path\",\n\t\t\t\"timer\",\n\t\t\t\"slice\",\n\t\t\t\"scope\",\n\t\t}\n\t\tif valid := slices.Contains(validSuffix, suffix); !valid {\n\t\t\treturn errors.New(\"invalid suffix\")\n\t\t}\n\t\tprefix = strings.Join(splitInput[:len(splitInput)-1], \"\")\n\t}\n\n\tsafe, _ := regexp.MatchString(`^[\\w\\\\._-]*(@[\\w\\\\._-]+)?$`, prefix)\n\tif !safe {\n\t\treturn fmt.Errorf(\"%s does not meet systemd conventions\", prefix)\n\t}\n\treturn nil\n}\n\nfunc cliReader(opts MonitorExportOpts) (*ExportReader, error) {\n\tisCli := true\n\t// Vet servicename again\n\tif err := ScanServiceName(opts.ServiceName); err != nil {\n\t\treturn nil, err\n\t}\n\tcmdDuration := \"72 hours\"\n\tif opts.LogsSince != \"\" {\n\t\tparsedDur, err := time.ParseDuration(opts.LogsSince)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tcmdDuration = parsedDur.String()\n\t}","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/command/agent/monitor/export_monitor.go#L145-L181","documentation":"Generic validation error from ScanServiceName in the monitor export endpoint: after checking the systemd unit-type suffix, the remaining unit-name prefix fails the systemd naming regex (^\\w[\\w._-]*(@[\\w._-]+)?$), so the service name is not a valid systemd unit name.","triggerScenarios":"Thrown at command/agent/monitor/export_monitor.go:163 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a service name with only alphanumerics, underscores, periods, and hyphens before the optional @instance part","Drop unsupported characters (spaces, slashes, shell metacharacters) from the unit prefix","Verify the name follows systemd unit naming conventions, e.g. nginx.service or foo@1.service"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}