apache/seatunnel · error · HiveConnectorException

LOAD_HIVE_BASE_HADOOP_CONFIG_FAILED

LOAD_HIVE_BASE_HADOOP_CONFIG_FAILED

Error message

Failed to load hadoop configuration, please check it

What it means

loadHiveBaseHadoopConfig builds a Hadoop Configuration from hadoop_conf_path XML files and/or the hadoop_conf option. Any exception while locating or parsing these resources (missing files, unreadable paths, malformed XML, invalid classpath resource) is wrapped in a HiveConnectorException with code LOAD_HIVE_BASE_HADOOP_CONFIG_FAILED and this generic message; the underlying cause is appended to the log.

Source

Thrown at seatunnel-connectors-v2/connector-hive/src/main/java/org/apache/seatunnel/connectors/seatunnel/hive/storage/AbstractStorage.java:109

            String hdfsSitePath = readonlyConfig.get(HiveBaseOptions.HDFS_SITE_PATH);
            if (StringUtils.isNotBlank(hdfsSitePath)) {
                configuration.addResource(new File(hdfsSitePath).toURI().toURL());
            }

            if (StringUtils.isNotBlank(hiveSitePath)) {
                configuration.addResource(new File(hiveSitePath).toURI().toURL());
            }
            // Try to load from hadoopConf
            Optional<Map<String, String>> hadoopConf =
                    readonlyConfig.getOptional(HiveBaseOptions.HADOOP_CONF);
            if (hadoopConf.isPresent()) {
                hadoopConf.get().forEach((k, v) -> configuration.set(k, v));
            }
            return configuration;
        } catch (Exception e) {
            String errorMsg = String.format("Failed to load hadoop configuration, please check it");
            log.error(errorMsg + ":" + ExceptionUtils.getMessage(e));
            throw new HiveConnectorException(
                    HiveConnectorErrorCode.LOAD_HIVE_BASE_HADOOP_CONFIG_FAILED, e);
        }
    }
}

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Check the log line right after this message for the wrapped cause (ExceptionUtils.getMessage(e)).
  2. Verify hadoop_conf_path exists on ALL nodes and contains valid core-site.xml/hdfs-site.xml/hive-site.xml.
  3. Validate XML well-formedness of each file (xmllint).
  4. Fix file permissions so the SeaTunnel process user can read the config files.
  5. If using inline hadoop_conf, confirm keys/values are valid Hadoop properties.

Example fix

// before
hadoop_conf_path = "/etc/hadoop/conf-typo"
// after
hadoop_conf_path = "/etc/hadoop/conf"
Defensive patterns

Strategy: try-catch

Validate before calling

File dir = new File(hadoopConfPath);
if (!dir.isDirectory()) throw new IllegalArgumentException("hadoop_conf_path not a directory: " + hadoopConfPath);
for (String f : new String[]{"core-site.xml","hdfs-site.xml","hive-site.xml"}) {
    File xml = new File(dir, f);
    if (!xml.canRead()) throw new IllegalArgumentException("missing/unreadable: " + xml);
}

Try / catch

try {
    storage.loadHiveBaseHadoopConfig(readonlyConfig);
} catch (HiveConnectorException e) {
    LOG.error("hadoop conf load failed; check hadoop_conf_path files and permissions", e.getCause());
    throw new IllegalStateException("Fix hadoop config and resubmit", e);
}

Prevention

When it happens

Trigger: Invoking loadHiveBaseHadoopConfig when hadoop_conf_path points to a nonexistent directory, the XML files are malformed, or an IOException occurs while loading them as resources.

Common situations: Typo in hadoop_conf_path, config files not shipped to all cluster nodes (only on the client), wrong file permissions, or hand-edited XML with syntax errors.

Understand the failure class

Background: "Config file not found": what it means and how to fix it in docker-sync, Maven, Vagrant, Turborepo and other tools — this error's family across 60 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/5370097c30e21eac. Report an issue: GitHub.