Downloading Community Plugins via Docker Fails to Generate WebApp Bundle (among other errors)

I deployed our instance to docker via ec2 following the documentation which recommended

sudo chown -R 2000:2000 ./volumes/app/mattermost

However when installing 3rd party plugins this seemed to cause a permissions conflict with local root. I updated the user in the docker container to another local user and gave elevated permissions which got me past the first block however

when installing third party plugins i still run into this error

{
  "caller": "web/context.go:115",
  "err_where": "installExtractedPlugin",
  "error": "installExtractedPlugin: Unable to generate plugin webapp bundle., unable to copy webapp bundle directory: com.github.matterpoll.matterpoll: stat plugins/com.github.matterpoll.matterpoll/webapp/dist: no such file or directory",
  "http_code": 500,
  "ip_addr": "[Irrelevant]",
  "level": "error",
  "method": "POST",
  "msg": "Unable to generate plugin webapp bundle.",
  "path": "/api/v4/plugins",
  "request_id": "[Irrelevant]",
  "timestamp": "2024-04-11 09:22:37.566 Z",
  "user_id": "[Irrelevant]"
}

and errors like this

{
  "caller": "web/context.go:115",
  "err_where": "installExtractedPlugin",
  "error": "installExtractedPlugin: Unable to restart plugin on upgrade., unable to start plugin: com.github.moussetc.mattermost.plugin.giphy: unable to generate plugin checksum: open plugins/com.github.moussetc.mattermost.plugin.giphy/server/dist/plugin-linux-amd64: no such file or directory",
  "http_code": 500,
  "ip_addr": "[Irrelevant]",
  "level": "error",
  "method": "POST",
  "msg": "Unable to restart plugin on upgrade.",
  "path": "/api/v4/plugins",
  "request_id": "[Irrelevant]",
  "timestamp": "2024-04-11 09:10:58.401 Z",
  "user_id": "[Irrelevant]"
}

I’m wondering if this is still somehow a permissions issue, but I’ve been working at this for several hours now and I’m at a loss. Given that both docker and most plugins seem to be community driven the documentation is spotty and filled with inaccuracies.

If anyone has ran into this issue or a similar one I’d welcome any input you have.

I’m going to do the rare thing in software engineering, and post the fix to my own problem. :joy:

The solution:
After you solve any permission errors you need to update your mattermost config file and your nginx config file (if you are using nginx) to accept larger payloads, then make sure on the third party plugin you are downloading the full plugin and not the smaller compressed files.


This is what clued me in

Checking out the MaxFileSize link got me here

So I changed my config.json (to a level thats probably overkill)

 "FileSettings": {
        //...
        "MaxFileSize": 10485760000,
       //...
}

And my default.conf in the nginx directory, in two places

 location ~ /api/v[0-9]+/(users/)?websocket$ {
        //...
        client_max_body_size 100M;
        //...
    }

    location / {
        client_max_body_size 100M;
       //...
}

Installing

Go to the marketplace webpage for your plugin and click download

It will take you to a repository, click the releases link on the right

The link you want is likely the largest one on the list

then upload it in System Console > Plugins

Hope this post helps someone else out there