{"record":{"id":"0b6a2b6d03c29726","repo":"apache/iceberg","slug":"dynamo-catalog-table-s-is-not-active-current-sta","errorCode":null,"errorMessage":"Dynamo catalog table %s is not active, current status: %s","messagePattern":"Dynamo catalog table (.+?) is not active, current status: (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"aws/src/main/java/org/apache/iceberg/aws/dynamodb/DynamoDbCatalog.java","lineNumber":661,"sourceCode":"                    .build())\n            .billingMode(BillingMode.PAY_PER_REQUEST)\n            .build());\n\n    // wait for the dynamo table to complete provisioning, which takes around 10 seconds\n    Tasks.foreach(awsProperties.dynamoDbTableName())\n        .retry(CATALOG_TABLE_CREATION_WAIT_ATTEMPTS_MAX)\n        .throwFailureWhenFinished()\n        .onlyRetryOn(IllegalStateException.class)\n        .run(this::checkTableActive);\n  }\n\n  private void checkTableActive(String tableName) {\n    try {\n      DescribeTableResponse response =\n          dynamo.describeTable(DescribeTableRequest.builder().tableName(tableName).build());\n      TableStatus currentStatus = response.table().tableStatus();\n      if (!currentStatus.equals(TableStatus.ACTIVE)) {\n        throw new IllegalStateException(\n            String.format(\n                \"Dynamo catalog table %s is not active, current status: %s\",\n                tableName, currentStatus));\n      }\n    } catch (ResourceNotFoundException e) {\n      throw new IllegalStateException(\n          String.format(\"Cannot find Dynamo catalog table %s\", tableName));\n    }\n  }\n\n  private boolean updateProperties(\n      Namespace namespace,\n      String updateExpression,\n      Map<String, AttributeValue> attributeValues,\n      Map<String, String> attributeNames) {\n    validateNamespace(namespace);\n    Map<String, AttributeValue> key = namespacePrimaryKey(namespace);\n    try {","sourceCodeStart":643,"sourceCodeEnd":679,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/aws/src/main/java/org/apache/iceberg/aws/dynamodb/DynamoDbCatalog.java#L643-L679","documentation":"DynamoDbCatalog.checkTableActive() calls DescribeTable on the underlying DynamoDB catalog table and requires its status to be ACTIVE before performing catalog reads/writes. If the status differs (e.g. CREATING, UPDATING, DELETING), an IllegalStateException with this message is thrown because the catalog table cannot reliably serve requests.","triggerScenarios":"Any catalog operation that routes through checkTableActive while the DynamoDB catalog table is mid-update — table creation, deletion, or a TTL/throughput change leaving it in CREATING/UPDATING/DELETING state.","commonSituations":"Deployment scripts that delete and immediately recreate the catalog table, then start the catalog before the new table is ACTIVE; on-demand capacity mode switches; running tests against a table still being provisioned.","solutions":["Wait until `aws dynamodb describe-table --table-name <catalog-table>` reports ACTIVE before initializing the catalog; add retry/backoff around catalog initialization.","Ensure the setup script does not delete/recreate the DynamoDB catalog table while clients are running.","Catch IllegalStateException from catalog construction and retry after a delay if the status is transitioning (CREATING/UPDATING)."],"exampleFix":"// before\nDynamoDbCatalog catalog = new DynamoDbCatalog();\ncatalog.initialize(config); // may hit non-ACTIVE table\n\n// after\nwaitUntilTableActive(catalogTableName); // poll DescribeTable until status == ACTIVE\nDynamoDbCatalog catalog = new DynamoDbCatalog();\ncatalog.initialize(config);","handlingStrategy":"retry","validationCode":"DescribeTableResponse r = dynamo.describeTable(DescribeTableRequest.builder().tableName(catalogTable).build());\nif (!r.table().tableStatus().equals(TableStatus.ACTIVE)) {\n  throw new IllegalStateException(\"Catalog table \" + catalogTable + \" is \" + r.table().tableStatus());\n}","typeGuard":null,"tryCatchPattern":"await.atMost(5, MINUTES).pollInterval(10, SECONDS).until(() -> {\n  try { catalog.initialize(config); return true; }\n  catch (IllegalStateException e) { return false; } // table still transitioning\n});","preventionTips":["Never delete/recreate the DynamoDB catalog table while clients are running","Wait for ACTIVE status after any table-level change before starting the catalog","Add readiness probes that poll DescribeTable before app startup"],"tags":["aws","dynamodb","catalog","table-status","state"],"backgroundTag":"invalid-state-transition","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"}