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

None

Status

Mana

None

Assignee

Unassigned

QA Assignee

None

Reporter

Paul Rothrock

Epic Link

None

Fix versions

Mattermost Team

Platform

Sprint

Labels

QA Testing Areas

None

GitHub Issue

None

Components

None
Configure