# \[SOLVED\] Sample plugin unable to activate

**URL:** <https://forum.mattermost.com/t/solved-sample-plugin-unable-to-activate/6566>\
**Category:** Troubleshooting\
**Created:** [January 24, 2019, 3:44pm UTC](https://forum.mattermost.com/t/solved-sample-plugin-unable-to-activate/6566 "2019-01-24T15:44:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anubhav](https://avatars.discourse-cdn.com/v4/letter/a/5e9695/32.png) [@anubhav](https://forum.mattermost.com/u/anubhav)\
**Post date:** [January 24, 2019, 3:44pm UTC](https://forum.mattermost.com/t/solved-sample-plugin-unable-to-activate/6566/1 "2019-01-24T15:44:21Z")

</div>

#### Summary

I am unable to activate the sample hello-world plugin on Mattermost

#### Steps to reproduce

Using Mattermost version 5.7 with docker on macOS. Installed using instructions at [https://docs.mattermost.com/install/docker-local-machine.html](https://docs.mattermost.com/install/docker-local-machine.html).  
I made the sample hello world plugin using the instructions at [https://developers.mattermost.com/extend/plugins/server/hello-world/](https://developers.mattermost.com/extend/plugins/server/hello-world/)

#### Observed behavior

The plugin uploaded successfully but failed to enable with the message  
`This plugin failed to start. Check your system logs for errors.`  
System log:  
`{"level":"error","ts":1548344582.903604,"caller":"app/plugin.go:97","msg":"Unable to activate plugin","plugin_id":"com.mattermost.server-hello-world","error":"unable to start plugin: com.mattermost.server-hello-world: fork/exec plugins/com.mattermost.server-hello-world/plugin.exe: exec format error","errorVerbose":"fork/exec plugins/com.mattermost.server-hello-world/plugin.exe: exec format error\nunable to start plugin: com.mattermost.server-hello-world\ngithub.com/mattermost/mattermost-server/plugin.(*Environment).Activate\n\t/home/ubuntu/jenkins/workspace/msr/mattermost-platform-release/src/github.com/mattermost/mattermost-server/plugin/environment.go:221\ngithub.com/mattermost/mattermost-server/app.(*App).SyncPluginsActiveState\n\t/home/ubuntu/jenkins/workspace/msr/mattermost-platform-release/src/github.com/mattermost/mattermost-server/app/plugin.go:95\ngithub.com/mattermost/mattermost-server/app.(*App).InitPlugins.func2\n\t/home/ubuntu/jenkins/workspace/msr/mattermost-platform-release/src/github.com/mattermost/mattermost-server/app/plugin.go:172\ngithub.com/mattermost/mattermost-server/app.(*App).InvokeConfigListeners\n\t/home/ubuntu/jenkins/workspace/msr/mattermost-platform-release/src/github.com/mattermost/mattermost-server/app/config.go:136\ngithub.com/mattermost/mattermost-server/app.(*App).UpdateConfig\n\t/home/ubuntu/jenkins/workspace/msr/mattermost-platform-release/src/github.com/mattermost/mattermost-server/app/config.go:50\ngithub.com/mattermost/mattermost-server/app.(*App).EnablePlugin\n\t/home/ubuntu/jenkins/workspace/msr/mattermost-platform-release/src/github.com/mattermost/mattermost-server/app/plugin.go:245\ngithub.com/mattermost/mattermost-server/api4.enablePlugin\n\t/home/ubuntu/jenkins/workspace/msr/mattermost-platform-release/src/github.com/mattermost/mattermost-server/api4/plugin.go:183\ngithub.com/mattermost/mattermost-server/web.Handler.ServeHTTP\n\t/home/ubuntu/jenkins/workspace/msr/mattermost-platform-release/src/github.com/mattermost/mattermost-server/web/handlers.go:135\ngithub.com/mattermost/mattermost-server/web.(*Handler).ServeHTTP\n\t<autogenerated>:1\ngithub.com/mattermost/mattermost-server/vendor/github.com/gorilla/mux.(*Router).ServeHTTP\n\t/home/ubuntu/jenkins/workspace/msr/mattermost-platform-release/src/github.com/mattermost/mattermost-server/vendor/github.com/gorilla/mux/mux.go:162\ngithub.com/mattermost/mattermost-server/vendor/github.com/gorilla/handlers.recoveryHandler.ServeHTTP\n\t/home/ubuntu/jenkins/workspace/msr/mattermost-platform-release/src/github.com/mattermost/mattermost-server/vendor/github.com/gorilla/handlers/recovery.go:78\ngithub.com/mattermost/mattermost-server/vendor/github.com/gorilla/handlers.(*recoveryHandler).ServeHTTP\n\t<autogenerated>:1\nnet/http.serverHandler.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2741\nnet/http.(*conn).serve\n\t/usr/local/go/src/net/http/server.go:1847\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1333"}`

Has anybody else faced this issue before?

---

<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:** [January 24, 2019, 6:27pm UTC](https://forum.mattermost.com/t/solved-sample-plugin-unable-to-activate/6566/2 "2019-01-24T18:27:02Z")

</div>

Hey @anubhav

Did you use `GOOS=darwin GOARCH=amd64 go build -o plugin.exe plugin.go` to build the plugin?

---

<div class="post-metadata">

**Author:** ![anubhav](https://avatars.discourse-cdn.com/v4/letter/a/5e9695/32.png) [@anubhav](https://forum.mattermost.com/u/anubhav)\
**Post date:** [January 24, 2019, 8:12pm UTC](https://forum.mattermost.com/t/solved-sample-plugin-unable-to-activate/6566/3 "2019-01-24T20:12:11Z")

</div>

Hi @Hanzei,

Tried this now. Still got a ‘failed to start’ message with the following log entry:  
`{"level":"error","ts":1548360499.840271,"caller":"app/plugin.go:97","msg":"Unable to activate plugin","plugin_id":"com.mattermost.server-hello-world","error":"unable to start plugin: com.mattermost.server-hello-world: fork/exec plugins/com.mattermost.server-hello-world/plugin.exe: exec format error","errorVerbose":"fork/exec plugins/com.mattermost.server-hello-world/plugin.exe: exec format error\nunable to start plugin: com.mattermost.server-hello-world\ngithub.com/mattermost/mattermost-server/plugin.(*Environment).Activate\n\t/home/ubuntu/jenkins/workspace/msr/mattermost-platform-release/src/github.com/mattermost/mattermost-server/plugin/environment.go:221\ngithub.com/mattermost/mattermost-server/app.(*App).SyncPluginsActiveState\n\t/home/ubuntu/jenkins/workspace/msr/mattermost-platform-release/src/github.com/mattermost/mattermost-server/app/plugin.go:95\ngithub.com/mattermost/mattermost-server/app.(*App).InitPlugins.func2\n\t/home/ubuntu/jenkins/workspace/msr/mattermost-platform-release/src/github.com/mattermost/mattermost-server/app/plugin.go:172\ngithub.com/mattermost/mattermost-server/app.(*App).InvokeConfigListeners\n\t/home/ubuntu/jenkins/workspace/msr/mattermost-platform-release/src/github.com/mattermost/mattermost-server/app/config.go:136\ngithub.com/mattermost/mattermost-server/app.(*App).UpdateConfig\n\t/home/ubuntu/jenkins/workspace/msr/mattermost-platform-release/src/github.com/mattermost/mattermost-server/app/config.go:50\ngithub.com/mattermost/mattermost-server/app.(*App).EnablePlugin\n\t/home/ubuntu/jenkins/workspace/msr/mattermost-platform-release/src/github.com/mattermost/mattermost-server/app/plugin.go:245\ngithub.com/mattermost/mattermost-server/api4.enablePlugin\n\t/home/ubuntu/jenkins/workspace/msr/mattermost-platform-release/src/github.com/mattermost/mattermost-server/api4/plugin.go:183\ngithub.com/mattermost/mattermost-server/web.Handler.ServeHTTP\n\t/home/ubuntu/jenkins/workspace/msr/mattermost-platform-release/src/github.com/mattermost/mattermost-server/web/handlers.go:135\ngithub.com/mattermost/mattermost-server/web.(*Handler).ServeHTTP\n\t<autogenerated>:1\ngithub.com/mattermost/mattermost-server/vendor/github.com/gorilla/mux.(*Router).ServeHTTP\n\t/home/ubuntu/jenkins/workspace/msr/mattermost-platform-release/src/github.com/mattermost/mattermost-server/vendor/github.com/gorilla/mux/mux.go:162\ngithub.com/mattermost/mattermost-server/vendor/github.com/gorilla/handlers.recoveryHandler.ServeHTTP\n\t/home/ubuntu/jenkins/workspace/msr/mattermost-platform-release/src/github.com/mattermost/mattermost-server/vendor/github.com/gorilla/handlers/recovery.go:78\ngithub.com/mattermost/mattermost-server/vendor/github.com/gorilla/handlers.(*recoveryHandler).ServeHTTP\n\t<autogenerated>:1\nnet/http.serverHandler.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2741\nnet/http.(*conn).serve\n\t/usr/local/go/src/net/http/server.go:1847\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1333"}`

---

<div class="post-metadata">

**Author:** ![anubhav](https://avatars.discourse-cdn.com/v4/letter/a/5e9695/32.png) [@anubhav](https://forum.mattermost.com/u/anubhav)\
**Post date:** [January 25, 2019, 6:33am UTC](https://forum.mattermost.com/t/solved-sample-plugin-unable-to-activate/6566/4 "2019-01-25T06:33:25Z")

</div>

Solved it.  
I used this command for compiling:  
`GOOS=linux GOARCH=amd64 go build -o plugin.exe plugin.go`

Works perfectly. Thanks a lot for your help

---

<div class="post-metadata">

**Author:** ![TerakoyaAcademia](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/terakoyaacademia/32/5094_2.png) [@TerakoyaAcademia](https://forum.mattermost.com/u/TerakoyaAcademia)\
**Post date:** [October 19, 2021, 8:56am UTC](https://forum.mattermost.com/t/solved-sample-plugin-unable-to-activate/6566/5 "2021-10-19T08:56:52Z")

</div>

I am trying to install and getting same error. I am using [GitHub - mattermost/mattermost-docker at release-5.33](https://github.com/mattermost/mattermost-docker/tree/release-5.33) this to deploy mattermost. The errors can be found in [Cannot install Plugin on Mattermost](https://forum.mattermost.com/t/cannot-install-plugin-on-mattermost/12355) .  
Can you please have a look into it?
