{"id":"c4c2a4c6df6050dc","repo":"docker/cli","slug":"invalid-device-cgroup-format-s","errorCode":null,"errorMessage":"invalid device cgroup format '%s'","messagePattern":"invalid device cgroup format '(.+?)'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/container/opts.go","lineNumber":1051,"sourceCode":"\t}\n\n\treturn container.DeviceMapping{\n\t\tPathOnHost:        src,\n\t\tPathInContainer:   dst,\n\t\tCgroupPermissions: permissions,\n\t}, nil\n}\n\n// validateDeviceCgroupRule validates a device cgroup rule string format\n// It will make sure 'val' is in the form:\n//\n//\t'type major:minor mode'\nfunc validateDeviceCgroupRule(val string) (string, error) {\n\tif deviceCgroupRuleRegexp.MatchString(val) {\n\t\treturn val, nil\n\t}\n\n\treturn val, fmt.Errorf(\"invalid device cgroup format '%s'\", val)\n}\n\n// validDeviceMode checks if the mode for device is valid or not.\n// Valid mode is a composition of r (read), w (write), and m (mknod).\nfunc validDeviceMode(mode string) bool {\n\tlegalDeviceMode := map[rune]bool{\n\t\t'r': true,\n\t\t'w': true,\n\t\t'm': true,\n\t}\n\tif mode == \"\" {\n\t\treturn false\n\t}\n\tfor _, c := range mode {\n\t\tif !legalDeviceMode[c] {\n\t\t\treturn false\n\t\t}\n\t\tlegalDeviceMode[c] = false","sourceCodeStart":1033,"sourceCodeEnd":1069,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/command/container/opts.go#L1033-L1069","documentation":"Error \"invalid device cgroup format '%s'\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/command/container/opts.go:1051 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"e9452d6e785f6e365712b9d71bd7517591773c86","analyzedAt":"2026-08-01T07:09:22.474Z","schemaVersion":2}