{"record":{"id":"4c0621fb1a06966f","repo":"prestodb/presto","slug":"generic-internal-error","errorCode":"GENERIC_INTERNAL_ERROR","errorMessage":"cannot create cache directory + target","messagePattern":"cannot create cache directory \\+ target","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-cache/src/main/java/com/facebook/presto/cache/filemerge/FileMergeCacheManager.java","lineNumber":135,"sourceCode":"        this.cacheSizeCalculateExecutor = cacheSizeCalculateExecutor;\n        this.cache = CacheBuilder.newBuilder()\n                .maximumSize(fileMergeCacheConfig.getMaxCachedEntries())\n                .expireAfterAccess(fileMergeCacheConfig.getCacheTtl().toMillis(), MILLISECONDS)\n                .removalListener(new CacheRemovalListener())\n                .recordStats()\n                .build();\n        this.stats = requireNonNull(stats, \"stats is null\");\n        this.baseDirectory = new Path(cacheConfig.getBaseDirectory());\n        checkArgument(fileMergeCacheConfig.getMaxInMemoryCacheSize().toBytes() >= 0, \"maxInflightBytes is negative\");\n        this.maxInflightBytes = fileMergeCacheConfig.getMaxInMemoryCacheSize().toBytes();\n\n        File target = new File(baseDirectory.toUri());\n        if (!target.exists()) {\n            try {\n                Files.createDirectories(target.toPath());\n            }\n            catch (IOException e) {\n                throw new PrestoException(GENERIC_INTERNAL_ERROR, \"cannot create cache directory \" + target, e);\n            }\n        }\n        else {\n            File[] files = target.listFiles();\n            if (files == null) {\n                return;\n            }\n\n            this.cacheRemovalExecutor.submit(() -> Arrays.stream(files).forEach(file -> {\n                try {\n                    Files.delete(file.toPath());\n                }\n                catch (IOException e) {\n                    // ignore\n                }\n            }));\n        }\n","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-cache/src/main/java/com/facebook/presto/cache/filemerge/FileMergeCacheManager.java#L117-L153","documentation":"FileMergeCacheManager constructor validation: the target cache directory (under cache.base-directory) could not be created on the local filesystem (missing permissions, bad path, or IO error), so file-merge caching cannot store data.","triggerScenarios":"Thrown at presto-cache/src/main/java/com/facebook/presto/cache/filemerge/FileMergeCacheManager.java:135 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the cache base directory path is valid and writable","Create the directory manually or fix permissions","Point hive.cache.base-directory at a valid location"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}