{"record":{"id":"a5a8a391eae3941d","repo":"apache/seatunnel","slug":"error-adding-hadoop-config","errorCode":null,"errorMessage":"Error adding Hadoop config {}","messagePattern":"Error adding Hadoop config (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-hive/src/main/java/org/apache/seatunnel/connectors/seatunnel/hive/utils/HiveMetaStoreCatalog.java","lineNumber":382,"sourceCode":"            if (StringUtils.isNotBlank(normalizedMetastoreUris)) {\n                hiveConf.set(\"hive.metastore.uris\", normalizedMetastoreUris);\n            }\n        }\n        hiveConf.setBoolVar(HiveConf.ConfVars.METASTORE_EXECUTE_SET_UGI, false);\n        hiveConf.setBoolean(\"hive.metastore.client.capability.check\", false);\n        hiveConf.setBoolean(\"hive.metastore.client.filter.enabled\", false);\n        hiveConf.setInt(\"hive.metastore.client.socket.timeout\", 600);\n        hiveConf.setInt(\"hive.metastore.client.connect.retry.delay\", 5);\n        hiveConf.setInt(\"hive.metastore.failure.retries\", 3);\n\n        if (StringUtils.isNotBlank(hadoopConfDir)) {\n            for (String fileName : HADOOP_CONF_FILES) {\n                Path path = Paths.get(hadoopConfDir, fileName);\n                if (Files.exists(path)) {\n                    try {\n                        hiveConf.addResource(path.toUri().toURL());\n                    } catch (IOException e) {\n                        log.warn(\"Error adding Hadoop config {}\", path, e);\n                    }\n                }\n            }\n        }\n        if (StringUtils.isNotBlank(hiveSitePath)) {\n            try {\n                hiveConf.addResource(new File(hiveSitePath).toURI().toURL());\n            } catch (MalformedURLException e) {\n                log.warn(\"Invalid hiveSitePath {}\", hiveSitePath, e);\n            }\n        }\n        hadoopProperties.forEach(hiveConf::set);\n        log.debug(\"Hive client configuration initialized\");\n        return hiveConf;\n    }\n\n    private IMetaStoreClient loginWithKerberos(HiveConf hiveConf) throws Exception {\n        Configuration authConf = new Configuration();","sourceCodeStart":364,"sourceCodeEnd":400,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-hive/src/main/java/org/apache/seatunnel/connectors/seatunnel/hive/utils/HiveMetaStoreCatalog.java#L364-L400","documentation":"HiveMetaStoreCatalog.buildHiveConf adds each Hadoop conf XML (core-site.xml, hdfs-site.xml, etc.) from the configured hadoop conf directory to the HiveConf. If converting an existing file's URL fails with IOException, that file is skipped with this warning; resulting HiveConf may lack critical properties, breaking metastore connectivity.","triggerScenarios":"buildHiveConf() (called from initializeClient) iterates HADOOP_CONF_FILES; the file exists but path.toUri().toURL() throws IOException — malformed path, permission/IO error, or unsupported URI characters.","commonSituations":"hadoop_conf_dir with spaces/illegal chars, files on a flaky mount, conf directory pointing to the wrong location so only some files resolve.","solutions":["Inspect the logged exception for the offending path and fix permissions or special characters","Point 'hadoop_conf_dir' at a clean, readable directory containing valid XML files","Validate each XML file loads (e.g. try reading it with Hadoop's Configuration in a test)","Set required properties explicitly via hadoopProperties map if files can't be loaded"],"exampleFix":"// before\nPath path = Paths.get(\"/etc/hadoop conf/\", fileName); // space breaks URL\n// after\nPath path = Paths.get(\"/etc/hadoop/conf\", fileName);","handlingStrategy":"validation","validationCode":"for (String f : List.of(\"core-site.xml\",\"hdfs-site.xml\")) {\n  java.nio.file.Path p = Paths.get(hadoopConfDir, f);\n  if (!java.nio.file.Files.isRegularFile(p)) continue;\n  new Configuration().addResource(p.toUri().toURL()); // throws early if URL malformed\n}","typeGuard":null,"tryCatchPattern":"try {\n  hiveConf.addResource(path.toUri().toURL());\n} catch (IOException e) {\n  log.warn(\"Cannot add hadoop conf {}\", path, e);\n}","preventionTips":["Use absolute hadoop_conf_dir without special characters","Verify all expected conf XMLs exist and load before submitting","Prefer classpath-based conf loading when possible","Set critical keys explicitly via hadoopProperties to survive skipped files"],"tags":["hive","hadoop","configuration","io"],"backgroundTag":"file-not-found","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"}