# \[Solved\] Sample plugin problem

**URL:** <https://forum.mattermost.com/t/solved-sample-plugin-problem/6054>\
**Category:** Troubleshooting\
**Created:** [October 31, 2018, 4:25am UTC](https://forum.mattermost.com/t/solved-sample-plugin-problem/6054 "2018-10-31T04:25:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Basil](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/basil/32/2465_2.png) [@Basil](https://forum.mattermost.com/u/Basil)\
**Post date:** [October 31, 2018, 4:25am UTC](https://forum.mattermost.com/t/solved-sample-plugin-problem/6054/1 "2018-10-31T04:25:29Z")

</div>

Please help me solve the problem.

#### Summary

When I adding **[mattermost-plugin-sample](https://github.com/mattermost/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`

---

<div class="post-metadata">

**Author:** ![amy.blais](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/amy.blais/32/7481_2.png) [@amy.blais](https://forum.mattermost.com/u/amy.blais)\
**Post date:** [October 31, 2018, 2:37pm UTC](https://forum.mattermost.com/t/solved-sample-plugin-problem/6054/2 "2018-10-31T14:37:39Z")

</div>

Hi @Basil,

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

---

<div class="post-metadata">

**Author:** ![amy.blais](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/amy.blais/32/7481_2.png) [@amy.blais](https://forum.mattermost.com/u/amy.blais)\
**Post date:** [October 31, 2018, 10:34pm UTC](https://forum.mattermost.com/t/solved-sample-plugin-problem/6054/3 "2018-10-31T22:34:36Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Basil](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/basil/32/2465_2.png) [@Basil](https://forum.mattermost.com/u/Basil)\
**Post date:** [November 2, 2018, 3:05am UTC](https://forum.mattermost.com/t/solved-sample-plugin-problem/6054/4 "2018-11-02T03:05:07Z")

</div>

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](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.

---

<div class="post-metadata">

**Author:** ![amy.blais](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/amy.blais/32/7481_2.png) [@amy.blais](https://forum.mattermost.com/u/amy.blais)\
**Post date:** [November 2, 2018, 5:22pm UTC](https://forum.mattermost.com/t/solved-sample-plugin-problem/6054/5 "2018-11-02T17:22:42Z")

</div>

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/](https://developers.mattermost.com/extend/plugins/example-plugins/).

---

<div class="post-metadata">

**Author:** ![Hanzei](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/hanzei/32/2139_2.png) [@Hanzei](https://forum.mattermost.com/u/Hanzei)\
**Post date:** [November 15, 2018, 1:04pm UTC](https://forum.mattermost.com/t/solved-sample-plugin-problem/6054/6 "2018-11-15T13:04:23Z")

</div>

Hey @Basil,

We where able to find and fix the problem. [https://github.com/mattermost/mattermost-plugin-sample/issues/17](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](https://community.mattermost.com).
