Mattermost Enterprise Edition 20 v5.38.0, mmctl v5.35.0 -- b27164c, kubernetes 1.19.7
Issued command on mattermost server after import from Slack:
$ mmctl user migrate_auth email saml MM2SAML.json
WARNING: server version 5.38.0.5.38.0.36c5b542ffc07c899bab5ebfb5a1c5cc.true doesn't match mmctl version 5.35.0
Error: AppErrorFromJson: model.utils.decode_json.app_error, body: <html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx</center>
</body>
</html>
Usage:
mmctl user migrate_auth [from_auth] [to_auth] [migration-options] [flags]
Examples:
user migrate_auth email saml users.json
Flags:
--auto Automatically migrate all users. Assumes the usernames and emails are identical between Mattermost and SAML services. (saml only)
--confirm Confirm you really want to proceed with auto migration. (saml only)
--force Force the migration to occur even if there are duplicates on the LDAP server. Duplicates will not be migrated. (ldap only)
-h, --help help for migrate_auth
Global Flags:
--config-path string path to the configuration directory. If "$HOME/.mmctl" exists it will take precedence over the default value (default "$XDG_CONFIG_HOME")
--format string the format of the command output [plain, json] (default "plain")
--insecure-sha1-intermediate allows to use insecure TLS protocols, such as SHA-1
--insecure-tls-version allows to use TLS versions 1.0 and 1.1
--local allows communicating with the server through a unix socket
--strict will only run commands if the mmctl version matches the server one
Error from server log files:
mattermost-mattermost-enterprise-edition-7dc759574f-bg6wb:{"level":"error","ts":1631561721.9394324,"caller":"http/server.go:3117","msg":"http: panic serving 100.96.40.8:48940: runtime error: invalid memory address or nil pointer dereference
goroutine 177954 [running]:
net/http.(*conn).serve.func1(0xc0068405a0)
net/http/server.go:1804 +0x153
panic(0x2834280, 0x448d3d0)
runtime/panic.go:971 +0x499
github.com/mattermost/mattermost-server/v5/enterprise/account_migration.checkEmailAlreadyInUse(0xc002900c80, 0x1c, 0xc0026fd440, 0x6, 0x8, 0x6)
github.com/mattermost/mattermost-server/v5/enterprise/account_migration/account_migration.go:147 +0x46
github.com/mattermost/mattermost-server/v5/enterprise/account_migration.(*AccountMigrationInterfaceImpl).MigrateToSaml(0xc002f30780, 0x0, 0x0, 0xc001d2e8d0, 0x0, 0x17bcc18628c)
github.com/mattermost/mattermost-server/v5/enterprise/account_migration/account_migration.go:202 +0x547
github.com/mattermost/mattermost-server/v5/api4.migrateAuthToSaml(0xc0026fc900, 0x30f55b0, 0xc0026fc880, 0xc00 0ff2800)
github.com/mattermost/mattermost-server/v5/api4/user.go:2851 +0x72b
github.com/mattermost/mattermost-server/v5/web.Handler.ServeHTTP(0x316aab0, 0xc00282ac10, 0x2d511f0, 0x36aafaf, 0x11, 0x100000001, │
│ 0x0, 0x0, 0x30f75f0, 0xc0069101c0, ...)
github.com/mattermost/mattermost-server/v5/web/handlers.go:298 +0x1d72
github.com/mattermost/gziphandler.GzipHandlerWithOpts.func1.1(0x30f6b70, 0xc0047442a0, 0xc000ff 2800)
github.com/mattermost/[email protected]/gzip.go:337 +0x22d
net/http.HandlerFunc.ServeHTTP(0xc0025d7560, 0x30f6b70, 0xc0047442a0, 0xc000ff2800)
net/http/server.go:2049 +0x44
github.com/gorilla/mux.(*Router).ServeHTTP(0xc00018e240, 0x30f6b70, 0xc0047442a0, 0xc000ff2500)
github.com/gorilla/[email protected]/mux.go:210 +0xd3
net/http.serverHandler.ServeHTTP(0xc00293b500, 0x30f6b70, 0xc0047442a0, 0xc000ff2500)
net/http/server.go:2867 +0xa3
net/http.(*conn).serve(0xc0068405a0, 0x3100998, 0xc0026fc740)
net/http/server.go:1932 +0x8cd
created by net/http.(*Server).Serve
net/http/server.go:2993 +0x39b","source":"httpserver"}
Source json file format is :
{
"user@email": "user-name"
}