{"record":{"id":"19394431cfdf559c","repo":"oracle/graal","slug":"error-archiving-s-this-directory-will-not-be-del","errorCode":null,"errorMessage":"Error archiving %s. This directory will not be deleted and must be manually removed.","messagePattern":"Error archiving (.+?)\\. This directory will not be deleted and must be manually removed\\.","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/debug/StandardPathUtilitiesProvider.java","lineNumber":209,"sourceCode":"                            Files.copy(file, zos);\n                            zos.closeEntry();\n                        }\n                        toDelete.add(file);\n                        return FileVisitResult.CONTINUE;\n                    }\n\n                    @Override\n                    public FileVisitResult postVisitDirectory(Path d, IOException exc) throws IOException {\n                        toDelete.add(d);\n                        return FileVisitResult.CONTINUE;\n                    }\n                });\n                // Keep this in sync with the catch_files in ci/common.jsonnet\n                TTY.println(DIAGNOSTIC_OUTPUT_DIRECTORY_MESSAGE_FORMAT, zipFile);\n                return zipFile.getAbsolutePath();\n            } catch (IOException e) {\n                toDelete.clear();\n                throw new IOException(\"Error archiving \" + dir + \". This directory will not be deleted and must be manually removed.\", e);\n            } finally {\n                if (!toDelete.isEmpty()) {\n                    IOException lastDeletionError = null;\n                    for (Path p : toDelete) {\n                        try {\n                            Files.delete(p);\n                        } catch (IOException e) {\n                            lastDeletionError = e;\n                        }\n                    }\n                    if (lastDeletionError != null) {\n                        throw new IOException(\"Error deleting \" + dir + \". This is most likely due to a compilation on \" +\n                                        \"another thread holding an open handle to a file within this directory. \" +\n                                        \"Please delete the directory manually once the VM exits.\", lastDeletionError);\n                    }\n                }\n            }\n        }","sourceCodeStart":191,"sourceCodeEnd":227,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/debug/StandardPathUtilitiesProvider.java#L191-L227","documentation":"StandardPathUtilitiesProvider archives a diagnostic output directory into a zip when the dump quota/cleanup policy requires it. If zipping (walking the tree and writing the archive) throws IOException, the pending-deletion list is cleared and this IOException is thrown, explicitly warning that the source directory was kept and must be removed manually — a deliberate data-preserving failure mode.","triggerScenarios":"Calling the provider's cleanup/archive path (triggered by Graal debug dumping when accumulated output directories exceed configured limits) while the filesystem prevents reading files or writing the zip: files deleted concurrently, permission changes, disk full, or a read-only output volume.","commonSituations":"Long-running builds/daemons producing many dump directories on a full disk; parallel compilations racing on shared dump directories; containers where the dump mount is read-only or overlay-limited. The directory intentionally survives so evidence is not destroyed.","solutions":["Follow the message: manually remove the named directory once you have extracted anything you need from it.","Free disk space and check permissions on the dump root so archive writing can succeed next time.","Reduce dump volume (-Dgraal.DumpPath to a bigger volume, lower dump level, or disable dumping) so the archival quota path is not hit.","If files are being consumed by concurrent compilations, stagger runs or give each run its own DumpPath subdirectory."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    String archived = provider.cleanupAndArchiveOutputs(dir);\n} catch (IOException e) {\n    if (e.getMessage().startsWith(\"Error archiving\")) {\n        // directory was intentionally preserved; schedule manual cleanup after VM exit\n        pendingManualCleanup.add(dir);\n    } else {\n        throw e;\n    }\n}","preventionTips":["Keep dump volumes below quota by purging old dump roots on a schedule.","Give concurrent runs separate DumpPath directories so archival never races with live writers."],"tags":["diagnostic-output","archiving","io","disk-space","debugging"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}