Tutorial Server plugin fails to start. -> "err":"unable to start plugin: com.mattermost.server-hello-world: timed out waiting for plugin"

I am following the Hello, World plugin tutorial here: https://developers.mattermost.com/integrate/plugins/components/server/hello-world/.

I have mattermost installed on my local machine by following: Redirect

Here is my mattermost and db version:

Mattermost Version: 5.1.0
Database Schema Version: 5.1.0
Database: mysql

Here is my docker installation’s OS and arch.

root@4bdee6a90b82:/mm/mattermost/plugins# uname -a
Linux 4bdee6a90b82 4.9.87-linuxkit-aufs #1 SMP Wed Mar 14 15:12:16 UTC 2018 x86_64 GNU/Linux

These are the tutorial steps I followed for building the executable plugin:

➜  my-plugin$ GOOS=linux GOARCH=amd64 go build -o plugin plugin.go
➜  my-plugin$ ls
plugin        plugin.go     plugin.yaml
➜  my-plugin$ file plugin
plugin: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, with debug_info, not stripped
➜  my-plugin$ cat plugin.yaml
id: com.mattermost.server-hello-world
name: Server "Hello, world!"
backend:
    executable: plugin

I uploaded the plugin on http://localhost:8065/admin_console/plugins/management.
I clicked Activate, which shows This plugin is starting.
After a while, it shows This plugin failed to start. Check your system logs for errors.
The logs show this:

{"level":"error","ts":1533035791.792267,"caller":"app/plugin.go:158","msg":"Plugin failed to activate","plugin_id":"com.mattermost.server-hello-world","err":"unable to start plugin: com.mattermost.server-hello-world: timed out waiting for plugin"}

How do I debug this?

Some headway that I was able to make:

I downloaded a certain “meme” plugin from GitHub - mattermost/mattermost-plugin-memes: Add culture to your Mattermost with memes 🔌. That works.

So I checked both the plugin executables:

root@4bdee6a90b82:/mm/mattermost/plugins# file memes/plugin.exe
memes/plugin.exe: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, not stripped

root@4bdee6a90b82:/mm/mattermost/plugins# file com.mattermost.server-hello-world/plugin
com.mattermost.server-hello-world/plugin: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not stripped

Could this difference be the cause? If yes, what options do I need to pass in order to the same executable as with the meme plugin.exe?

Thanks in advance for your help!

Could you try to change “backend” in .yaml file to be “server”?

1 Like

@karim Oh wow! Thanks so much! That actually fixed it.

Could you tell me why that was relevant?

Also, on the same note, the tutorial suggests:

Once you’ve installed the plugin in one of the ways above, browse to https://<your-mattermost-server>/plugins/com.mattermost.server-hello-world, and you’ll be greeted by your plugin.

However, when I visit http://localhost:8065/plugins/com.mattermost.server-hello-world, I get a 404 page not found. Would you know why that is?

Thanks a ton again. :slight_smile:

1 Like

You are welcome bro :slight_smile:
i am new to mattermost as well :smiley:
https://developers.mattermost.com/extend/plugins/manifest-reference/
in the previous link you will find all the properties that you can use in config file
but, i noticed the following statement in “backend” section:
“Backend is a deprecated flag for defining the server-side portion of your plugin. Going forward, use Server instead.” :slight_smile:

Now, i have the same problem that you have (404 not found) and till now i don’t know why that is happening!

Ah ha.

Hmm… Maybe the “404 not found” is because the server is looking for the plugin on a certain path on the filesystem and it can’t find it? Dunno, let me do some exploration and will report back if I find anything.

And again, thanks for the mainfest-reference explanation as well.

1 Like

The solution is on another thread: Custom Plugin not found after upload/activation