{"record":{"id":"81e6395430ae17f8","repo":"MuntashirAkon/AppManager","slug":"path-is-inaccessible","errorCode":null,"errorMessage":"+ path + is inaccessible.","messagePattern":"\\+ path \\+ is inaccessible\\.","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"app/src/main/java/io/github/muntashirakon/io/fs/VirtualFileSystem.java","lineNumber":964,"sourceCode":"        checkMounted();\n        return Objects.requireNonNull(getOptions()).uidGidPair;\n    }\n\n    public void setUidGid(String path, int uid, int gid) {\n        // TODO: 7/12/22 This should either throw ErrnoException or a boolean value\n        checkMounted();\n    }\n\n    public boolean createLink(String link, String target, boolean soft) {\n        checkMounted();\n        return false;\n    }\n\n    /* I/O APIs */\n    @NonNull\n    public FileInputStream newInputStream(String path) throws IOException {\n        if (!checkAccess(path, OsConstants.R_OK)) {\n            throw new IOException(path + \" is inaccessible.\");\n        }\n        Node<?> targetNode = getNode(path);\n        if (targetNode == null) {\n            throw new FileNotFoundException(path + \" does not exist.\");\n        }\n        if (!targetNode.isFile()) {\n            throw new IOException(path + \" is not a file.\");\n        }\n        return new FileInputStream(getCachedFile(targetNode, false));\n    }\n\n    @NonNull\n    public FileOutputStream newOutputStream(String path, boolean append) throws IOException {\n        if (!checkAccess(path, OsConstants.W_OK)) {\n            throw new IOException(path + \" is inaccessible.\");\n        }\n        Node<?> targetNode = getNode(path);\n        if (targetNode == null) {","sourceCodeStart":946,"sourceCodeEnd":982,"githubUrl":"https://github.com/MuntashirAkon/AppManager/blob/0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5/app/src/main/java/io/github/muntashirakon/io/fs/VirtualFileSystem.java#L946-L982","documentation":"VirtualFileSystem.newInputStream first performs a POSIX-style access check (checkAccess with R_OK) on the virtual path. If read access is denied — the underlying node's permission bits or its backing file disallow reading — an IOException stating '<path> is inaccessible.' is thrown before the node is even resolved.","triggerScenarios":"Opening an input stream on a path inside a mounted APK/DEX whose entry's access check returns false: file mode lacks read permission, the backing resource is unreadable in the current process context, or the path points to an entry the VFS marks non-readable.","commonSituations":"Reading entries from an APK mounted with restrictive options; attempting reads as a non-root process on nodes whose modes assume root; reading paths that only exist as write-only placeholders.","solutions":["Check checkAccess/readability first and skip or request elevated access for unreadable paths.","Mount with options that grant read permissions (or fix the underlying node's mode via chmod when it is a real file).","Verify the path is a readable file entry, not a special/write-only node.","Catch IOException and present a permission-oriented message rather than a generic failure."],"exampleFix":"// before\nInputStream in = vfs.newInputStream(path);\n// after\nif (!vfs.checkAccess(path, OsConstants.R_OK)) {\n    throw new IOException(\"No read access: \" + path);\n}\nInputStream in = vfs.newInputStream(path);","handlingStrategy":"validation","validationCode":"if (!vfs.checkAccess(path, OsConstants.R_OK)) {\n    throw new IOException(\"No read access: \" + path);\n}","typeGuard":null,"tryCatchPattern":"try (FileInputStream in = vfs.newInputStream(path)) {\n    // read\n} catch (IOException e) {\n    if (String.valueOf(e.getMessage()).endsWith(\"is inaccessible.\")) {\n        // surface permission issue or request elevated access\n    } else throw e;\n}","preventionTips":["Check read access before opening streams, especially in bulk scans.","Mount with options that grant read permissions for entries you need.","Fix or avoid write-only/special nodes when reading."],"tags":["filesystem","permissions","io","android"],"backgroundTag":"permission-denied","analyzedSha":"0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5","analyzedAt":"2026-09-12T14:03:37.243Z","contentChangedAt":"2026-09-12T14:03:37.243Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}