{"record":{"id":"b82f54988383dce9","repo":"quarkusio/quarkus","slug":"error-listing-files-in-directory-relativedir","errorCode":null,"errorMessage":"Error listing files in directory: ${relativeDir}","messagePattern":"Error listing files in directory: (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/project/update/rewrite/QuarkusUpdatesRepository.java","lineNumber":215,"sourceCode":"                                        .sorted(RecipeVersionComparator.INSTANCE)\n                                        .map(p -> {\n                                            try {\n                                                log.info(\"    - '%s' (%s)\",\n                                                        p.getFileName().toString(),\n                                                        versions.stream().map(v -> v.from() + \" -> \" + v.to())\n                                                                .collect(Collectors.joining(\", \")));\n                                                return new String(Files.readAllBytes(p));\n                                            } catch (IOException e) {\n                                                throw new RuntimeException(\"Error reading file: \" + p,\n                                                        e);\n                                            }\n                                        }).toList();\n                                if (recipes.isEmpty()) {\n                                    log.info(\"\\t\\t- no matching recipes.\");\n                                }\n                                return recipes.stream();\n                            } catch (IOException e) {\n                                throw new RuntimeException(\"Error listing files in directory: \" + d.relativeDir(), e);\n                            }\n                        }).toList());\n    }\n\n    record RecipeDirectory(String relativeDir, Set<VersionUpdate> versions) {\n    }\n\n    record VersionUpdate(String from, String to) {\n    }\n\n    private static Stream<RecipeDirectory> findRecipeDirectories(Path rootDir,\n            Map<String, VersionUpdate> recipeDirectoryNames) {\n        return findDirsWithRecipes(rootDir).stream()\n                .map(d -> {\n                    String relativeDir = rootDir.relativize(d).toString();\n                    return resolveVersionsForRecipesDir(relativeDir, toKey(relativeDir), recipeDirectoryNames);\n                })\n                .filter(Optional::isPresent)","sourceCodeStart":197,"sourceCodeEnd":233,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/project/update/rewrite/QuarkusUpdatesRepository.java#L197-L233","documentation":"fetchUpdateRecipes() lists files in each recipe directory and streams the matching ones; if the directory listing throws IOException it is wrapped in RuntimeException(\"Error listing files in directory: <relativeDir>\"). The failure happens before any file content is read — the directory itself could not be enumerated.","triggerScenarios":"fetchUpdateRecipes (called by newRecipes) iterates RecipeDirectory entries and calls a directory-walk/list operation that throws IOException for that directory — directory missing, permission denied on the directory, or I/O error on the filesystem.","commonSituations":"Recipes directory partially extracted so some subdirectories are absent; restrictive permissions on a subdirectory; stale NFS/network mount; directory removed by a cleanup job while `quarkus update` runs.","solutions":["Ensure all recipe directories exist by re-extracting/re-downloading the update recipes.","Fix directory read/execute permissions (chmod +rx).","Check the mount/filesystem health if recipes are on network storage.","Rerun `quarkus update` without concurrent processes modifying the recipes directory."],"exampleFix":"// shell: restore a missing recipe directory\nunzip -o ~/.m2/repository/io/quarkus/quarkus-update-recipes/3.15.0/*.jar -d ~/.quarkus/update-recipes/\n// then rerun\nquarkus update","handlingStrategy":"validation","validationCode":"if (!Files.isDirectory(dir) || !Files.isReadable(dir)) {\n    throw new IOException(\"Recipe directory missing or unreadable before update: \" + dir);\n}","typeGuard":null,"tryCatchPattern":"try {\n    recipes = repo.fetchUpdateRecipes(...);\n} catch (RuntimeException e) {\n    if (e.getMessage() != null && e.getMessage().startsWith(\"Error listing files\")) {\n        log.error(\"Restore directory/permissions for: \" + e.getMessage(), e);\n    }\n}","preventionTips":["Fully extract the recipes artifact so no subdirectories are missing.","Grant read+execute on recipe directories (chmod +rx).","Keep the recipes cache on local, healthy storage.","Avoid concurrent jobs cleaning the recipes directory during updates."],"tags":["io","filesystem","update-recipes"],"backgroundTag":"directory-listing-failed","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}