Converting a user to a bot via the CLI does not create an access token and can't be deleted

Description

Environment

  • Mattermost Server: 5.16.1

Steps to Reproduce

1. Create a user via the CLI: mattermost user create —email junk@example.com —username devopsbot —password badpassword
2. Convert that user to a bot: mattermost user convert devopsbot —bot
3. Delete the user with mattermost user delete devopsbot

Expected Behavior

After 2: User is converted to a bot and a corresponding access token is generated and output to the command line.

After 3: User is deleted

Observed Behavior

After 2: The user is converted successfully, but there is no corresponding token in the UserAccessTokens table and it isn’t output to the CLI. When creating a bot account through the web interface. Also, since bot users can’t log in, the user can’t create a user access token to use.

After 3: CLI enters a loop. With SQL trace enabled, this message repeats until the process is killed with Ctrl+C

QA Test Steps

see ticket

Mana

None

Assignee

Christopher Speller

QA Assignee

Dylan Haussermann

Reporter

Paul Rothrock

Epic Link

None

Fix versions

Mattermost Team

Sustained Engineering

Sprint

None

Labels

QA Testing Areas

Other (write in QA test steps)

GitHub Issue

None

Components

None

Severity

None
Configure