{"record":{"id":"1464519d5ef38d7f","repo":"juicedata/juicefs","slug":"invalid-device-list-entry-q","errorCode":null,"errorMessage":"invalid device list entry: %q","messagePattern":"invalid device list entry: %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/fuse/device_linux.go","lineNumber":92,"sourceCode":"\tdeviceAllowPath := path.Join(\"/sys/fs/cgroup/devices\" + deviceCgroup, \"/devices.allow\")\n\n\t// check if fuse is already allowed\n\tdeviceListFile, err := os.OpenFile(deviceListPath, os.O_RDONLY, 0)\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"open %s\", deviceListPath)\n\t}\n\tdefer deviceListFile.Close()\n\tdeviceListScanner := bufio.NewScanner(deviceListFile)\n\tfor deviceListScanner.Scan() {\n\t\tif err := deviceListScanner.Err(); err != nil {\n\t\t\treturn errors.Wrap(err, \"read device list file\")\n\t\t}\n\t\tvar (\n\t\t\ttext  = deviceListScanner.Text()\n\t\t\tparts = strings.SplitN(text, \" \", 3)\n\t\t)\n\t\tif len(parts) < 3 {\n\t\t\treturn errors.Errorf(\"invalid device list entry: %q\", text)\n\t\t}\n\n\t\tif (parts[0] == \"c\" || parts[0] == \"a\") && (parts[1] == \"10:229\" || parts[1] == \"*:*\") && parts[2] == \"rwm\" {\n\t\t\tlogger.Debug(\"/dev/fuse is already granted\")\n\t\t\t// fuse is already allowed\n\t\t\treturn nil\n\t\t}\n\t}\n\n\tf, err := os.OpenFile(deviceAllowPath, os.O_WRONLY, 0)\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"open %s\", deviceAllowPath)\n\t}\n\tdefer f.Close()\n\t// 10, 229 according to https://www.kernel.org/doc/Documentation/admin-guide/devices.txt\n\tcontent := \"c 10:229 rwm\"\n\t_, err = f.WriteString(content)\n\tif err != nil {","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/fuse/device_linux.go#L74-L110","documentation":"Each line of the cgroup devices.list file must have the form 'type major:minor access' (3 space-separated fields). If a line splits into fewer than 3 fields, the entry is unparseable and grantAccess aborts with this error.","triggerScenarios":"The kernel-provided devices.list contains a malformed entry (fields missing) — extremely rare; more practically a modified/patched kernel or a synthetic cgroup file in a testing/sandboxed environment.","commonSituations":"Unusual kernel configurations or LSMs altering devices.list output; sandboxed CI runners with virtualized /sys; debugging environments with hand-edited cgroup files.","solutions":["Inspect 'cat /sys/fs/cgroup/devices<path>/devices.list' and confirm entries look like 'c 1:3 mr' / 'a *:* rwm'","Run on a standard kernel where devices.list emits the normal 3-field format","Grant /dev/fuse manually (devices.allow write or --device /dev/fuse) to bypass the list parsing","Report persistent malformed output to the runtime/kernel vendor"],"exampleFix":"// before (synthetic devices.list)\ncat /sys/fs/cgroup/devices/devices.list  # \"c 10:229 rwm extra\"\n// after: verify standard format\n# c 10:229 rwm","handlingStrategy":"validation","validationCode":"if data, err := os.ReadFile(listPath); err == nil {\n  for _, l := range strings.Split(string(data), \"\\n\") {\n    if l != \"\" && len(strings.SplitN(l, \" \", 3)) < 3 {\n      // malformed devices.list entry; grantAccess will fail\n    }\n  }\n}","typeGuard":null,"tryCatchPattern":"if err := grantAccess(); err != nil && strings.Contains(err.Error(), \"invalid device list entry\") {\n  logger.Warnf(\"device grant skipped, falling back to manual grant: %v\", err)\n}","preventionTips":["Verify devices.list output format on non-standard kernels/sandboxes before mounting","Use standard kernels in production mount environments","Grant the device out-of-band in sandboxed CI runners"],"tags":["linux","cgroups","fuse","parsing"],"backgroundTag":"invalid-argument-format","analyzedSha":"c9a67b23e8e08ec23ec331aa6f1675e2319e921c","analyzedAt":"2026-09-06T17:55:48.476Z","contentChangedAt":"2026-09-06T17:55:48.476Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}