{"record":{"id":"7065b1fc8c89a4f7","repo":"apache/superset","slug":"reset-aborted","errorCode":null,"errorMessage":"Reset aborted.","messagePattern":"Reset aborted\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"superset/commands/security/reset.py","lineNumber":52,"sourceCode":"    def __init__(\n        self,\n        confirm: bool,\n        user: Any,\n        exclude_users: Optional[str] = None,\n        exclude_roles: Optional[str] = None,\n    ) -> None:\n        self._user = user\n        self._confirm = confirm\n        self._users_to_exclude = [\"admin\"]\n        if exclude_users:\n            self._users_to_exclude.extend(exclude_users.split(\",\"))\n        self._roles_to_exclude = [\"Admin\", \"Public\", \"Gamma\", \"Alpha\", \"sql_lab\"]\n        if exclude_roles:\n            self._roles_to_exclude.extend(exclude_roles.split(\",\"))\n\n    def validate(self) -> None:\n        if not self._confirm:\n            raise Exception(\"Reset aborted.\")  # pylint: disable=broad-exception-raised\n        if not self._user or not self._user.is_active:\n            raise Exception(\"User not found.\")  # pylint: disable=broad-exception-raised\n\n    def run(self) -> None:\n        self.validate()\n        logger.debug(\"Resetting Superset Started\")\n        db.session.query(SqlaTable).delete()\n        databases = db.session.query(Database)\n        for database in databases:\n            db.session.delete(database)\n        db.session.query(Dashboard).delete()\n        db.session.query(Slice).delete()\n        db.session.query(KeyValueEntry).delete()\n        db.session.query(Log).delete()\n        db.session.query(FavStar).delete()\n\n        logger.debug(\"Ignoring Users: %s\", self._users_to_exclude)\n        users_to_delete = (","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/apache/superset/blob/f4587218dd19d046c3e4d00063e7d27f8a2ed354/superset/commands/security/reset.py#L34-L70","documentation":"A bare Exception('Reset aborted.') is raised by SecurityResetCommand.validate when the confirm flag is falsy. The command performs a destructive wipe of most Superset metadata (datasets, databases, dashboards, charts, KV entries, logs), so confirm is a mandatory dead-man switch.","triggerScenarios":"Invoking the security reset (e.g. 'superset init' ResetSupersetCommand path or the CLI security reset command) without passing confirm=True, or with confirm parsing to a falsy value ('false', 0, '').","commonSituations":"Running the documented reset command but forgetting the --yes/confirm argument; boolean flags passed as strings from shell scripts and never coerced.","solutions":["Pass an explicit true confirm (e.g. --yes / confirm=True) when invoking the reset","If the reset was not intended, this abort is the desired outcome — verify the command and arguments before retrying","Never run this in production; scope destructive resets to disposable dev/demo environments"],"exampleFix":"# before\nSecurityResetCommand(user, confirm=False).run()\n\n# after\nSecurityResetCommand(user, confirm=True).run()  # destructive: wipes metadata","handlingStrategy":"validation","validationCode":"assert confirm is True, 'reset requires an explicit True confirm'","typeGuard":"def reset_is_confirmed(flag: object) -> bool:\n    return flag is True","tryCatchPattern":null,"preventionTips":["Coerce CLI booleans before passing confirm (argparse: type=bool-aware helper)","Treat this abort as the safety feature it is; never bypass it","Restrict the reset command to disposable environments"],"tags":["cli","security-reset","destructive-operation","confirm-guard"],"backgroundTag":null,"analyzedSha":"f4587218dd19d046c3e4d00063e7d27f8a2ed354","analyzedAt":"2026-08-14T22:39:27.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}