{"record":{"id":"30fc182790021b00","repo":"quarkusio/quarkus","slug":"unable-to-get-last-modified-time-for","errorCode":null,"errorMessage":"Unable to get last modified time for ","messagePattern":"Unable to get last modified time for ","errorType":"console","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"extensions/container-image/container-image-jib/deployment/src/main/java/io/quarkus/container/image/jib/deployment/JibProcessor.java","lineNumber":705,"sourceCode":"    public JibContainerBuilder addLayer(JibContainerBuilder jibContainerBuilder, List<Path> files,\n            AbsoluteUnixPath pathInContainer, String name, boolean isMutableJar,\n            boolean enforceModificationTime, Instant forcedModificationTime)\n            throws IOException {\n        FileEntriesLayer.Builder layerConfigurationBuilder = FileEntriesLayer.builder().setName(name);\n\n        for (Path file : files) {\n            layerConfigurationBuilder.addEntryRecursive(\n                    file, pathInContainer.resolve(file.getFileName()),\n                    isMutableJar ? REMOTE_DEV_FOLDER_PERMISSIONS_PROVIDER : DEFAULT_FILE_PERMISSIONS_PROVIDER,\n                    (sourcePath, destinationPath) -> {\n                        if (enforceModificationTime) {\n                            return forcedModificationTime;\n                        }\n\n                        try {\n                            return Files.getLastModifiedTime(sourcePath).toInstant();\n                        } catch (IOException e) {\n                            throw new RuntimeException(\"Unable to get last modified time for \" + sourcePath, e);\n                        }\n                    },\n                    isMutableJar ? REMOTE_DEV_OWNERSHIP_PROVIDER : DEFAULT_OWNERSHIP_PROVIDER);\n        }\n\n        return jibContainerBuilder.addFileEntriesLayer(layerConfigurationBuilder.build());\n    }\n\n    private void mayInheritEntrypoint(JibContainerBuilder jibContainerBuilder, List<String> entrypoint,\n            List<String> arguments) {\n        if (entrypoint.size() == 1 && \"INHERIT\".equals(entrypoint.get(0))) {\n            jibContainerBuilder\n                    .setEntrypoint((List<String>) null)\n                    .setProgramArguments(arguments);\n        }\n    }\n\n    private List<String> determineEffectiveJvmArguments(ContainerImageJibConfig jibConfig,","sourceCodeStart":687,"sourceCodeEnd":723,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/container-image/container-image-jib/deployment/src/main/java/io/quarkus/container/image/jib/deployment/JibProcessor.java#L687-L723","documentation":"While building a Jib file-entries layer, Quarkus tries Files.getLastModifiedTime(sourcePath) to compute each file's modification time (for reproducible builds it normally uses a forced time, but when none applies it reads the real mtime). If the file disappears or is unreadable mid-build, the IOException is wrapped in RuntimeException(\"Unable to get last modified time for \" + sourcePath).","triggerScenarios":"A file in the fast-JAR (or mutable-jar) output directory that Jib is packaging is deleted or becomes unreadable between directory scanning and mtime lookup — typically a concurrently rebuilt target/ directory, or a symlink/broken file in the packaged paths.","commonSituations":"Running a container build while another process (IDE, another Maven build, spring-boot-devtools-like watcher) cleans target/; building from a shared/network filesystem with flaky stat; broken symlinks inside lib/ or app/ directories.","solutions":["Re-run the build without concurrent processes touching target/ (stop dev mode, other builds, CI races)","Run mvn clean first so the fast-jar output is rebuilt atomically before the container step","Check for broken symlinks or unreadable files in target/quarkus-app (find target/quarkus-app -xtype l)","Avoid building images from NFS/network mounts; build locally or on stable storage"],"exampleFix":"// before: image build races with dev mode on the same project\n$ quarkus dev &  mvn package -Dquarkus.container-image.build=true\n// after: stop dev mode, clean, then build\n$ mvn clean package -Dquarkus.container-image.build=true","handlingStrategy":"validation","validationCode":"// verify the packaged app tree is stable and sane before the container step\njava.nio.file.Path appDir = java.nio.file.Path.of(\"target/quarkus-app\");\nif (!java.nio.file.Files.isDirectory(appDir)) throw new IllegalStateException(\"Run package first: missing \" + appDir);\ntry (var s = java.nio.file.Files.walk(appDir)) {\n    var broken = s.filter(java.nio.file.Files::exists == null ? p -> false :\n            p -> java.nio.file.Files.isSymbolicLink(p) && !java.nio.file.Files.exists(p)).count();\n    if (broken > 0) throw new IllegalStateException(broken + \" broken symlinks in quarkus-app\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never run dev mode and container-image builds on the same target/ concurrently","Run mvn clean package so the fast-jar is freshly produced in one build","Check for broken symlinks in target/quarkus-app before building","Avoid building images directly off NFS/network shares","In CI, use a fresh workspace per build"],"tags":["jib","container-image","filesystem","race-condition"],"backgroundTag":"file-not-found-build-race","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"}