Mattermost Peer-to-Peer Forum

[Solved] Sample plugin problem


#1

Please help me solve the problem.

Summary

When I adding mattermost-plugin-sample I getting errors on the page /plugins/com.mattermost.sample-plugin is 500 internal server error and in logs:

error	plugin/client_rpc_generated.go:67	RPC call OnConfigurationChange to plugin failed.	{"plugin_id": "com.mattermost.sample-plugin", "error": "unexpected EOF"}

error	plugin/client_rpc_generated.go:67	RPC call OnConfigurationChange to plugin failed.	{"plugin_id": "com.mattermost.sample-plugin", "error": "connection is shut down"}

error	plugin/client_rpc.go:322	Plugin failed to ServeHTTP, RPC call failed	{"plugin_id": "com.mattermost.sample-plugin", "error": "connection is shut down"}

error	plugin/client_rpc.go:295	Plugin failed to ServeHTTP, muxBroker couldn't Accept request body connection	{"plugin_id": "com.mattermost.sample-plugin", "error": "timeout waiting for accept"}

error	plugin/client_rpc.go:274	Plugin failed to ServeHTTP, muxBroker couldn't accept connection	{"plugin_id": "com.mattermost.sample-plugin", "serve_http_stream_id": 2, "error": "timeout waiting for accept"}

Steps to reproduce

Current version is 5.4.0
Enterprise Enabled: false
Current working directory is /opt/mattermost
Debian 9.5

I just cloned the repository and build the plugin on the same virtual machine where the mattermost server is located. Then I downloaded the archive and upload it via System Console.
Virtual machine is located in private subnet behind corporate proxy (if it matters).

Expected behavior

on the page /plugins/com.mattermost.sample-plugin I should be able to see Hello, world!

Observed behavior

on the page /plugins/com.mattermost.sample-plugin I see 500 internal server error


#2

Hi @Basil,

Letting you know that I’ve forwarded this to our team to look at.


#3

The issue may be that the relative path in the Plugins configuration. Can you change the following:

  • Change PluginSettings > Directory to /opt/mattermost/plugins
  • Change PluginSettings > ClientDirectory to /opt/mattermost/client/plugins

Then try uploading a plugin and see if that works.


#4

Thanks for the advice, but in my case it doesn’t help. I changed the paths, but it did not change anything. I still get error.
I tried to use the demo plugin (https://github.com/mattermost/mattermost-plugin-demo) and it works well.
I get an response Hello World! to the request /plugins/com.mattermost.demo-plugin/hello
I can’t understand the reason for this behavior. Now I decided to use the demo plugin as the basis.


#5

Hi @Basil,

Sorry to hear that, not sure why the plugin didn’t work. However, the sample plugin is essentially a stripped down version of the demo plugin. More information on the plugins here: https://developers.mattermost.com/extend/plugins/example-plugins/.


#6

Hey @Basil,

We where able to find and fix the problem. https://github.com/mattermost/mattermost-plugin-sample/issues/17

Thanks for your report! If you like to join the discussion about plugins or have some question, feel free to join the “Developers Toolkit” Channel on https://community.mattermost.com.