Summary
Import from slack causes panic in server due to invalid memory access or nil pointer dereference
Steps to reproduce
- Created a slack corporate export for last 7 days (only 630KB)
- Used mattermost cli to import the file as per migrating-from-slack-using-the-mattermost-cli documentation
Mattermost Version: 5.19.0
Running in docker based on GitHub - mattermost/mattermost-docker: Deprecated
Expected behavior
Users, channels, and messages are imported into mattermost.
Observed behavior
The mattermost cli crashes with a SIGSEGV. The users seem to all be imported; many channels and messages also appear.
The mattermost cli crashes as follow:
Running Slack Import. This may take a long time for large teams or teams with many messages.
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x10920bd]
goroutine 1 [running]:
github.com/mattermost/mattermost-server/v5/app.(*App).OldImportChannel(0xc003781500, 0xc00278c680, 0xc0026a8540, 0x9, 0xc0026a8540, 0x9, 0x0, 0x0, 0xc0043ce900, 0x2, ...)
github.com/mattermost/mattermost-server/v5@/app/slackimport.go:848 +0x41d
github.com/mattermost/mattermost-server/v5/app.(*App).SlackAddChannels(0xc003781500, 0xc00317fb40, 0x1a, 0xc004d34000, 0x390, 0x3bb, 0xc000029998, 0xc0025038f0, 0xc000029968, 0xc005b80b00, ...)
github.com/mattermost/mattermost-server/v5@/app/slackimport.go:546 +0x76e
github.com/mattermost/mattermost-server/v5/app.(*App).SlackImport(0xc003781500, 0x18f1820, 0xc002525598, 0x9a763, 0xc00317fb40, 0x1a, 0x0, 0x0)
github.com/mattermost/mattermost-server/v5@/app/slackimport.go:747 +0x1536
github.com/mattermost/mattermost-server/v5/cmd/mattermost/commands.slackImportCmdF(0x241d080, 0xc00026c840, 0x2, 0x2, 0x0, 0x0)
github.com/mattermost/mattermost-server/v5@/cmd/mattermost/commands/import.go:77 +0x28c
github.com/spf13/cobra.(*Command).execute(0x241d080, 0xc00026c7a0, 0x2, 0x2, 0x241d080, 0xc00026c7a0)
github.com/spf13/cobra@v0.0.5/command.go:826 +0x460
github.com/spf13/cobra.(*Command).ExecuteC(0x2421400, 0x0, 0x64e00, 0xc00003a118)
github.com/spf13/cobra@v0.0.5/command.go:914 +0x2fb
github.com/spf13/cobra.(*Command).Execute(...)
github.com/spf13/cobra@v0.0.5/command.go:864
github.com/mattermost/mattermost-server/v5/cmd/mattermost/commands.Run(...)
github.com/mattermost/mattermost-server/v5@/cmd/mattermost/commands/root.go:15
main.main()
github.com/mattermost/mattermost-server/v5@/cmd/mattermost/main.go:30 +0x87
The content of mattermost.log:
{"level":"warn","ts":1581320464.750487,"caller":"app/slackimport.go:172","msg":"Slack Import: User does not have an email address in the Slack export. Used username as a placeholder. The user should update their email address once logged in to the system.","user_email":"googledrive@example.com","user_name":"googledrive"} {"level":"warn","ts":1581320469.3653293,"caller":"app/slackimport.go:172","msg":"Slack Import: User does not have an email address in the Slack export. Used username as a placeholder. The user should update their email address once logged in to the system.","user_email":"google_calendar@example.com","user_name":"google_calendar"} {"level":"warn","ts":1581320470.54432,"caller":"app/slackimport.go:431","msg":"Slack Import: Unable to import the message as its type is not supported","post_type":"message","post_subtype":"slackbot_response"} {"level":"warn","ts":1581320470.5876412,"caller":"app/slackimport.go:431","msg":"Slack Import: Unable to import the message as its type is not supported","post_type":"message","post_subtype":"group_join"} {"level":"warn","ts":1581320470.632222,"caller":"app/slackimport.go:447","msg":"Slack Import: Unable to import file as the file is missing from the Slack export zip file.","file_id":"FTSN7SSP9"} {"level":"warn","ts":1581320470.6387784,"caller":"app/slackimport.go:447","msg":"Slack Import: Unable to import file as the file is missing from the Slack export zip file.","file_id":"FTQCXNLPN"} {"level":"warn","ts":1581320470.6547532,"caller":"app/slackimport.go:447","msg":"Slack Import: Unable to import file as the file is missing from the Slack export zip file.","file_id":"FTC357C8J"} {"level":"warn","ts":1581320470.9628332,"caller":"app/slackimport.go:447","msg":"Slack Import: Unable to import file as the file is missing from the Slack export zip file.","file_id":"FTEF8CD3K"} {"level":"warn","ts":1581320471.2638166,"caller":"app/slackimport.go:447","msg":"Slack Import: Unable to import file as the file is missing from the Slack export zip file.","file_id":"FTHQYPCSC"} {"level":"warn","ts":1581320471.2672236,"caller":"app/slackimport.go:447","msg":"Slack Import: Unable to import file as the file is missing from the Slack export zip file.","file_id":"FT6K58QUT"} {"level":"warn","ts":1581320471.280652,"caller":"app/slackimport.go:447","msg":"Slack Import: Unable to import file as the file is missing from the Slack export zip file.","file_id":"FTJD87ASH"} {"level":"warn","ts":1581320471.320284,"caller":"app/slackimport.go:447","msg":"Slack Import: Unable to import file as the file is missing from the Slack export zip file.","file_id":"FTSDEJS5C"} {"level":"warn","ts":1581320471.4011714,"caller":"app/slackimport.go:447","msg":"Slack Import: Unable to import file as the file is missing from the Slack export zip file.","file_id":"FTCPKPQD8"} {"level":"warn","ts":1581320471.4012346,"caller":"app/slackimport.go:447","msg":"Slack Import: Unable to import file as the file is missing from the Slack export zip file.","file_id":"FTRHC9LKS"} {"level":"warn","ts":1581320471.7793953,"caller":"app/slackimport.go:431","msg":"Slack Import: Unable to import the message as its type is not supported","post_type":"message","post_subtype":"slackbot_response"} {"level":"warn","ts":1581320471.8329668,"caller":"app/slackimport.go:431","msg":"Slack Import: Unable to import the message as its type is not supported","post_type":"message","post_subtype":"slackbot_response"} {"level":"warn","ts":1581320471.8395333,"caller":"app/slackimport.go:447","msg":"Slack Import: Unable to import file as the file is missing from the Slack export zip file.","file_id":"FTQUXEFGX"} {"level":"warn","ts":1581320472.2202039,"caller":"app/slackimport.go:431","msg":"Slack Import: Unable to import the message as its type is not supported","post_type":"message","post_subtype":"slackbot_response"} {"level":"warn","ts":1581320472.2298424,"caller":"app/slackimport.go:431","msg":"Slack Import: Unable to import the message as its type is not supported","post_type":"message","post_subtype":"slackbot_response"} {"level":"warn","ts":1581320472.2329972,"caller":"app/slackimport.go:431","msg":"Slack Import: Unable to import the message as its type is not supported","post_type":"message","post_subtype":"slackbot_response"} {"level":"warn","ts":1581320472.2462523,"caller":"app/slackimport.go:431","msg":"Slack Import: Unable to import the message as its type is not supported","post_type":"message","post_subtype":"slackbot_response"} {"level":"warn","ts":1581320472.2494154,"caller":"app/slackimport.go:431","msg":"Slack Import: Unable to import the message as its type is not supported","post_type":"message","post_subtype":"slackbot_response"} {"level":"warn","ts":1581320472.3063555,"caller":"app/slackimport.go:431","msg":"Slack Import: Unable to import the message as its type is not supported","post_type":"message","post_subtype":"slackbot_response"} {"level":"warn","ts":1581320472.306397,"caller":"app/slackimport.go:447","msg":"Slack Import: Unable to import file as the file is missing from the Slack export zip file.","file_id":"FT854D3GA"} {"level":"warn","ts":1581320472.3194888,"caller":"app/slackimport.go:447","msg":"Slack Import: Unable to import file as the file is missing from the Slack export zip file.","file_id":"FTAQJ0J3T"} {"level":"warn","ts":1581320472.3288627,"caller":"app/slackimport.go:447","msg":"Slack Import: Unable to import file as the file is missing from the Slack export zip file.","file_id":"FTBB3MGE7"} {"level":"warn","ts":1581320472.7328172,"caller":"app/slackimport.go:447","msg":"Slack Import: Unable to import file as the file is missing from the Slack export zip file.","file_id":"FTJF9A4PP"} {"level":"warn","ts":1581320476.2432775,"caller":"app/slackimport.go:447","msg":"Slack Import: Unable to import file as the file is missing from the Slack export zip file.","file_id":"FT9KXU09H"} {"level":"warn","ts":1581320476.599659,"caller":"app/slackimport.go:447","msg":"Slack Import: Unable to import file as the file is missing from the Slack export zip file.","file_id":"FTJ4ZS6AK"} {"level":"warn","ts":1581320476.602409,"caller":"app/slackimport.go:447","msg":"Slack Import: Unable to import file as the file is missing from the Slack export zip file.","file_id":"FTFRFQ1BN"} {"level":"warn","ts":1581320476.6233969,"caller":"app/slackimport.go:447","msg":"Slack Import: Unable to import file as the file is missing from the Slack export zip file.","file_id":"FTGA653DK"} {"level":"warn","ts":1581320476.6334085,"caller":"app/slackimport.go:447","msg":"Slack Import: Unable to import file as the file is missing from the Slack export zip file.","file_id":"FT65461QR"} {"level":"warn","ts":1581320476.6585047,"caller":"app/slackimport.go:447","msg":"Slack Import: Unable to import file as the file is missing from the Slack export zip file.","file_id":"FT90MHQLB"} {"level":"warn","ts":1581320476.7633593,"caller":"app/slackimport.go:447","msg":"Slack Import: Unable to import file as the file is missing from the Slack export zip file.","file_id":"FTAECE7A5"} {"level":"warn","ts":1581320476.765936,"caller":"app/slackimport.go:447","msg":"Slack Import: Unable to import file as the file is missing from the Slack export zip file.","file_id":"FTLJZUCCQ"} {"level":"warn","ts":1581320476.7987988,"caller":"app/slackimport.go:447","msg":"Slack Import: Unable to import file as the file is missing from the Slack export zip file.","file_id":"FTLMAUEJC"} {"level":"warn","ts":1581320476.8621993,"caller":"app/slackimport.go:447","msg":"Slack Import: Unable to import file as the file is missing from the Slack export zip file.","file_id":"FTLCH04AG"} {"level":"warn","ts":1581320476.867058,"caller":"app/slackimport.go:447","msg":"Slack Import: Unable to import file as the file is missing from the Slack export zip file.","file_id":"FTLSKMT9B"} {"level":"warn","ts":1581320476.9683752,"caller":"app/slackimport.go:447","msg":"Slack Import: Unable to import file as the file is missing from the Slack export zip file.","file_id":"FT5MKNZ19"} {"level":"info","ts":1581320477.0836072,"caller":"app/server.go:346","msg":"Stopping Server..."} {"level":"info","ts":1581320477.0836549,"caller":"app/web_hub.go:125","msg":"stopping websocket hub connections"} {"level":"warn","ts":1581320477.0836644,"caller":"app/web_hub.go:130","msg":"We appear to have already sent the stop checking for deadlocks command"} {"level":"info","ts":1581320477.0842547,"caller":"app/plugin.go:280","msg":"Shutting down plugins"} {"level":"info","ts":1581320477.0869763,"caller":"sqlstore/supplier.go:907","msg":"Closing SqlStore"} {"level":"info","ts":1581320477.0871603,"caller":"app/server.go:384","msg":"Server stopped"}