Summary
Deleting a user with mmctl
does’nt work as expected, gives strange error message
Steps to reproduce
Here is my environment:
root@border:/opt/mattermost/bin# ./mmctl --local version
mmctl:
Version: 10.0.0
BuiltDate: dev
CommitDate: 2024-09-02T17:54:14Z
GitCommit: 2d83d21388f3111bffe4b1f63521b21d77ec2cef
GitTreeState: dirty
GoVersion: go1.21.8
Compiler: gc
Platform: amd64/linux
First, verify User Deletion via API is allowed:
root@border:/opt/mattermost/bin# ./mmctl --local config get ServiceSettings.EnableAPIUserDeletion
true
These are (some) of my users:
root@border:/opt/mattermost/bin# ./mmctl --local user list
hxp8riz8btroiqugi6ydxxggdc: 4d (4d@localhost)
19j45bi4atnjzykxcbe5ssg19h: appsbot (appsbot@localhost)
yitihxn65fynpxaz8bfu87brzh: boards (boards@localhost)
spf5quyufjryff9byq1u8j9czo: calls (calls@localhost)
[...]
kprpod6nstyj7fe5jed1ybjx7w: testuser (testuser@mydomain.de)
There are 18 users on local instance
When I try to remove the testuser, I issue
root@border:/opt/mattermost/bin# ./mmctl --local user delete testuser@mydomain.de --confirm
Unable to delete user 'testuser' error: failed to decode JSON payload into AppError. Body: <!DOCTYPE html><html><head></head>
<body onload="window.location = '/chat/error?message\u003DWe+encountered+an+error+finding+the+account.
\u0026s\u003DMEUCIDgRWRgvRqVe2_v4Es7JpBUEl7HvFWEC3kJDfLigfs-8AiEAlAJC35i1xDHBFw7O5AvjUt0R7HbCPdYl9sucPAKnXhw\u003D'">
<noscript><meta http-equiv="refresh" content="0; url=/chat/error?message=We+encountered+an+error+finding+the+account.&s=MEUCIDgRWRgvRqVe2_v4Es7JpBUEl7HvFWEC3kJDfLigfs-8AiEAlAJC35i1xDHBFw7O5AvjUt0R7HbCPdYl9sucPAKnXhw="></noscript>
<!-- web error message -->
<a href="/chat/error?message=We+encountered+an+error+finding+the+account.&s=MEUCIDgRWRgvRqVe2_v4Es7JpBUEl7HvFWEC3kJDfLigfs-8AiEAlAJC35i1xDHBFw7O5AvjUt0R7HbCPdYl9sucPAKnXhw=" style="color: #c0c0c0;">...</a>
</body>
</html>
: invalid character '<' looking for beginning of value
The special points of interest are
- failed to decode JSON payload into AppError
- strange formatted HTML code
Requesting JSON Output does not change anything:
root@border:/opt/mattermost/bin# ./mmctl --local --json user delete testuser@mydomain.de --confirm
Same strange error message
Expected behavior
The user should be deleted
Observed behavior
User is not deleted, --json
switch inoperative, strange HTML output.