# Mattermost-server  Plugins issue



## n9010 (Sep 26, 2019)

Hello,

I have installed the port of mattermost-server (5.13), but I am facing an issue when activating installed plugins, it seems like a permission error but the path is correctly owned by the Mattermost user. From the logs i don't really get what is wrong.
Do any of you have faced a similar issue?

Thanks in advance

```
{"level":"error","ts":1569520462.331337,"caller":"mlog/log.go:172","msg":"Unable to activate plugin","plugin_id":"com.mattermost.aws-sns","error":"unable to start plugin: com.mattermost.aws-sns: fork/exec /usr/local/mattermost/plugins/com.mattermost.aws-sns: permission denied","errorVerbose":"fork/exec /usr/local/mattermost/plugins/com.mattermost.aws-sns: permission denied\nunable to start plugin: com.mattermost.aws-sns\ngithub.com/mattermost/mattermost-server/plugin.(*Environment).Activate\n\t/usr/ports/www/mattermost-server/work/mattermost-server-5.13.2/plugin/environment.go:230\ngithub.com/mattermost/mattermost-server/app.(*App).SyncPluginsActiveState\n\t/usr/ports/www/mattermost-server/work/mattermost-server-5.13.2/app/plugin.go:95\ngithub.com/mattermost/mattermost-server/app.(*App).InitPlugins\n\t/usr/ports/www/mattermost-server/work/mattermost-server-5.13.2/app/plugin.go:126\ngithub.com/mattermost/mattermost-server/app.(*Server).RunOldAppInitalization.func6\n\t/usr/ports/www/mattermost-server/work/mattermost-server-5.13.2/app/server_app_adapters.go:147\ngithub.com/mattermost/mattermost-server/config.(*emitter).invokeConfigListeners.func1\n\t/usr/ports/www/mattermost-server/work/mattermost-server-5.13.2/config/emitter.go:35\nsync.(*Map).Range\n\t/usr/local/go/src/sync/map.go:333\ngithub.com/mattermost/mattermost-server/config.(*emitter).invokeConfigListeners\n\t/usr/ports/www/mattermost-server/work/mattermost-server-5.13.2/config/emitter.go:33\ngithub.com/mattermost/mattermost-server/config.(*commonStore).set\n\t/usr/ports/www/mattermost-server/work/mattermost-server-5.13.2/config/common.go:82\ngithub.com/mattermost/mattermost-server/config.(*FileStore).Set\n\t/usr/ports/www/mattermost-server/work/mattermost-server-5.13.2/config/file.go:97\ngithub.com/mattermost/mattermost-server/app.(*Server).UpdateConfig\n\t/usr/ports/www/mattermost-server/work/mattermost-server-5.13.2/app/config.go:53\ngithub.com/mattermost/mattermost-server/app.(*App).UpdateConfig\n\t/usr/ports/www/mattermost-server/work/mattermost-server-5.13.2/app/config.go:59\ngithub.com/mattermost/mattermost-server/app.(*App).EnablePlugin\n\t/usr/ports/www/mattermost-server/work/mattermost-server-5.13.2/app/plugin.go:245\ngithub.com/mattermost/mattermost-server/api4.enablePlugin\n\t/usr/ports/www/mattermost-server/work/mattermost-server-5.13.2/api4/plugin.go:191\ngithub.com/mattermost/mattermost-server/web.Handler.ServeHTTP\n\t/usr/ports/www/mattermost-server/work/mattermost-server-5.13.2/web/handlers.go:144\ngithub.com/NYTimes/gziphandler.GzipHandlerWithOpts.func1.1\n\t/usr/ports/www/mattermost-server/work/mattermost-server-5.13.2/vendor/github.com/NYTimes/gziphandler/gzip.go:336\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2007\ngithub.com/gorilla/mux.(*Router).ServeHTTP\n\t/usr/ports/www/mattermost-server/work/mattermost-server-5.13.2/vendor/github.com/gorilla/mux/mux.go:212\ngithub.com/rs/cors.(*Cors).Handler.func1\n\t/usr/ports/www/mattermost-server/work/mattermost-server-5.13.2/vendor/github.com/rs/cors/cors.go:207\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2007\ngithub.com/mattermost/mattermost-server/app.(*RateLimiter).RateLimitHandler.func1\n\t/usr/ports/www/mattermost-server/work/mattermost-server-5.13.2/app/ratelimit.go:109\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2007\nnet/http.serverHandler.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2802\nnet/http.(*conn).serve\n\t/usr/local/go/src/net/http/server.go:1890\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1357"}
```


----------



## UrsusDominatus (Aug 31, 2021)

Faced same issue. Some digging gives me some results. Mattermost server tries to run plugin precompiled binary from "plugins/com.github.manland.mattermost-plugin-gitlab/server/dist" directory. Plugin executable is selected based on host os and architecture. Only possible choises are: plugin-darwin-amd64 (MacOS), plugin-linux-amd64, plugin-windows-amd64. As we can see there are no FreeBSD variant. I have tried to install linux compatibility layer on my mattermost jail, and this gives me somewhat successful start of linux binary ("server":"executable" parameter, in plugin.json should be set to "server/dist/plugin-linux-amd64" to be picked regardless of OS architecture) but mattermost log shows:

```
"log/log.go:184","msg":"[ERR] plugin: plugin acceptAndServe error: timeout waiting for accept","source":"stdlog"}
```

I can see new process in ps output:

```
24295  -  IJ   0:00,17 plugins/com.github.manland.mattermost-plugin-gitlab/server/dist/plugin-linux-amd64
```

Cannot move any further, because I have zero experience in go programming and mattermost plugin architectures (and tracing and debugging in FreeBSD, unfortunately, too)


----------



## swills@ (Aug 31, 2021)

You need a version of the plugin built for FreeBSD. See:









						support FreeBSD · swills/mattermost-plugin-gitlab@dbb0659
					

GitLab plugin for Mattermost. Contribute to swills/mattermost-plugin-gitlab development by creating an account on GitHub.




					github.com


----------



## kuwa (Nov 9, 2021)

swills@ said:


> You need a version of the plugin built for FreeBSD. See:
> 
> 
> 
> ...



My environment is FreeBSD 13.0-RELEASE-p3.

If I put the freebsd line in plugin.json, it won't build.
If I add the freebsd line to the Makefile and run gmake dist
xxx.tar.gz will be created.


Upload the file to the plugin in this state.
vi /usr/local/www/mattermost/plugins/xxxxxplugin/plugin.json
add "freebsd-amd64": "server/dist/plugin-freebsd-amd64",

You should now be able to start the plugin.


----------

