Summary
Slack import fails because attachment was not found
Steps to reproduce
- Install Mattermost with Docker using → http s://mattermost.com/deploy/ (have to split it because new users can only post 2 links here)
- Create team ‘testtest’ with mmctl
- Copy ‘mattermost-bulk-import-test.minimal.zip’ (since you can’t upload files here, see screenshots and code at the bottom) into mattermost/data/import
- mmctl import process mattermost-bulk-import-test.minimal.zip
- mmctl import job show $jobid --json → results in error:
"data": {
"error": "We could not count the users. — BulkImport: Error while processing bulk import attachments., attachment \"data/bulk-export-attachments/aa.pdf\" not found in map",
"import_file": "mattermost-bulk-import-test.minimal.zip",
"line_number": "4"
}
Server log shows:
"error","msg":"SimpleWorker: Failed to get active user count","caller":"jobs/base_workers.go:83","worker":"ImportProcess","job_id":"pwwapx4i9fde5ezs1iidwa5yha","error":"BulkImport: Error while processing bulk import attachments., attachment \"data/bulk-export-attachments/aa.pdf\" not found in map"
With this setup im using mmctl v7.1.2 and mattermost 7.1.3. But i also tried it on a system with mmctl v7.0.1 and mattermost 7.0.0.
Expected behavior
Import should succeed.
Observed behavior
The import data i created is almost identical to mattermost-bulk-import.workaround.zip that can be found on GitHub issues. ‘mattermost-bulk-import.workaround.zip’ does work for me. However, i have to copy it to the import folder everytime before i reimport it, otherwise i will get the same error. With the import data i have created it fails. I noticed that in the above mentioned GitHub issue the user got a slightly different error message. Mine has ‘We could not count the users.’ appended at the front.
What is the problem with my import data? I can not see any problem with it.
Since you can’t upload files here, here are a screenshots and code:
mattermost_import.jsonl
{"type":"version","version":1}
{"type":"channel","channel":{"team":"testtest","name":"general","display_name":"new-general","type":"O","header":"","purpose":""}}
{"type":"user","user":{"username":"test","email":"test.test@test","auth_service":null,"nickname":"","first_name":"test","last_name":"test","position":"","roles":"system_user","locale":null,"teams":[{"name":"testtest","roles":"team_user","channels":[{"name":"general","roles":"channel_user"}]}]}}
{"type":"post","post":{"team":"testtest","channel":"general","user":"test","message":"This is a test","props":null,"create_at":1618903303001,"replies":[],"attachments":[{"path":"bulk-export-attachments/aa.pdf"}]}}
Screeshot of file structure: