{"record":{"id":"3fe553a37d86585b","repo":"OtterMind/Chat2DB","slug":"mysql-account-previewtokenmismatch","errorCode":"mysql.account.previewTokenMismatch","errorMessage":"mysql.account.previewTokenMismatch","messagePattern":"mysql\\.account\\.previewTokenMismatch","errorType":"validation","errorClass":"BusinessException","httpStatus":null,"severity":"error","filePath":"chat2db-community-server/chat2db-community-plugins/chat2db-community-mysql/src/main/java/ai/chat2db/plugin/mysql/account/MysqlAccountManager.java","lineNumber":79,"sourceCode":"            throw new BusinessException(ERROR_KEY_ACCOUNT_GRANTS_UNAVAILABLE, null, e);\n        }\n    }\n\n    @Override\n    public AccountPreview preview(AccountOperationRequest command) {\n        String sql = MysqlAccountSqlBuilder.buildSql(command);\n        AccountPreview preview = new AccountPreview();\n        preview.setActionType(command.getActionType());\n        preview.setSql(MysqlAccountSqlBuilder.buildDisplaySql(command));\n        preview.setPreviewToken(MysqlAccountSqlBuilder.previewToken(sql));\n        return preview;\n    }\n\n    @Override\n    public AccountExecuteResponse execute(Connection connection, AccountOperationRequest command) {\n        AccountPreview preview = preview(command);\n        if (!StringUtils.equals(preview.getPreviewToken(), command.getPreviewToken())) {\n            throw new BusinessException(ERROR_KEY_ACCOUNT_PREVIEW_TOKEN_MISMATCH);\n        }\n\n        AccountExecuteResponse result = new AccountExecuteResponse();\n        result.setActionType(preview.getActionType());\n        result.setSql(preview.getSql());\n        String executionSql = MysqlAccountSqlBuilder.buildSql(command);\n\n        try (PreparedStatement statement = connection.prepareStatement(executionSql)) {\n            statement.execute();\n            result.setSuccess(Boolean.TRUE);\n            result.setMessage(MESSAGE_OK);\n        } catch (SQLException e) {\n            result.setSuccess(Boolean.FALSE);\n            result.setMessage(e.getMessage());\n            result.setFailureCode(ERROR_KEY_ACCOUNT_EXECUTE_FAILED);\n            result.setErrorCode(e.getErrorCode());\n            result.setSqlState(e.getSQLState());\n        }","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/OtterMind/Chat2DB/blob/5ee1e990e73fbcae1969dc554be254fedb3ab888/chat2db-community-server/chat2db-community-plugins/chat2db-community-mysql/src/main/java/ai/chat2db/plugin/mysql/account/MysqlAccountManager.java#L61-L97","documentation":"Error \"mysql.account.previewTokenMismatch\" thrown in OtterMind/Chat2DB.","triggerScenarios":"The apply call's preview token did not match the parameters previously previewed, indicating stale or tampered state.","commonSituations":"See trigger scenarios.","solutions":["Re-run the preview step to obtain a fresh token, then submit the apply request with that exact token.","Do not modify account parameters between preview and apply."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5ee1e990e73fbcae1969dc554be254fedb3ab888","analyzedAt":"2026-08-14T07:05:03.077Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}