{"record":{"id":"5d78e8b60fe53b75","repo":"apache/iceberg","slug":"no-hadoop-configuration-was-set-using-the-default","errorCode":null,"errorMessage":"No Hadoop Configuration was set, using the default environment Configuration","messagePattern":"No Hadoop Configuration was set, using the default environment Configuration","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"hive-metastore/src/main/java/org/apache/iceberg/hive/HiveCatalog.java","lineNumber":112,"sourceCode":"\n  private String name;\n  private Configuration conf;\n  private FileIO fileIO;\n  private KeyManagementClient keyManagementClient;\n  private ClientPool<IMetaStoreClient, TException> clients;\n  private boolean listAllTables = false;\n  private boolean uniqueTableLocation;\n  private Map<String, String> catalogProperties;\n  private CloseableGroup closeableGroup;\n\n  public HiveCatalog() {}\n\n  @Override\n  public void initialize(String inputName, Map<String, String> properties) {\n    this.catalogProperties = ImmutableMap.copyOf(properties);\n    this.name = inputName;\n    if (conf == null) {\n      LOG.warn(\"No Hadoop Configuration was set, using the default environment Configuration\");\n      this.conf = new Configuration();\n    }\n\n    if (properties.containsKey(CatalogProperties.URI)) {\n      this.conf.set(HiveConf.ConfVars.METASTOREURIS.varname, properties.get(CatalogProperties.URI));\n    }\n\n    if (properties.containsKey(CatalogProperties.WAREHOUSE_LOCATION)) {\n      this.conf.set(\n          HiveConf.ConfVars.METASTOREWAREHOUSE.varname,\n          LocationUtil.stripTrailingSlash(properties.get(CatalogProperties.WAREHOUSE_LOCATION)));\n    }\n\n    this.listAllTables =\n        Boolean.parseBoolean(properties.getOrDefault(LIST_ALL_TABLES, LIST_ALL_TABLES_DEFAULT));\n\n    String fileIOImpl = properties.get(CatalogProperties.FILE_IO_IMPL);\n    this.fileIO =","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/hive-metastore/src/main/java/org/apache/iceberg/hive/HiveCatalog.java#L94-L130","documentation":"HiveCatalog.initialize logs this warning when no Hadoop Configuration was supplied (e.g. via the constructor accepting a Configuration, or setConf) and falls back to a new default org.apache.hadoop.conf.Configuration from the environment. Without an explicit conf, metastore connection settings may not match the environment the caller intended.","triggerScenarios":"Instantiating HiveCatalog (e.g. via CatalogUtil.loadCatalog) without passing a Hadoop Configuration and without hadoop-conf resources on the classpath so conf remains null at initialize time.","commonSituations":"Spark/Flink jobs constructing HiveCatalog directly instead of through the engine's Hadoop conf; missing core-site.xml/hive-site.xml on the classpath; tests that use the no-conf constructor.","solutions":["Pass the engine's Hadoop Configuration: new HiveCatalog(conf) or catalog.setConf(conf) before initialize","Ensure hive-site.xml / core-site.xml with metastore URI settings are on the classpath","Set uri/warehouse in catalog properties so the default conf is at least pointed at the right metastore","Prefer loading via HadoopCatalogs/CatalogUtil so conf wiring is automatic"],"exampleFix":"// before\nHiveCatalog catalog = new HiveCatalog();\ncatalog.initialize(\"hive\", props);\n// after\nHiveCatalog catalog = new HiveCatalog();\ncatalog.setConf(spark.sparkContext().hadoopConfiguration());\ncatalog.initialize(\"hive\", props);","handlingStrategy":"validation","validationCode":"Configuration conf = spark.sparkContext().hadoopConfiguration();\nif (conf.get(\"hive.metastore.uris\") == null) { /* set uri property or fix classpath */ }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always inject the engine's Hadoop conf into HiveCatalog","Ship hive-site.xml on the classpath","Set CatalogProperties.URI explicitly in catalog properties","Verify conf is non-null before initialize in custom glue code"],"tags":["hive-metastore","hadoop-configuration","catalog","default-fallback"],"backgroundTag":"missing-config-value","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}