# Import From Slack: Error Uploading Data

**URL:** <https://forum.mattermost.com/t/import-from-slack-error-uploading-data/14032>\
**Category:** Command Line Interface\
**Created:** [September 11, 2022, 2:15pm UTC](https://forum.mattermost.com/t/import-from-slack-error-uploading-data/14032 "2022-09-11T14:15:47Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![anatwick](https://avatars.discourse-cdn.com/v4/letter/a/bbe5ce/32.png) [@anatwick](https://forum.mattermost.com/u/anatwick)\
**Post date:** [September 11, 2022, 2:15pm UTC](https://forum.mattermost.com/t/import-from-slack-error-uploading-data/14032/1 "2022-09-11T14:15:48Z")

</div>

I’ve struggled my way through all of the import steps lol but now i seem to be hitting a brick wall of sorts. when attempting to import the ./mattermost-bulk-import.zip it sits for quite a while and then i get the following:  
Error: failed to upload data: AppErrorFromJSON: model.utils.decode\_json.app\_error, body:

There is nothing more than that shown for the error. I am doing this all from a windows machine with Mattermost installled on a Turnkey Linux VM on an unraid server - Not sure any of this matters just wanted to give my setup in case it was useful.

The “mattermost-bulk-import.zip” file is comprised of: mattermost\_import.jsonl then a subfolder called “data” within data another folder “bulk-export-attachments” and within that folder are all the attachments.

I have updated the maximum file size within my mattermost server itself and the file is 4.6GB I had not updated the NGINX maximum file size as I am not using NGINX integrated with Mattermost but rathern an NGINX Docker - I do not see any settings on the docker whatsoever for maximum file size or anything like that so I’m thinking that NGINX isnt the issue at hand here.

Sorry for the long winded message trying to outline every possible thing so the solution is easier for someone who knows more than I 😃

---

<div class="post-metadata">

**Author:** ![anatwick](https://avatars.discourse-cdn.com/v4/letter/a/bbe5ce/32.png) [@anatwick](https://forum.mattermost.com/u/anatwick)\
**Post date:** [September 11, 2022, 2:35pm UTC](https://forum.mattermost.com/t/import-from-slack-error-uploading-data/14032/2 "2022-09-11T14:35:22Z")

</div>

OK I have tried the file again and it also failed but gave me a bit more information stating: 413 Request Entity Too Large

Looking at this similar post [Bulk import error from Slack](https://forum.mattermost.com/t/bulk-import-error-from-slack/13739)

I attempted to go into mattermost webshell and ran the command (under root user) upon trying to run

```auto
sed -i -e 's/50M/5G/' /etc/nginx/conf.d/mattermost.conf

```

I am left with the response: `sed: can't read /etc/nginx/conf.d/mattermost.conf: No Such file or directory`

I do have the maximum file size set to: 500000000000 under the system console but wondering if it needs to be adjusted elsewhere as well

---

<div class="post-metadata">

**Author:** ![agriesser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/agriesser/32/5644_2.png) [@agriesser](https://forum.mattermost.com/u/agriesser)\
**Post date:** [September 12, 2022, 3:54am UTC](https://forum.mattermost.com/t/import-from-slack-error-uploading-data/14032/3 "2022-09-12T03:54:39Z")

</div>

Hi anatwick and welcome to the Mattermost forums!

The `sed` command only works if you have the nginx config file available. In your case, you said you’re using an nginx container and the `client_max_body_size` parameter needs to be changed in the container’s nginx config.  
What container are you using and how do you start it? Maybe there’s an environment variable or the possibility to add configuration options from “the outside” so that the config gets applied properly.  
If you’re not using the Mattermost-integrated nginx container you most likely also had to create a configuration file for the Mattermost VHOST there - the `server` section in this config file would also be a good location to override the default `client_max_body_size` of the container’s nginx setup.

---

<div class="post-metadata">

**Author:** ![anatwick](https://avatars.discourse-cdn.com/v4/letter/a/bbe5ce/32.png) [@anatwick](https://forum.mattermost.com/u/anatwick)\
**Post date:** [September 12, 2022, 11:28am UTC](https://forum.mattermost.com/t/import-from-slack-error-uploading-data/14032/4 "2022-09-12T11:28:10Z")

</div>

Thank you for the response. Maybe a little more explanation on my setup is warranted here. I am using Unraid and have mattermost installed in a linux VM using TurnkeyLinux Mattermost ISO. From the notes at Turnkey Linux: “**_Includes Nginx (webserver); pre-configured to proxy Mattermost_.**” I guess I am unsure how to access or edit this Nginx webserver that is apparently preconfigured.

What I am doing for NGINX: I have a docker installed on Unraid NginxProxyManager and i simply used that to reverse proxy the IP of the VM rather than trying to figure out how to do it through the included Nginx within the mattermost installation.

My presumption is even though I am not using the preconfigured Nginx Webserver that somehow this is what is limiting my file size.

---

<div class="post-metadata">

**Author:** ![anatwick](https://avatars.discourse-cdn.com/v4/letter/a/bbe5ce/32.png) [@anatwick](https://forum.mattermost.com/u/anatwick)\
**Post date:** [September 12, 2022, 11:40am UTC](https://forum.mattermost.com/t/import-from-slack-error-uploading-data/14032/5 "2022-09-12T11:40:43Z")

</div>

After using Turnkeylinux “webmin” panel and going to file manager i was able to locate in a folder called “etc” an nginx folder. within there i have several files and subfolders. Hoping maybe i can simply edit one of those files.

To further this on the webmin panel when i go to this nginx folder i can “open the current path in terminal” i attempted to do that and simply add the sed command from the other post but no luck

within the nginx folder there is a conf.d folder – however there is no “mattermost.conf” file within that folder.

After looking around online more and browsing the file structure I do have a mattermost.conf file in /etc/nginx/sites-available/mattermost — Based on this i changed my “sed” command to read as follows:

```auto
sed -i -e 's/50M/6G/' /etc/nginx/sites-available/mattermost

```

Then i ran

```auto
systemctl reload nginx

```

When i enter both of these codes in i dont get errors or anything and the code appears to work. I manually checked the mattermost.conf file and it shows “client\_max\_body\_size 6G” so it seems as though my commands didd indeed work. However the file import still fails with the same error.

---

<div class="post-metadata">

**Author:** ![anatwick](https://avatars.discourse-cdn.com/v4/letter/a/bbe5ce/32.png) [@anatwick](https://forum.mattermost.com/u/anatwick)\
**Post date:** [September 12, 2022, 2:52pm UTC](https://forum.mattermost.com/t/import-from-slack-error-uploading-data/14032/6 "2022-09-12T14:52:26Z")

</div>

just thinking out loud here… Wondering if i can manually import the file via the webmin interface. I tested and I am able to upload it – but where exactly to upload it is what i am unsure on

---

<div class="post-metadata">

**Author:** ![agriesser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/agriesser/32/5644_2.png) [@agriesser](https://forum.mattermost.com/u/agriesser)\
**Post date:** [September 13, 2022, 10:49am UTC](https://forum.mattermost.com/t/import-from-slack-error-uploading-data/14032/7 "2022-09-13T10:49:23Z")

</div>

Hi again and sorry for the late reply, I was busy the last days.

Yes, this file sounds correct, although it’s not necessarily the right file and there might be multiple occurences of this configuration option.

Can you please login via SSH to your system and run the following command as root (or via sudo)?  
I’ve also added an example from one of my systems, so that you can see what it looks like.  
On my system, as you can see, the `client_max_body_size` parameter is specified three times, so you would have to change it in all places, if it’s there more than once on your system:

```auto
root@ag-ubuntu0101:~# eval /proc/$(pidof -s nginx)/exe -T | grep client_max_body
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
      client_max_body_size 50M;
      client_max_body_size 50M;
      client_max_body_size 50M;

```

You can upload the file directly to your `import` folder. It’s directly below the `data` folder, which is `/opt/mattermost/data` by default, so you should see a folder called `/opt/mattermost/data/import`. The `mmctl` upload process uploads the file to this directory and it also suffixes it with a job ID, but I think this is not really necessary, so a manual upload should work too.

---

<div class="post-metadata">

**Author:** ![anatwick](https://avatars.discourse-cdn.com/v4/letter/a/bbe5ce/32.png) [@anatwick](https://forum.mattermost.com/u/anatwick)\
**Post date:** [September 13, 2022, 11:41am UTC](https://forum.mattermost.com/t/import-from-slack-error-uploading-data/14032/8 "2022-09-13T11:41:59Z")

</div>

> [@agriesser](#):
>
> `eval /proc/$(pidof -s nginx)/exe -T | grep client_max_body`

here are the results from when i run that command:

```auto
root@mattermost:~# eval /proc/$(pidof -s nginx)/exe -T | grep client_max_body
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
      client_max_body_size 6G;

```

---

<div class="post-metadata">

**Author:** ![anatwick](https://avatars.discourse-cdn.com/v4/letter/a/bbe5ce/32.png) [@anatwick](https://forum.mattermost.com/u/anatwick)\
**Post date:** [September 13, 2022, 11:58am UTC](https://forum.mattermost.com/t/import-from-slack-error-uploading-data/14032/9 "2022-09-13T11:58:16Z")

</div>

in regards to directly uploading the folder: upon entering /opt/mattermost/data there is no import folder. I created an import folder and directly uploaded the file to said folder.

After doing that i ran `mmctl import list available` and to my surprise the file showed up as mattermost-bulk-import.zip

I then ran `mmctl import process mattermost-bulk-import.zip` and te results were `Import porcess job sucessfully created, ID: ggz3gqf1atbrbb7ymgh917r3te`

Then i ran `mmctl import job show ggz3gqf1atbrbb7ymgh917r3te --json` and the results were:

```auto
[
  {
    "id": "ggz3gqf1atbrbb7ymgh917r3te",
	"type": "import_process",
	"priority": 0,
	"create_at": 1663069649437,
	"start_at": 1663069663702,
	"last_activity_at": 1663069663744,
	"status": "error",
	"progress": -1,
	"data": {
	  "error": "We could not count the users. - ImportProcessWorker: Unable to process import: failed to open file., zip: not a valid zip file",
	  "import_file": "mattermost-bulk-import.zip"
	}
  }
]

```

So now its saying the file is not a valid zip file???

---

<div class="post-metadata">

**Author:** ![agriesser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/agriesser/32/5644_2.png) [@agriesser](https://forum.mattermost.com/u/agriesser)\
**Post date:** [September 13, 2022, 12:02pm UTC](https://forum.mattermost.com/t/import-from-slack-error-uploading-data/14032/10 "2022-09-13T12:02:20Z")

</div>

OK, thanks - this confirms that the `client_max_body_size` has been properly set to `6G`, but I think you will also have to increase the maximum file size in the System console, but I’m not 100% sure about that, but it doesn’t hurt to increase this value for testing purposes:

[https://docs.mattermost.com/configure/configuration-settings.html#file-max-size-mb](https://docs.mattermost.com/configure/configuration-settings.html#file-max-size-mb)

With regards to the “invalid ZIP file” message: Can you please post the output of:

```auto
ls -lh /opt/mattermost/data/import/*
file /opt/mattermost/data/import/*
zip -T /opt/mattermost/data/import/*.zip

```

---

<div class="post-metadata">

**Author:** ![anatwick](https://avatars.discourse-cdn.com/v4/letter/a/bbe5ce/32.png) [@anatwick](https://forum.mattermost.com/u/anatwick)\
**Post date:** [September 13, 2022, 3:07pm UTC](https://forum.mattermost.com/t/import-from-slack-error-uploading-data/14032/11 "2022-09-13T15:07:16Z")

</div>

```auto
ls -lh /opt/mattermost/data/import/*
-rw-r--r-- 1 mattermost mattermost 4.5G Sept 12 15:08 /opt/mattermost/data/import/mattermost-bulk-import.zip

```

```auto
file /opt/mattermost/data/import/*
/opt/mattermost/data/import/mattermost-bulk-import.zip: Zip archive data, at least v2.0 to extract

```

```auto
zip -T /opt/mattermost/data/import/*.zip
 -bash: zip: command not found

```

---

<div class="post-metadata">

**Author:** ![agriesser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/agriesser/32/5644_2.png) [@agriesser](https://forum.mattermost.com/u/agriesser)\
**Post date:** [September 13, 2022, 3:19pm UTC](https://forum.mattermost.com/t/import-from-slack-error-uploading-data/14032/12 "2022-09-13T15:19:42Z")

</div>

Seems you’re missing the zip command and maybe that’s the reason why it’s failing.  
Please run:

```auto
apt install zip unzip

```

and try the last command again, then.  
And if that worked, try to run the `mmctl import process` command again.

---

<div class="post-metadata">

**Author:** ![anatwick](https://avatars.discourse-cdn.com/v4/letter/a/bbe5ce/32.png) [@anatwick](https://forum.mattermost.com/u/anatwick)\
**Post date:** [September 14, 2022, 1:40am UTC](https://forum.mattermost.com/t/import-from-slack-error-uploading-data/14032/13 "2022-09-14T01:40:26Z")

</div>

that did work but i still cannot do the mmctl import process…

When i run mmctl import job show i get back the following error:  
We could not count the users. - ImportProcessWorker: Unable to process import: failed to open file., zip: not a valid zip file

This is on the manually uploaded file through the UI. I still cannot upload via mmctl i get the error that it is too large.

---

<div class="post-metadata">

**Author:** ![anatwick](https://avatars.discourse-cdn.com/v4/letter/a/bbe5ce/32.png) [@anatwick](https://forum.mattermost.com/u/anatwick)\
**Post date:** [September 14, 2022, 12:11pm UTC](https://forum.mattermost.com/t/import-from-slack-error-uploading-data/14032/14 "2022-09-14T12:11:10Z")

</div>

I hope i can get this working and really appreciate your help! As soon as i can get this done i plan to move entirely from slack but cant until i get historical info in there.

Thanks!

---

<div class="post-metadata">

**Author:** ![agriesser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/agriesser/32/5644_2.png) [@agriesser](https://forum.mattermost.com/u/agriesser)\
**Post date:** [September 15, 2022, 6:36am UTC](https://forum.mattermost.com/t/import-from-slack-error-uploading-data/14032/15 "2022-09-15T06:36:16Z")

</div>

@anatwick can you please run this command again now that `zip` is installed?

```auto
zip -T /opt/mattermost/data/import/*.zip

```

/cc: @plusmid any ideas?

---

<div class="post-metadata">

**Author:** ![plusmid](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/plusmid/32/5590_2.png) [@plusmid](https://forum.mattermost.com/u/plusmid)\
**Post date:** [September 15, 2022, 10:14am UTC](https://forum.mattermost.com/t/import-from-slack-error-uploading-data/14032/16 "2022-09-15T10:14:21Z")

</div>

Thanks for the ping @agriesser

Can you verify that the `.zip` in `opt/mattermost/data/import/` is the same size as the one you’ve uploaded? If the file was somehow truncated during the upload, it will be invalid. The next version of `mmctl` will contain an import validator, which should catch those problems earlier.

---

<div class="post-metadata">

**Author:** ![anatwick](https://avatars.discourse-cdn.com/v4/letter/a/bbe5ce/32.png) [@anatwick](https://forum.mattermost.com/u/anatwick)\
**Post date:** [September 15, 2022, 4:01pm UTC](https://forum.mattermost.com/t/import-from-slack-error-uploading-data/14032/17 "2022-09-15T16:01:11Z")

</div>

> [@agriesser](#):
>
> `zip -T /opt/mattermost/data/import/*.zip`

When i run this command i get could not find:  
`/opt/mattermost/data/import/mattermost-bulk-import.z01`

If i go and MMCTL and hit import list available i do see:  
`mattermost-bulk-import.zip`

If I attempt to run mmctl import job show ID --json i get unable to process import: failed to open file., zip: not a valid zip file"

And this is still on the manually uploaded (through webmin) file - If i try and upload via mmctl import it errors out with the same error listed above that it is too large.

I did double check the file size and it is perfect. I dont think the next version of mmctl will solve this issue as I’m not able to use the import command to import the file for some reason and i have to manually upload the file via the webmin console of my turnkey linux mattermost VM

---

<div class="post-metadata">

**Author:** ![anatwick](https://avatars.discourse-cdn.com/v4/letter/a/bbe5ce/32.png) [@anatwick](https://forum.mattermost.com/u/anatwick)\
**Post date:** [September 15, 2022, 4:03pm UTC](https://forum.mattermost.com/t/import-from-slack-error-uploading-data/14032/18 "2022-09-15T16:03:28Z")

</div>

![image](https://us1.discourse-cdn.com/flex020/uploads/mattermost/original/2X/0/0cd3158e5e88c6a029a80f1ea94fd02a0455fba4.png)

---

<div class="post-metadata">

**Author:** ![agriesser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/agriesser/32/5644_2.png) [@agriesser](https://forum.mattermost.com/u/agriesser)\
**Post date:** [September 15, 2022, 4:37pm UTC](https://forum.mattermost.com/t/import-from-slack-error-uploading-data/14032/19 "2022-09-15T16:37:06Z")

</div>

That’s interesting - it thinks you have a splitfile.  
Something is definitely wrong with this file, but maybe it’s a problem with the wildcard, so one more try, without the wildcard, please:

```auto
zip -T /opt/mattermost/data/import/mattermost-bulk-import.zip

```

If this also asks you for a `.z01` file, then we might have a problem here.  
Can you try to unzip the file on the Mattermost server then (just for testing purposes)?

```auto
cd /opt/mattermost/data/import
unzip mattemorst-bulk-import.zip

```

does that work?

---

<div class="post-metadata">

**Author:** ![plusmid](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/plusmid/32/5590_2.png) [@plusmid](https://forum.mattermost.com/u/plusmid)\
**Post date:** [September 15, 2022, 5:09pm UTC](https://forum.mattermost.com/t/import-from-slack-error-uploading-data/14032/20 "2022-09-15T17:09:23Z")

</div>

These split archives are created when the `-s <size>` parameter is used on creation. They need to be reassembled before being processed by the server.

[Next page](https://forum.mattermost.com/t/import-from-slack-error-uploading-data/14032.md?page=2)
