{"record":{"id":"fa088916f2f4945a","repo":"apache/seatunnel","slug":"drop-table-error","errorCode":null,"errorMessage":"drop table error","messagePattern":"drop table error","errorType":"exception","errorClass":"org.apache.seatunnel.api.table.catalog.exception.CatalogException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-maxcompute/src/main/java/org/apache/seatunnel/connectors/seatunnel/maxcompute/catalog/MaxComputeCatalog.java","lineNumber":225,"sourceCode":"                                    readonlyConfig.get(\n                                            MaxcomputeSinkOptions.SAVE_MODE_CREATE_TEMPLATE),\n                                    tablePath,\n                                    table))\n                    .waitForSuccess();\n        } catch (OdpsException e) {\n            throw new CatalogException(\"create table error\", e);\n        }\n    }\n\n    @Override\n    public void dropTable(TablePath tablePath, boolean ignoreIfNotExists)\n            throws TableNotExistException, CatalogException {\n        try {\n            Odps odps = getOdps(tablePath.getDatabaseName(), tablePath.getSchemaName());\n            SQLTask.run(odps, MaxComputeCatalogUtil.getDropTableQuery(tablePath, ignoreIfNotExists))\n                    .waitForSuccess();\n        } catch (OdpsException e) {\n            throw new CatalogException(\"drop table error\", e);\n        }\n    }\n\n    @Override\n    public void createDatabase(TablePath tablePath, boolean ignoreIfExists)\n            throws DatabaseAlreadyExistException, CatalogException {\n        throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public void dropDatabase(TablePath tablePath, boolean ignoreIfNotExists)\n            throws DatabaseNotExistException, CatalogException {\n        throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public void truncateTable(TablePath tablePath, boolean ignoreIfNotExists)\n            throws TableNotExistException, CatalogException {","sourceCodeStart":207,"sourceCodeEnd":243,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-maxcompute/src/main/java/org/apache/seatunnel/connectors/seatunnel/maxcompute/catalog/MaxComputeCatalog.java#L207-L243","documentation":"MaxComputeCatalog.dropTable runs a DROP TABLE query (built with ignoreIfNotExists semantics) via SQLTask.run(...).waitForSuccess() and wraps any OdpsException into a CatalogException with this message. Indicates the drop task failed to submit or complete.","triggerScenarios":"dropTable is called; SQLTask.run with getDropTableQuery throws OdpsException, or the task instance fails at waitForSuccess.","commonSituations":"Table does not exist and ignoreIfNotExists=false with a non-idempotent query; permission denied to drop; table is protected (cannot be dropped) or locked by a running job; network failure.","solutions":["Read the cause OdpsException and the MaxCompute instance log","Set ignoreIfNotExists=true or use DROP TABLE IF EXISTS in templates","Grant Drop permission on the table/project","Check for table protection (enable_drop_table protection) or locks and disable/remove them"],"exampleFix":"// before\ncatalog.dropTable(TablePath.of(\"proj\", \"t1\"), false); // fails if t1 missing\n// after\ncatalog.dropTable(TablePath.of(\"proj\", \"t1\"), true); // idempotent drop","handlingStrategy":"try-catch","validationCode":"if (!catalog.tableExists(tablePath) && ignoreIfNotExists) {\n    return; // nothing to drop\n}","typeGuard":null,"tryCatchPattern":"try {\n    catalog.dropTable(tablePath, true);\n} catch (CatalogException e) {\n    if (e.getCause() instanceof OdpsException\n            && String.valueOf(e.getCause().getMessage()).toLowerCase().contains(\"protect\")) {\n        throw new IllegalStateException(\"Table \" + tablePath + \" is protected; disable protection first\", e);\n    }\n    throw e;\n}","preventionTips":["Always pass ignoreIfNotExists=true for idempotent pipelines","Check MaxCompute table protection settings (protect mode) before dropping","Ensure the account has Drop permission","Verify no running jobs hold locks on the table"],"tags":["maxcompute","catalog","ddl","drop-table"],"backgroundTag":"sql-query-failed","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}