{"record":{"id":"d300f87b559bd05e","repo":"apache/iceberg","slug":"table-does-not-exist-s-d300f8","errorCode":null,"errorMessage":"Table does not exist: %s","messagePattern":"Table does not exist: (.+?)","errorType":"exception","errorClass":"NoSuchTableException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/apache/iceberg/inmemory/InMemoryCatalog.java","lineNumber":451,"sourceCode":"              \"Cannot create table %s. Namespace does not exist: %s\",\n              tableIdentifier, tableIdentifier.namespace());\n        }\n\n        if (views.containsKey(tableIdentifier)) {\n          throw new AlreadyExistsException(\n              \"View with same name already exists: %s\", tableIdentifier);\n        }\n\n        tables.compute(\n            tableIdentifier,\n            (k, existingLocation) -> {\n              if (!Objects.equal(existingLocation, oldLocation)) {\n                if (null == base) {\n                  throw new AlreadyExistsException(\"Table already exists: %s\", tableName());\n                }\n\n                if (null == existingLocation) {\n                  throw new NoSuchTableException(\"Table does not exist: %s\", tableName());\n                }\n\n                throw new CommitFailedException(\n                    \"Cannot commit to table %s metadata location from %s to %s \"\n                        + \"because it has been concurrently modified to %s\",\n                    tableIdentifier, oldLocation, newLocation, existingLocation);\n              }\n              return newLocation;\n            });\n      }\n    }\n\n    @Override\n    public FileIO io() {\n      return fileIO;\n    }\n\n    @Override","sourceCodeStart":433,"sourceCodeEnd":469,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/inmemory/InMemoryCatalog.java#L433-L469","documentation":"Inside the tables.compute lambda of doCommit, if the map no longer contains an entry (existingLocation == null) while committing against a non-null base, the table was dropped concurrently. InMemoryCatalog throws NoSuchTableException because a metadata-location commit against a deleted table is meaningless.","triggerScenarios":"A commit initiated by catalog.loadTable(...).commit() (or fastAppend etc.) while another thread/client calls catalog.dropTable(ident) before the commit's compute step runs.","commonSituations":"Drop-and-recreate pipelines racing with running writers; cleanup jobs deleting idle tables that still have in-flight commits; test teardown interleaving with commit assertions.","solutions":["Re-check table existence before final commits in long-running jobs.","Catch NoSuchTableException and abort/redirect the write if the drop was intentional.","Coordinate drop and write phases so commits are drained before dropping."],"exampleFix":"// before\ntable.refresh();\ntable.commit(applyUpdate);\n\n// after\nif (catalog.tableExists(ident)) {\n  table.refresh();\n  table.commit(applyUpdate);\n} else {\n  // handle dropped table\n}","handlingStrategy":"try-catch","validationCode":"if (!catalog.tableExists(ident)) { throw new IllegalStateException(\"Table was dropped: \" + ident); }","typeGuard":null,"tryCatchPattern":"try { table.commit(update); } catch (NoSuchTableException e) { // abort pipeline or recreate table; do not retry blindly }","preventionTips":["Drain in-flight commits before dropTable in cleanup jobs","Re-check existence before committing after long computations","Avoid sharing Table handles across drop/recreate cycles"],"tags":["catalog","concurrency","drop-table","commit"],"backgroundTag":"entity-not-found","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"}