mattermost / mattermost

Mattermost is an open source platform for secure collaboration across the entire software development lifecycle..
https://mattermost.com
Other
30.65k stars 7.34k forks source link

Installing Plugin fails (Marketplace and upload via SystemConsole) #20528

Closed LukasFiniarel closed 2 years ago

LukasFiniarel commented 2 years ago

Hello,

I just wanted to install a plugin (Playbook) from the Marketplace. After I clicked on install I get the error message Internal Server Error. The server log gives the following message in this case {"timestamp": "2022-06-23 09:13:44.542 +02:00", "level": "error", "msg": "Could not find the requested marketplace plugin.", "caller": "web/context. go:105","path":"/api/v4/plugins/marketplace","request_id":"1get5miuofd1zdz9of3js4bbxa","ip_addr":"91.97.229. 94", "user_id": "997pcxkhqpfjtpezwwmxdkaser", "method": "POST", "err_where": "GetMarketplacePlugin", "http_code":500, "err_details": "plugin not found"}

I then tried to upload the plugin as a file via the system console. Here appears the error Received invalid response from the server. In this case, unfortunately, the server log does not give any message at all.

I have also tried to install another plugin to rule out that this is a bug with the plugin. Here I get the same result

In the past I have already installed plugins via both ways. Unfortunately I can not say since when this no longer works.

PS: Yes I know the playbook plugin is included. I tried an update of the plugin and got the error. I thought reinstalling the plugin would fix this problem. Unfortunately, I can no longer install it.

amyblais commented 2 years ago

@LukasFiniarel What Mattermost server version are you on?

LukasFiniarel commented 2 years ago

@LukasFiniarel What Mattermost server version are you on? Mattermost-Version: 7.0.0 Database schema version: 85 Database: mysql

amyblais commented 2 years ago

This sounds to be related to an issue tracking the ability to install pre-packaged plugins that aren't in the marketplace (https://community.mattermost.com/core/pl/8noz8k9ktpbpfdyhnfmby7xr4e). Pinging @lieut-data to comment if I'm wrong.

EDIT: ticket https://mattermost.atlassian.net/browse/MM-45296

LukasFiniarel commented 2 years ago

Other plugins can actually be installed via the Marketplace. Unfortunately, the upload via the system console still does not work. Tested with Icebreaker Plugin

lieut-data commented 2 years ago

I've filed https://mattermost.atlassian.net/browse/MM-45296 to track the underlying breakage with the marketplace, and am listing Playbooks via https://github.com/mattermost/mattermost-marketplace/pull/300 to work around this limitation.

@LukasFiniarel, this should hopefully be resolved in the next few hours. Sorry for the churn!

LukasFiniarel commented 2 years ago

Thanks @lieut-data The installation of the Playbook Plugion via the Marketplace just worked.

Unfortunately, uploading plugins via SystemConsole still does not work. Any suggestions here on how to solve this problem?

lieut-data commented 2 years ago

Awesome to hear about the progress, @LukasFiniarel!

To confirm, do you get the same error when uploading as you did when trying to install from the marketplace?

LukasFiniarel commented 2 years ago

No, as already written in my original post I get an error label with "Received invalid response from the server.". In the server log I get no message at all. Uploading plugins has already worked in previous versions of Mattermost. Since then, no configurations have been changed on the server. I have also tested this with several plugins. None of them worked.

lieut-data commented 2 years ago

No, as already written in my original post I get an error label with "Received invalid response from the server.". In the server log I get no message at all.

Hmm, this is definitely hard to debug without a corresponding server log error. Do you have Nginx or some other proxy in between you and the server? If you SSH onto the box, can you install a plugin via mmctl successfully?

LukasFiniarel commented 2 years ago

No NGINX or similar is used as a proxy. I tried to install a plugin with mmtcl. bin/mmctl plugin add /home/lukas/com.nilsbrinkmann.icebreaker-2.2.2.tar.gz Unfortunately without success. I also tried sudo and changing the ownership of the plugin file. I always get this error message: Error: cannot read user credentials, maybe you need to use login first: stat /root/.config/mmctl/config: no such file or directory Maybe this will help with troubleshooting.

lieut-data commented 2 years ago

Error: cannot read user credentials, maybe you need to use login first: stat /root/.config/mmctl/config: no such file or directory

Thanks, @LukasFiniarel! This error suggests that mmctl is just failing to interact with the server at all, vs. helping us reproduce the inability to install plugins. One way you can avoid these login issues is to enable Local mode -- perhaps try that and reproduce the plugin installation attempt?

LukasFiniarel commented 2 years ago

Ok. I have activated the local mode in config.json and restarted Mattermost. Now when I try to install the plugin bin/mmctl plugin add /home/lukas/com.nilsbrinkmann.icebreaker-2.2.2.tar.gz --local I get the following error message: Error: owner of the file "/var/tmp/mattermost_local.socket" must be the same user running mmctl When I run the command with sudo I get the following error message: Error: AppErrorFromJSON: model.utils.decode_json.app_error, body: http: request body too large

To make sure that it is not the plugin, I also tested the DiceRoller plugin. Here the same error appears.

lieut-data commented 2 years ago

Ah, brilliant! That's the issue we seem to be running into: plugin uploads are constrained by https://docs.mattermost.com/configure/configuration-settings.html#maximum-file-size, and will need to be tuned upwards to allow larger plugin installations. Can you give that a try @LukasFiniarel? What's odd is that this error should have been present in the server logs when uploading plugins through the System Console too.

(As an aside, you may want to consider running mattermost as a non-root user.)

LukasFiniarel commented 2 years ago

Perfect, thank you. This allowed me to install the plugin. I tried again and there is indeed no error message in the server log. Uploading via the system console also works after adjusting the file size. Thank you very much for the help :)

lieut-data commented 2 years ago

Terrific, @LukasFiniarel! I've filed https://mattermost.atlassian.net/browse/MM-45484 to see if we can improve the error handling in this case -- thanks for your patience in tracking it down in the end :)

catalintomai commented 2 years ago

@LukasFiniarel , to make sure we don't have a different problem here, you were mentioning the inability to install other plugins besides playbooks (e.g. Icebreaker, DiceRoller) and hitting the same upload error from the System Console. Were they all of the large size kind - making it that their installation would be constrained by the https://docs.mattermost.com/configure/configuration-settings.html#maximum-file-size limit? Thanks.

LukasFiniarel commented 2 years ago

@catalintomai Yes, the plugins I tried to install were all larger than the file size set in the configuration. After I changed this option (larger than the file size of the plugins) an installation of the plugins worked smoothly via the system console as well as via mmctl.

smileBeda commented 1 year ago

This is so sad. Not a single plugin is 1MB (default) and even increasing the limit to an absurd number like 10 million or so, returns the precise same error. That is, at least, it does not work in the actual MM system console. File storage: 999999999999 (this is just absurd) Upload plugin: 413 Request Entity Too Large the plugin though is merely 61mb: https://mattermost.com/marketplace/openai-plugin/

Apart of it being a total PITA to even get uploads to "work" on MM Omnibus to... it still doesn't work. This is highly disappointing :(