{"record":{"id":"205cc4be6a693f01","repo":"pinpoint-apm/pinpoint","slug":"profiledirs-traverse-error","errorCode":null,"errorMessage":"profileDirs traverse error ","messagePattern":"profileDirs traverse error ","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"agent-module/bootstraps/bootstrap/src/main/java/com/navercorp/pinpoint/bootstrap/agentdir/AgentDirectory.java","lineNumber":124,"sourceCode":"        return this.agentDirPath.resolve(fileName);\n    }\n\n    public List<Path> getProfileDirs() {\n        List<Path> fileList = new ArrayList<>();\n\n        final Path profilesPath = getProfilesPath();\n\n        try (DirectoryStream<Path> stream = Files.newDirectoryStream(profilesPath)) {\n            for (Path path : stream) {\n                if (Files.isDirectory(path)) {\n                    final Path fileName = path.getFileName();\n                    if (fileName != null) {\n                        fileList.add(fileName);\n                    }\n                }\n            }\n        } catch (IOException e) {\n            throw new RuntimeException(\"profileDirs traverse error \" + profilesPath, e);\n        }\n        return fileList;\n    }\n\n}\n","sourceCodeStart":106,"sourceCodeEnd":130,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/agent-module/bootstraps/bootstrap/src/main/java/com/navercorp/pinpoint/bootstrap/agentdir/AgentDirectory.java#L106-L130","documentation":"AgentDirectory.getProfileDirs() walks the profiles directory (DirectoryStream) and wraps any IOException in RuntimeException 'profileDirs traverse error <profilesPath>'. This means the profiles directory could not be read/traversed, typically due to permissions or it being removed/replaced mid-scan.","triggerScenarios":"IOException from DirectoryStream iteration over profilesPath: directory lacks read permission, was deleted, or an I/O error occurred while listing entries.","commonSituations":"Wrong user permissions on the agent directory; profiles folder deleted or renamed in a customized distribution; NFS/locked-volume I/O errors when the agent starts.","solutions":["Check read/execute permissions on the agent's profiles directory for the JVM user: chmod -R u+rX profiles","Verify the profiles directory exists in the agent installation and re-extract if missing","Point the agent at a complete, unmodified agent distribution","Check mount/volume health (NFS, container mounts) if I/O errors persist"],"exampleFix":"// before\nls -l /opt/pinpoint-agent/profiles  ->  permission denied\n// after\nchmod -R u+rX /opt/pinpoint-agent/profiles && ls /opt/pinpoint-agent/profiles  # release, dev, local","handlingStrategy":"try-catch","validationCode":"Path profiles = Paths.get(\"/opt/pinpoint-agent/profiles\");\nif (!Files.isDirectory(profiles) || !Files.isReadable(profiles)) {\n    throw new IllegalStateException(\"profiles dir unreadable: \" + profiles);\n}","typeGuard":"boolean isReadableDir(Path p) {\n    return p != null && Files.isDirectory(p) && Files.isReadable(p);\n}","tryCatchPattern":"try {\n    AgentDirectory dir = resolver.resolve();\n} catch (RuntimeException e) {\n    if (e.getMessage() != null && e.getMessage().startsWith(\"profileDirs traverse error\")) {\n        // log profilesPath, check permissions/mount, re-extract agent dir\n    }\n    throw e;\n}","preventionTips":["Run the JVM as a user with read access to the whole agent directory","Keep the agent directory on a reliable local filesystem rather than flaky network mounts","Verify the profiles directory exists after every agent upgrade","Watch audit logs for external processes modifying/deleting the agent dir at startup"],"tags":["java","ioexception","directory-traversal","permissions"],"backgroundTag":"file-read-failed","analyzedSha":"744c3d3075e595656abb1ae331ad2c0e4c9eb996","analyzedAt":"2026-09-07T18:48:45.289Z","contentChangedAt":"2026-09-07T18:48:45.289Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}