{"record":{"id":"35ffd2e3b0949c61","repo":"apache/iceberg","slug":"create-namespace-failed-s","errorCode":null,"errorMessage":"Create namespace failed: %s","messagePattern":"Create namespace failed: (.+?)","errorType":"exception","errorClass":"RuntimeIOException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/apache/iceberg/hadoop/HadoopCatalog.java","lineNumber":298,"sourceCode":"  public void createNamespace(Namespace namespace, Map<String, String> meta) {\n    Preconditions.checkArgument(\n        !namespace.isEmpty(), \"Cannot create namespace with invalid name: %s\", namespace);\n    if (!meta.isEmpty()) {\n      throw new UnsupportedOperationException(\n          \"Cannot create namespace \" + namespace + \": metadata is not supported\");\n    }\n\n    Path nsPath = new Path(warehouseLocation, SLASH.join(namespace.levels()));\n\n    if (isNamespace(nsPath)) {\n      throw new AlreadyExistsException(\"Namespace already exists: %s\", namespace);\n    }\n\n    try {\n      fs.mkdirs(nsPath);\n\n    } catch (IOException e) {\n      throw new RuntimeIOException(e, \"Create namespace failed: %s\", namespace);\n    }\n  }\n\n  @Override\n  public List<Namespace> listNamespaces(Namespace namespace) {\n    Path nsPath =\n        namespace.isEmpty()\n            ? new Path(warehouseLocation)\n            : new Path(warehouseLocation, SLASH.join(namespace.levels()));\n    if (!isNamespace(nsPath)) {\n      throw new NoSuchNamespaceException(\"Namespace does not exist: %s\", namespace);\n    }\n\n    try {\n      // using the iterator listing allows for paged downloads\n      // from HDFS and prefetching from object storage.\n      List<Namespace> namespaces = Lists.newArrayList();\n      RemoteIterator<FileStatus> it = fs.listStatusIterator(nsPath);","sourceCodeStart":280,"sourceCodeEnd":316,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/hadoop/HadoopCatalog.java#L280-L316","documentation":"HadoopCatalog.createNamespace wraps IOExceptions from fs.mkdirs(nsPath) into a RuntimeIOException. The namespace existence check passed, but creating the directory on the filesystem failed at the I/O level (permissions, connectivity, storage errors).","triggerScenarios":"Calling catalog.createNamespace(namespace, meta) when fs.mkdirs throws IOException: no write permission on the parent warehouse directory, HDFS unavailable/quota exceeded, cloud-store credential or network failure.","commonSituations":"Warehouse directory owned by another user/service account, HDFS disk quota exhausted, transient S3/GCS/ADLS outages, Kerberos ticket expiry, or a read-only filesystem mount.","solutions":["Check the IOException cause for permission vs connectivity vs quota errors.","Verify the process user has write permission on the warehouse parent directory (HDFS ACLs/permissions, IAM policies for cloud stores).","Check HDFS quota (hdfs dfs -count -q) or cloud bucket policies/limits.","Retry on transient network/cloud errors.","Verify Kerberos/authentication is valid for the Hadoop FileSystem."],"exampleFix":"// before\ncatalog.createNamespace(ns, Collections.emptyMap());\n\n// after: catch and diagnose\ntry {\n  catalog.createNamespace(ns, Collections.emptyMap());\n} catch (RuntimeIOException e) {\n  LOG.error(\"mkdirs failed for {} - check warehouse write permissions\", ns, e);\n  throw e;\n}","handlingStrategy":"try-catch","validationCode":"// Pre-check write access on warehouse parent if possible; otherwise ensure creds/permissions up front","typeGuard":null,"tryCatchPattern":"try { catalog.createNamespace(ns, Collections.emptyMap()); } catch (RuntimeIOException e) { // inspect e.getCause(): permission vs connectivity vs quota }","preventionTips":["Verify warehouse directory write permissions per service account","Monitor HDFS quotas and cloud bucket limits","Retry transient cloud-store mkdir failures"],"tags":["io","mkdir","permission","namespace","hadoop"],"backgroundTag":"mkdir-permission-denied","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}