{"record":{"id":"41cfe1b65958dcbe","repo":"apache/seatunnel","slug":"get-hdfs-namenode-host-failed-41cfe1","errorCode":"GET_HDFS_NAMENODE_HOST_FAILED","errorMessage":"Get hdfs namenode host from table location [${hiveSdLocation}] failed,please check it","messagePattern":"Get hdfs namenode host from table location \\[(.+?)\\] failed,please check it","errorType":"error_code","errorClass":"HiveConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-hive/src/main/java/org/apache/seatunnel/connectors/seatunnel/hive/storage/HDFSStorage.java","lineNumber":57,"sourceCode":"    }\n\n    @Override\n    public HadoopConf buildHadoopConfWithReadOnlyConfig(ReadonlyConfig readonlyConfig) {\n        try {\n            String path = new URI(hiveSdLocation).getPath();\n            HadoopConf hadoopConf = new HadoopConf(hiveSdLocation.replace(path, StringUtils.EMPTY));\n            Configuration configuration = loadHiveBaseHadoopConfig(readonlyConfig);\n            Map<String, String> propsInConfiguration =\n                    configuration.getPropsWithPrefix(StringUtils.EMPTY);\n            hadoopConf.setExtraOptions(propsInConfiguration);\n            return hadoopConf;\n        } catch (URISyntaxException e) {\n            String errorMsg =\n                    String.format(\n                            \"Get hdfs namenode host from table location [%s] failed,\"\n                                    + \"please check it\",\n                            hiveSdLocation);\n            throw new HiveConnectorException(\n                    HiveConnectorErrorCode.GET_HDFS_NAMENODE_HOST_FAILED, errorMsg, e);\n        }\n    }\n}\n","sourceCodeStart":39,"sourceCodeEnd":62,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-hive/src/main/java/org/apache/seatunnel/connectors/seatunnel/hive/storage/HDFSStorage.java#L39-L62","documentation":"HDFSStorage.buildHadoopConfWithReadOnlyConfig derives the HDFS NameNode host from the Hive table's storage descriptor location (e.g. hdfs://nn:8020/warehouse/...). If the location string is not a valid URI (new URI(...) throws URISyntaxException), it throws GET_HDFS_NAMENODE_HOST_FAILED with the offending location interpolated into the message.","triggerScenarios":"Parsing a hiveSdLocation that lacks a scheme/host (e.g. '/warehouse/tablespace/...', 'file:/path', or contains illegal URI characters like unencoded spaces) inside buildHadoopConfWithReadOnlyConfig.","commonSituations":"Hive tables created with relative/local locations, migrated tables whose LOCATION lost the hdfs:// prefix, or locations containing spaces/special characters.","solutions":["Inspect the table location printed in the message (SHOW CREATE TABLE) and confirm it starts with hdfs://host:port.","Fix the table LOCATION in Hive to a fully qualified hdfs:// URI, or set the connector's default FS so relative paths resolve.","Ensure dfs.nameservices/HA config is correct if the location uses a logical nameservice (e.g. hdfs://nameservice1).","If the location contains spaces or special chars, rename the directory and update the table LOCATION."],"exampleFix":"// before (Hive)\nALTER TABLE t SET LOCATION '/user/hive/warehouse/t'\n// after\nALTER TABLE t SET LOCATION 'hdfs://namenode:8020/user/hive/warehouse/t'","handlingStrategy":"validation","validationCode":"String loc = table.getSd().getLocation();\njava.net.URI uri = java.net.URI.create(loc);\nif (uri.getScheme() == null || uri.getHost() == null) {\n    throw new IllegalArgumentException(\"table location must be fully qualified hdfs://host:port URI: \" + loc);\n}","typeGuard":null,"tryCatchPattern":"try {\n    storage.hadoopConf(readonlyConfig);\n} catch (HiveConnectorException e) {\n    LOG.error(\"Fix table LOCATION to a fully qualified hdfs:// URI\", e);\n    throw e;\n}","preventionTips":["Always create Hive tables with fully qualified hdfs:// LOCATION values","Avoid spaces/special characters in table directories","Check SHOW CREATE TABLE output before syncing tables"],"tags":["hdfs","uri","hive"],"backgroundTag":"invalid-url-format","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"}