{"record":{"id":"c2f9886450dbf0ba","repo":"quarkusio/quarkus","slug":"unable-to-determine-if-file-f-is-a-regul","errorCode":null,"errorMessage":"Unable to determine if file '\" + f + \"' is a regular file","messagePattern":"Unable to determine if file '\" \\+ f \\+ \"' is a regular file","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/kubernetes-service-binding/runtime/src/main/java/io/quarkus/kubernetes/service/binding/runtime/ServiceBinding.java","lineNumber":77,"sourceCode":"        this.name = name;\n        this.type = type;\n        this.provider = provider;\n        this.properties = Collections.unmodifiableMap(properties);\n    }\n\n    private static Map<String, String> getFilenameToContentMap(Path directory) {\n        if (!Files.exists(directory) || !Files.isDirectory(directory)) {\n            log.warn(\"File '\" + directory + \"' is not a proper service binding directory so it will skipped\");\n            return Collections.emptyMap();\n        }\n\n        File[] files = directory.toFile().listFiles(new FileFilter() {\n            @Override\n            public boolean accept(File f) {\n                try {\n                    return !Files.isHidden(f.toPath()) && !Files.isDirectory(f.toPath());\n                } catch (IOException e) {\n                    throw new IllegalStateException(\"Unable to determine if file '\" + f + \"' is a regular file\", e);\n                }\n            }\n        });\n\n        Map<String, String> result = new HashMap<>();\n        if (files != null) {\n            for (File f : files) {\n                try {\n                    result.put(f.toPath().getFileName().toString(),\n                            Files.readString(f.toPath()).trim());\n                } catch (IOException e) {\n                    throw new IllegalStateException(\"Unable to read file '\" + f + \"'\", e);\n                }\n            }\n        }\n        return result;\n    }\n","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/kubernetes-service-binding/runtime/src/main/java/io/quarkus/kubernetes/service/binding/runtime/ServiceBinding.java#L59-L95","documentation":"Inside ServiceBinding.accept, while filtering the binding directory's entries, Files.isHidden can throw IOException on a filesystem error; the code wraps it in IllegalStateException('Unable to determine if file X is a regular file'). It signals the directory listing could not be completed reliably — not that the file content is bad.","triggerScenarios":"listFiles on a binding directory encounters a file whose hidden-status check fails — typically permission problems (no execute/search permission on the directory), broken state on network mounts, or an IO error mid-scan of a mounted volume.","commonSituations":"Service Binding root on a read-only or failing mounted volume; permission churn on the mount; NFS/CIFS filesystem where isHidden raises IOException; files disappearing while scanning.","solutions":["Check filesystem permissions on the binding root and its files (readable and traversable by the app user).","Verify the volume mount is healthy (kubectl describe pod; check mount errors).","Retry after the mount settles if the volume was still attaching at startup.","Inspect the wrapped IOException cause for the underlying OS error."],"exampleFix":"# before: unreadable binding dir\nchmod 000 /k8s/service-binding/my-db\n# after\nchmod 755 /k8s/service-binding/my-db && chmod 644 /k8s/service-binding/my-db/*","handlingStrategy":"try-catch","validationCode":"static void checkBindingDirReadable(Path dir) throws IOException {\n    if (!Files.isExecutable(dir) || !Files.isDirectory(dir)) {\n        throw new IllegalStateException(\"Binding dir not traversable: \" + dir);\n    }\n    try (var s = Files.list(dir)) {\n        s.forEach(f -> {\n            if (!Files.isReadable(f)) throw new IllegalStateException(\"Unreadable: \" + f);\n        });\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    loadBindings();\n} catch (IllegalStateException e) {\n    if (e.getMessage().startsWith(\"Unable to determine if file\")) {\n        log.error(\"Filesystem error scanning binding dir — check mount/permissions\", e.getCause());\n    }\n}","preventionTips":["Run the container as a UID that can read/traverse the mounted binding directory.","Check pod events for volume mount failures before debugging app code.","Avoid network filesystems (NFS/CIFS) for the binding root when possible.","Ensure the volume is fully attached before the app starts (init container gate)."],"tags":["service-binding","filesystem","io","permissions"],"backgroundTag":"filesystem-io-error","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}