Closed svenbrier closed 2 years ago
Yes, that's expected: since Mattermost 6.0 the mattermost
binary for command-line operations has been replaced by mmctl
(/var/www/mattermost/bin/mmctl).
You'll probably want to look at this: https://docs.mattermost.com/manage/mmctl-command-line-tool.html#mmctl-user-delete
Many thanks for your response. Unfortunately, in my case, it did not bring the desired result.
I tried: mmctl user delete test_sven The answer was: -bash: mmctl: command not found
As sudo I was also unsuccessful.
You may want to try with the full path to mmctl, and use "local authentication" mode to allow mmctl to connect to a local installation:
config.json
file, and set EnableLocalMode
to "true"
:
sudo sed -i 's/"EnableLocalMode": false/"EnableLocalMode": true/g' /var/www/mattermost/config/config.json
sudo systemctl restart mattermost
mmctl
to run using local mode, by setting two environment variables:
export MMCTL_LOCAL=true
export MMCTL_LOCAL_SOCKET_PATH=/var/run/mattermost/mattermost_local.socket
mmctl
with the full path:
sudo --preserve-env /var/www/mattermost/bin/mmctl user list
(I just created a wiki to host these informations: https://github.com/YunoHost-Apps/mattermost_ynh/wiki)
Thank you for helping me. I'm sorry to say, that is still not working:
Error: cannot read user credentials, maybe you need to use login first: stat /root/.config/mmctl/config: no such file or directory
Even not as su root.
Mmm, I think that means activating local mode didn't work. Oh, I see: sudo didn't pass the environment variables to mmctl.
What if you try using :
export MMCTL_LOCAL=true
export MMCTL_LOCAL_SOCKET_PATH=/var/run/mattermost/mattermost_local.socket
sudo --preserve-env /var/www/mattermost/bin/mmctl user list
It worked like a charm! Thank you so, so much! 😄
Perfect then 🙇
I updated the wiki with the correct instructions.
I tried to delete a mattermost test user but the 'mattermost user delete USERNAME' command throws the error 'mattermost: command not found'. How can I delete a mattermost user on YUNOHOST?