{"record":{"id":"da3eb2cf7e5b1202","repo":"apache/superset","slug":"unexpected-error-occurred-please-check-your-logs","errorCode":null,"errorMessage":"Unexpected error occurred, please check your logs for details","messagePattern":"Unexpected error occurred, please check your logs for details","errorType":"exception","errorClass":"DatabaseTablesUnexpectedError","httpStatus":422,"severity":"error","filePath":"superset/commands/database/tables.py","lineNumber":174,"sourceCode":"                + [\n                    {\n                        \"value\": mv.table,\n                        \"type\": \"materialized_view\",\n                    }\n                    for mv in materialized_views\n                ],\n                key=lambda item: item[\"value\"],\n            )\n\n            payload = {\n                \"count\": len(tables) + len(views) + len(materialized_views),\n                \"result\": options,\n            }\n            return payload\n        except SupersetException:\n            raise\n        except Exception as ex:\n            raise DatabaseTablesUnexpectedError(str(ex)) from ex\n\n    def validate(self) -> None:\n        self._model = cast(Database, DatabaseDAO.find_by_id(self._db_id))\n        if not self._model:\n            raise DatabaseNotFoundError()\n","sourceCodeStart":156,"sourceCodeEnd":180,"githubUrl":"https://github.com/apache/superset/blob/f4587218dd19d046c3e4d00063e7d27f8a2ed354/superset/commands/database/tables.py#L156-L180","documentation":"DatabaseTablesUnexpectedError wraps any non-Superset exception thrown while building the tables/views/materialized-views listing payload in DatabaseTablesCommand.run(). SupersetExceptions pass through unchanged; everything else is converted with the original message preserved.","triggerScenarios":"GET /api/v1/database/<id>/tables/ where introspection raises an unexpected driver/SDK error (serialization issue, engine-specific bug, unexpected None from the driver).","commonSituations":"Bugs in engine integration paths, malformed metadata returned by exotic drivers, version mismatches between SQLAlchemy and the DBAPI driver.","solutions":["Read the wrapped message (str(ex)) and server logs for the underlying traceback","Update the SQLAlchemy driver / engine spec if the cause is a known integration bug","Test the same listing in SQL Lab to see if the engine itself is healthy"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    payload = DatabaseTablesCommand(db_id, {}).run()\nexcept DatabaseTablesUnexpectedError as e:\n    logger.exception(\"table listing failed: %s\", e.__cause__)\n    ...","preventionTips":["Keep SQLAlchemy/DBAPI driver versions pinned to tested combos","Report engine-specific introspection failures with the chained traceback"],"tags":["database","introspection","unexpected"],"backgroundTag":null,"analyzedSha":"f4587218dd19d046c3e4d00063e7d27f8a2ed354","analyzedAt":"2026-08-14T22:39:27.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}