Import from Slack: AppErrorFromJSON: model.utils.decode_json.app_error

Summary
Can’t load bulk import to slack

Versions
MM server: 7.5.1 Teams Plan (official docker)
MMCTL: v7.5.0

Steps to reproduce
Follow manual, up to loading via command:
./mmctl import upload ./mattermost-bulk-import.zip

Expected behavior
Bulk import loaded
Describe your issue in detail

Observed behavior

/mmctl import upload ./mattermost-bulk-import.zip

Error: failed to upload data: AppErrorFromJSON: model.utils.decode_json.app_error, body: <html>

<head><title>500 Internal Server Error</title></head>

<body>

<center><h1>500 Internal Server Error</h1></center>

<hr><center>nginx/1.23.2</center>

</body>

</html>

Additional
No errors in server console
No seen volume usage increasing on server
Observed data transfer via system monitor and it approximately matches file size
File size 3.09 Gb
Both nginx and MM set to accept large files (it was previous - solved error)

I also posted it here - Failed to upload data: AppErrorFromJSON: model.utils.decode_json.app_error · Issue #617 · mattermost/mmctl · GitHub

Hi egolfeld and welcome to the Mattermost forums!

Can you check your nginx error logs to see what the 500 error is all about? If your nginx is also running inside a container, you can check the logs like this:

First of all, list your running containers and find the ID of your nginx container (896cef1970c2 in my case):

root@host# docker ps
CONTAINER ID   IMAGE                                          COMMAND                  CREATED              STATUS                        PORTS                                                                      NAMES
896cef1970c2   nginx:alpine                                   "/docker-entrypoint.…"   About a minute ago   Up About a minute             0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp   nginx_mattermost
6b62e01f9967   mattermost/mattermost-enterprise-edition:7.4   "/entrypoint.sh matt…"   About a minute ago   Up About a minute (healthy)   8065/tcp, 8067/tcp, 8074-8075/tcp                                          mm-740-mattermost-1
a2b45795f33d   postgres:13-alpine                             "docker-entrypoint.s…"   About a minute ago   Up About a minute             5432/tcp                                                                   mm-740-postgres-1

Then list all available logfiles in your nginx container:

root@host# docker exec -ti 896cef1970c2 ls /var/log/nginx/
access.log     error.log      mm.access.log  mm.error.log

To check the logfiles, you can use the tail or cat commands:

root@host# docker exec -ti 896cef1970c2 cat /var/log/nginx/mm.error.log
root@host# docker exec -ti 896cef1970c2 cat /var/log/nginx/error.log
2022/11/26 11:28:18 [notice] 1#1: using the "epoll" event method
2022/11/26 11:28:18 [notice] 1#1: nginx/1.21.6
2022/11/26 11:28:18 [notice] 1#1: built by gcc 10.3.1 20211027 (Alpine 10.3.1_git20211027)
2022/11/26 11:28:18 [notice] 1#1: OS: Linux 5.10.0-17-amd64
2022/11/26 11:28:18 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2022/11/26 11:28:18 [notice] 1#1: start worker processes
2022/11/26 11:28:18 [notice] 1#1: start worker process 23
2022/11/26 11:28:18 [notice] 1#1: start worker process 24
2022/11/26 11:28:18 [notice] 1#1: start cache manager process 25
2022/11/26 11:28:18 [notice] 1#1: start cache loader process 26
2022/11/26 11:29:19 [notice] 26#26: http file cache: /var/cache/nginx 0.000M, bsize: 4096
2022/11/26 11:29:19 [notice] 1#1: signal 17 (SIGCHLD) received from 26
2022/11/26 11:29:19 [notice] 1#1: cache loader process 26 exited with code 0
2022/11/26 11:29:19 [notice] 1#1: signal 29 (SIGIO) received
[...]

@agriesser

Thanks for reply

found this;

2022/11/26 16:49:07 [crit] 21#21: *154 pwrite() "/var/cache/nginx/client_temp/0000000001" failed (28: No space left on device), client: 172.68.238.46, server: _, request: "POST /api/v4/uploads/fity75duu3n3pycacprraf3gga HTTP/2.0",

I assume it’s because it’s trying to cache into the memory via tempfs

but i failed to fix it - even if I made mounted volume - i feel it still swap to RAM

I also tried to set ```
client_body_buffer_size

I think this might be caused by the cache directories not being writable inside your container.
Do you use docker compose or the legacy docker instructions?

Docker compose, this one docker/docker-compose.nginx.yml at main · mattermost/docker · GitHub