Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
0
Help us understand the problem. What is going on with this article?
@fake-deli-ca

mattermostからのユーザ削除

https://qiita.com/fake-deli-ca/items/7fb2446a94e3c2b2477a
gitlabに付属しているmattermostで、以前は上記の記事通りにユーザ削除をやってたんだけど、1年ぶりくらいにやってみたら、こういうエラーが出た。

$ /opt/gitlab/embedded/bin/mattermost -config='/var/opt/gitlab/mattermost/config.json' --version
---------------------------------------------------------------------------------------------
DEPRECATED! All previous commands are now deprecated. Run: platform help to see the new ones.
---------------------------------------------------------------------------------------------
panic: runtime error: invalid memory address or nil pointer dereference

https://docs.mattermost.com/administration/command-line-tools.html#mattermost-3-6-and-later
どうも、この3.6以降のCLIじゃないと動かなくなったみたい。

Version

mattermost@dev:/opt/gitlab/embedded/bin$  ./mattermost  --config='/var/opt/gitlab/mattermost/config.json' version
Version: 3.7.0
Build Number: 3.7.5
(中略)
Build Enterprise Ready: false
DB Version: 3.7.0

動作方法

途中までは変わらず。dockerの中に入るところも一緒。

[root]# docker exec -it dev_gitlab_1 bash
root@dev:/# su - mattermost
$ bash
mattermost@dev:~$

ここからの手順が違う。
あ、config.jsonを設定するところは変わらないのと、mattermostアカウントじゃないとエラーになるところは今までと変わらず。

$ ./mattermost  --config='/var/opt/gitlab/mattermost/config.json' user delete hogehoge@example.com
Have you performed a database backup? (YES/NO): 
YES
Are you sure you want to delete the teams specified?  All data will be permanently deleted? (YES/NO): 
YES
[2020/10/12 10:38:39 UTC] [WARN] api.user.permanent_delete_user.attempting.warn%!(EXTRA string=hogehoge@example.com, string=j89mfnxdw7djifzy8m5ibg1m7c)

WARNが出るので若干不安になったが、うまく削除できれば、もう一度やり直すと登録なし、になる。

$  ./mattermost  --config='/var/opt/gitlab/mattermost/config.json' user delete hogehoge@example.com
Have you performed a database backup? (YES/NO): 
YES
Are you sure you want to delete the teams specified?  All data will be permanently deleted? (YES/NO): 
YES
Error: Unable to find user 'hogehoge@example.com'
Usage:
  platform user delete [users] [flags]

Examples:
  user delete user@example.com

Flags:
      --confirm   Confirm you really want to delete the user and a DB backup has been performed.

Global Flags:
  -c, --config string   Configuration file to use. (default "config.json")
0
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
0
Help us understand the problem. What is going on with this article?