Slack import fails because attachment was not found

Slack import fails because attachment was not found

Steps to reproduce

  • Install Mattermost with Docker using → http s:// (have to split it because new users can only post 2 links here)
  • Create team ‘testtest’ with mmctl
  • Copy ‘’ (since you can’t upload files here, see screenshots and code at the bottom) into mattermost/data/import
  • mmctl import process
  • 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": "",
      "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 that can be found on GitHub issues. ‘’ 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:


{"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:

Hi felix and welcome to the Mattermost forums!

The import instructions have been modified recently to reflect the necessity for the subfolder, please see this link.

It’s necessary that the “data” folder is directly in the root of the ZIP file, not sure if your screenshot confirms that fact, looks like an OSX screenshot and I’m not sure if I interpret it correctly.

Can you run zipinfo to verify that?

The error message “We could not count the users” is misleading and will be fixed in one of the next versions. The default error message is not handled properly unfortunately.

1 Like

Thanks for the fast response!

The data folder in fact was not in the root. I zipped a folder named ‘mattermost-bulk-import-test.minimal’ that contained the data folder and the jsonl file.

Now it works. Thanks a lot! :slightly_smiling_face:

Awesome, glad to hear it’s working now for you :slight_smile: