{"record":{"id":"b383a2f0ac3a45d3","repo":"apache/seatunnel","slug":"error-adding-hadoop-resource-resource-was-not-b383a2","errorCode":null,"errorMessage":"Error adding Hadoop resource {}, resource was not added","messagePattern":"Error adding Hadoop resource (.+?), resource was not added","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-paimon/src/main/java/org/apache/seatunnel/connectors/seatunnel/paimon/security/PaimonSecurityContext.java","lineNumber":84,"sourceCode":"     *\n     * @return\n     */\n    public static PaimonHadoopConfiguration loadHadoopConfig(PaimonConfig paimonConfig) {\n        PaimonHadoopConfiguration configuration = new PaimonHadoopConfiguration();\n        String hdfsSitePath = paimonConfig.getHdfsSitePath();\n        if (StringUtils.isNotBlank(hdfsSitePath)) {\n            configuration.addResource(new Path(hdfsSitePath));\n        }\n        String hadoopConfPath = paimonConfig.getHadoopConfPath();\n        if (StringUtils.isNotBlank(hadoopConfPath)) {\n            HADOOP_CONF_FILES.forEach(\n                    confFile -> {\n                        java.nio.file.Path path = Paths.get(hadoopConfPath, confFile);\n                        if (Files.exists(path)) {\n                            try {\n                                configuration.addResource(path.toUri().toURL());\n                            } catch (IOException e) {\n                                log.warn(\n                                        \"Error adding Hadoop resource {}, resource was not added\",\n                                        path,\n                                        e);\n                            }\n                        }\n                    });\n        }\n        paimonConfig.getHadoopConfProps().forEach((k, v) -> configuration.set(k, v));\n        // This configuration is enabled to avoid affecting other hadoop filesystem jobs\n        // refer:\n        // org.apache.seatunnel.connectors.seatunnel.file.hadoop.HadoopFileSystemProxy.createConfiguration\n        configuration.setBoolean(FS_DISABLE_CACHE, true);\n        log.info(\"Hadoop config initialized: {}\", configuration.getClass().getName());\n        return configuration;\n    }\n\n    /**\n     * Check if we need to verify kerberos authentication","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-paimon/src/main/java/org/apache/seatunnel/connectors/seatunnel/paimon/security/PaimonSecurityContext.java#L66-L102","documentation":"PaimonSecurityContext.loadHadoopConfig scans the configured Hadoop conf directory and calls configuration.addResource for each known conf file. If reading a file's URL throws an IOException, the resource is skipped with this warning instead of failing the job, so Hadoop config may be partially loaded.","triggerScenarios":"addResource(path.toUri().toURL()) throws IOException while adding core-site.xml/hdfs-site.xml etc. from hadoopConfPath — typically because the file was deleted between the Files.exists check and the URL open, the URL is unreadable, or a filesystem/permission error occurs.","commonSituations":"HADOOP_HOME/conf directory mounted into a container but file unreadable by the job user; race with config file regeneration; network filesystem hiccup; wrong hadoop-conf-dir pointing at a stale mount.","solutions":["Verify hadoopConfPath files exist and are readable by the SeaTunnel process user (ls -l, check permissions).","Check that the path is a plain local filesystem path, not an unsupported scheme that produces a bad URL.","Re-check Kerberos/HDFS access if the resource lives on a shared mount; retry the job after fixing the mount.","If config is truly partial, fail fast: set the conf path correctly or embed needed Hadoop properties in job config instead of relying on directory scan."],"exampleFix":"// before\nif (Files.exists(path)) { try { configuration.addResource(path.toUri().toURL()); } catch (IOException e) { log.warn(...); } }\n// after\nif (Files.isReadable(path)) { try { configuration.addResource(path.toUri().toURL()); } else { log.error(\"Hadoop conf file {} is missing or unreadable\", path); throw new IOException(path.toString()); } }","handlingStrategy":"validation","validationCode":"java.nio.file.Path p = java.nio.file.Paths.get(hadoopConfPath, confFile);\nif (!java.nio.file.Files.isReadable(p)) throw new IllegalStateException(\"Unreadable Hadoop conf: \" + p);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check file readability of all files in hadoopConfPath at job startup","Use plain local paths for hadoop conf directory","Avoid regenerating conf files while jobs start"],"tags":["hadoop","configuration","io"],"backgroundTag":"file-read-failed","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}