Custom plugin failed to start

I have success upload my plugin to mattermost server(version 5.9.6,Installed on ubuntu16.04).And It shows a error message after I click upload,which goes like :This plugin failed to start. Check your system logs for errors.
the server log error is:
{“level”:“error”,“ts”:1576483016.174209,“caller”:“app/plugin.go:97”,“msg”:“Unable to activate plugin”,“plugin_id”:“mymattermostplugin”,“error”:“unable to start plugin: mymattermostplugin: fork/exec plugins/mymattermostplugin/plugin: permission denied”,“errorVerbose”:“fork/exec plugins/mymattermostplugin/plugin: permission denied\nunable to start plugin: mymattermostplugin\ngithub.com/mattermost/mattermost-server/plugin.(*Environment).Activate\n\t/go/src/github.com/mattermost/mattermost-server/plugin/environment.go:216\ngithub.com/mattermost/mattermost-server/app.(*App).SyncPluginsActiveState\n\t/go/src/github.com/mattermost/mattermost-server/app/plugin.go:95\ngithub.com/mattermost/mattermost-server/app.(*App).InitPlugins\n\t/go/src/github.com/mattermost/mattermost-server/app/plugin.go:126\ngithub.com/mattermost/mattermost-server/app.(*Server).RunOldAppInitalization.func6\n\t/go/src/github.com/mattermost/mattermost-server/app/server_app_adapters.go:143\ngithub.com/mattermost/mattermost-server/app.(*Server).InvokeConfigListeners\n\t/go/src/github.com/mattermost/mattermost-server/app/config.go:169\ngithub.com/mattermost/mattermost-server/app.(*Server).UpdateConfig\n\t/go/src/github.com/mattermost/mattermost-server/app/config.go:58\ngithub.com/mattermost/mattermost-server/app.(*App).UpdateConfig\n\t/go/src/github.com/mattermost/mattermost-server/app/config.go:62\ngithub.com/mattermost/mattermost-server/app.(*App).EnablePlugin\n\t/go/src/github.com/mattermost/mattermost-server/app/plugin.go:245\ngithub.com/mattermost/mattermost-server/api4.enablePlugin\n\t/go/src/github.com/mattermost/mattermost-server/api4/plugin.go:187\ngithub.com/mattermost/mattermost-server/web.Handler.ServeHTTP\n\t/go/src/github.com/mattermost/mattermost-server/web/handlers.go:151\ngithub.com/mattermost/mattermost-server/web.(*Handler).ServeHTTP\n\t:1\ngithub.com/mattermost/mattermost-server/vendor/github.com/gorilla/mux.(*Router).ServeHTTP\n\t/go/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/go/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: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”}

Can someone help me please.

My plugin code is:

package main
import (
    "fmt"
    "io"
    "net/http"
    "github.com/mattermost/mattermost-server/model"
    "github.com/mattermost/mattermost-server/plugin"
)

type HelloWorldPlugin struct {
    plugin.MattermostPlugin
}
func (P *HelloWorldPlugin) ServerHttp(c *plugin.Context, w http.ResponseWriter, r *http.Request) {
    fmt.Fprint(w, "Hello World!")
}
func (P *HelloWorldPlugin) FileWillBeUploaded(c *plugin.Context, info *model.FileInfo, file io.Reader, output io.Writer) (*model.FileInfo, string) {
    flag1 := info.Extension == "jpg"
    flag2 := info.Extension == "png"
    if flag1 == false && flag2 == false {
        s := "server only receiver jpg or png file"
        return nil, s
    }
    return nil, ""
}
func main() {
    plugin.ClientMain(&HelloWorldPlugin{})
}

my plugin.json is:

{

    "id": "MyMattermostPlugin",

    "name": "FileTest",

    "server": {

        "executable": "plugin"

    }

}

I craft the code in Windows10,And I build it like this:

SET CGO_ENABLED=0
SET GOOS=linux
SET GOARCH=amd64
go build -o plugin

Hi, @xiagao

The error that we are seeing here is related to permission denied when the server tries to activate the plugin:

“level”:“error”,“ts”:1576483016.174209,“caller”:“app/plugin.go:97”,“msg”:“Unable to activate plugin”,“plugin_id”:“mymattermostplugin”,“error”:“unable to start plugin: mymattermostplugin: fork/exec plugins/mymattermostplugin/plugin: permission denied”,“errorVerbose”:“fork/exec plugins/mymattermostplugin/plugin: permission denied\nunable to start plugin: mymattermostplugin

May I know how the permissions look like on your plugins directory? Please run the ls -lAh /opt/mattermost/plugins/ /opt/mattermost/prepackaged_plugins/ and provide the output here. For example, this is how it looks like on my end:

ahmaddanial@mattermost:/home/ubuntu# ls -lAh /opt/mattermost/plugins/ /opt/mattermost/prepackaged_plugins/
/opt/mattermost/plugins/:
total 48K
drwxr--r-- 3 mattermost mattermost 4.0K Nov 27 16:54 antivirus
drwxr--r-- 5 mattermost mattermost 4.0K Nov 27 16:54 com.github.manland.mattermost-plugin-gitlab
drwxr--r-- 3 mattermost mattermost 4.0K Nov 27 16:54 com.mattermost.aws-sns
drwxr--r-- 4 mattermost mattermost 4.0K Nov 27 16:54 com.mattermost.custom-attributes
drwxr--r-- 5 mattermost mattermost 4.0K Nov 27 16:54 com.mattermost.nps
drwxr--r-- 3 mattermost mattermost 4.0K Nov 27 16:54 com.mattermost.welcomebot
drwxr--r-- 5 mattermost mattermost 4.0K Nov 27 16:54 github
drwxr--r-- 4 mattermost mattermost 4.0K Nov 27 16:54 jenkins
drwxr--r-- 5 mattermost mattermost 4.0K Nov 27 16:54 jira
drwxr--r-- 4 mattermost mattermost 4.0K Dec 11 02:42 jitsi
drwxr--r-- 3 mattermost mattermost 4.0K Nov 27 16:54 mattermost-autolink
drwxr--r-- 5 mattermost mattermost 4.0K Nov 27 16:54 zoom

/opt/mattermost/prepackaged_plugins/:
total 99M
-rw-rw-r-- 1 mattermost mattermost 8.6M Nov 25 17:43 mattermost-plugin-antivirus-v0.1.1.tar.gz
-rw-rw-r-- 1 mattermost mattermost 8.6M Nov 25 17:42 mattermost-plugin-autolink-v1.1.1.tar.gz
-rw-rw-r-- 1 mattermost mattermost 8.8M Nov 25 17:43 mattermost-plugin-aws-SNS-v1.0.2.tar.gz
-rw-rw-r-- 1 mattermost mattermost 8.9M Nov 25 17:43 mattermost-plugin-custom-attributes-v1.0.2.tar.gz
-rw-rw-r-- 1 mattermost mattermost 9.7M Nov 25 17:43 mattermost-plugin-github-v0.11.0.tar.gz
-rw-rw-r-- 1 mattermost mattermost 9.4M Nov 25 17:43 mattermost-plugin-gitlab-v1.0.1.tar.gz
-rw-rw-r-- 1 mattermost mattermost 9.0M Nov 25 17:43 mattermost-plugin-jenkins-v1.0.0.tar.gz
-rw-rw-r-- 1 mattermost mattermost 9.7M Nov 25 17:43 mattermost-plugin-jira-v2.2.2.tar.gz
-rw-rw-r-- 1 mattermost mattermost 8.7M Nov 25 17:42 mattermost-plugin-nps-v1.0.3.tar.gz
-rw-rw-r-- 1 mattermost mattermost 8.6M Nov 25 17:43 mattermost-plugin-welcomebot-v1.1.1.tar.gz
-rw-rw-r-- 1 mattermost mattermost 8.8M Nov 25 17:42 mattermost-plugin-zoom-v1.1.2.tar.gz

Thans for your reply.
when I run ls -lAh /opt/mattermost/plugins /opt/mattermost/prepackaged_plugins/,the output is:

/opt/mattermost/plugins:
ls: cannot access '/opt/mattermost/plugins/jira': Permission denied
ls: cannot access '/opt/mattermost/plugins/mymattermostplugin': Permission denied
ls: cannot access '/opt/mattermost/plugins/zoom': Permission denied
total 0
d????????? ? ? ? ?             ? jira
d????????? ? ? ? ?             ? mymattermostplugin
d????????? ? ? ? ?             ? zoom

/opt/mattermost/prepackaged_plugins/:
total 54M
-rw-rw-r-- 1 mattermost mattermost 28M 10月 14 21:18 jira-2.2.2.tar.gz
-rw-rw-r-- 1 mattermost mattermost 26M 10月  3 04:55 zoom-1.1.1.tar.gz

And I try to run sudo ls -lAh /opt/mattermost/plugins /opt/mattermost/prepackaged_plugins/,the output is:

/opt/mattermost/plugins:
total 12K
drwxr--r-- 5 mattermost mattermost 4.0K 12月 17 09:21 jira
drwx------ 2 mattermost mattermost 4.0K 12月 16 15:53 mymattermostplugin
drwxr--r-- 5 mattermost mattermost 4.0K 12月 17 09:21 zoom

/opt/mattermost/prepackaged_plugins/:
total 54M
-rw-rw-r-- 1 mattermost mattermost 28M 10月 14 21:18 jira-2.2.2.tar.gz
-rw-rw-r-- 1 mattermost mattermost 26M 10月  3 04:55 zoom-1.1.1.tar.gz

I run these command in the ubuntu,and the user I login is an admin but isn’t a root user.And when I upload the plugin to the server,because I craft the code in my own windows10,so I directly login mattermost webapp in my windows10 and upload it via mattermost system console.Maybe that’s why I don’t have enough permission?

Hello, @xiagao

Based on the result you shared, we can see the different permission between mymattermostplugin and jira for example:

drwxr--r-- 5 mattermost mattermost 4.0K 12月 17 09:21 jira
drwx------ 2 mattermost mattermost 4.0K 12月 16 15:53 mymattermostplugin

Can you please adjust the permission accordingly and then verify that it is the same as jira and zoom before activating again?

sudo chmod g+r, o+r mymattermostplugin

Eventually, we should have something like this:

drwxr--r-- 5 mattermost mattermost 4.0K 12月 17 09:21 jira
drwxr--r-- 2 mattermost mattermost 4.0K 12月 16 15:53 mymattermostplugin

Please check on the Plugin Uploads Fail Even Though Uploads are Enabled article as well for further troubleshooting.

Thank you very much!! @ahmaddanial
I think my plugin is working after I add some permission to the plugin directory and mymattermostplugin directory and plugin exectuable file.

1 Like

Hi, @xiagao

You are most welcome. Shout out to @jasonblais for the assist as well!

Hey @ahmaddanial, i got the same problem here

{"level":"error","ts":1591627530.545553,
"caller":"mlog/log.go:175",
"msg":"Unable to restart plugin on upgrade.",
"path":"/api/v4/plugins",
"request_id":"tsbajnjz6f85zjjkewbxuu3mzr",
"ip_addr":"222.252.56.163",
"user_id":"b6daqd5gwjgjxfunsdpwre4zdh",
"method":"POST",
"err_where":"installExtractedPlugin",
"http_code":500,
"err_details":"unable to start plugin: jitsi: fork/exec /mattermost/plugins/jitsi/server/dist/plugin-linux-amd64: permission denied"}

I tried to run the command you mentioned above, and it show the result: (My server using docker)

$ ls -lAh /mattermost/plugins/ /mattermost/prepackaged_plugins/
/mattermost/plugins/:
total 12K
drwxr--r--    5 mattermo mattermo    4.0K Jun  7 13:23 com.mattermost.nps
drwxr--r--    5 mattermo mattermo    4.0K Jun  8 09:00 januss
drwxr--r--    5 mattermo mattermo    4.0K Jun  8 14:45 jitsi

/mattermost/prepackaged_plugins/:
total 99M
-rw-r--r--    1 mattermo mattermo    8.6M Apr 23 14:58 mattermost-plugin-antivirus-v0.1.2-linux-amd64.tar.gz
-rw-r--r--    1 mattermo mattermo     566 Apr 23 14:58 mattermost-plugin-antivirus-v0.1.2-linux-amd64.tar.gz.sig
-rw-r--r--    1 mattermo mattermo    8.6M Apr 23 14:58 mattermost-plugin-autolink-v1.1.2-linux-amd64.tar.gz
-rw-r--r--    1 mattermo mattermo     566 Apr 23 14:58 mattermost-plugin-autolink-v1.1.2-linux-amd64.tar.gz.sig
-rw-r--r--    1 mattermo mattermo    8.7M Apr 23 14:58 mattermost-plugin-aws-SNS-v1.0.2-linux-amd64.tar.gz
-rw-r--r--    1 mattermo mattermo     566 Apr 23 14:58 mattermost-plugin-aws-SNS-v1.0.2-linux-amd64.tar.gz.sig
-rw-r--r--    1 mattermo mattermo    8.8M Apr 23 14:58 mattermost-plugin-custom-attributes-v1.0.2-linux-amd64.tar.gz
-rw-r--r--    1 mattermo mattermo     566 Apr 23 14:58 mattermost-plugin-custom-attributes-v1.0.2-linux-amd64.tar.gz.sig
-rw-r--r--    1 mattermo mattermo    9.6M Apr 23 14:58 mattermost-plugin-github-v0.11.0-linux-amd64.tar.gz
-rw-r--r--    1 mattermo mattermo     566 Apr 23 14:58 mattermost-plugin-github-v0.11.0-linux-amd64.tar.gz.sig
-rw-r--r--    1 mattermo mattermo    9.3M Apr 23 14:58 mattermost-plugin-gitlab-v1.0.1-linux-amd64.tar.gz
-rw-r--r--    1 mattermo mattermo     566 Apr 23 14:58 mattermost-plugin-gitlab-v1.0.1-linux-amd64.tar.gz.sig
-rw-r--r--    1 mattermo mattermo    9.0M Apr 23 14:58 mattermost-plugin-jenkins-v1.0.0-linux-amd64.tar.gz
-rw-r--r--    1 mattermo mattermo     566 Apr 23 14:58 mattermost-plugin-jenkins-v1.0.0-linux-amd64.tar.gz.sig
-rw-r--r--    1 mattermo mattermo   10.0M Apr 23 14:58 mattermost-plugin-jira-v2.3.2-linux-amd64.tar.gz
-rw-r--r--    1 mattermo mattermo     566 Apr 23 14:58 mattermost-plugin-jira-v2.3.2-linux-amd64.tar.gz.sig
-rw-r--r--    1 mattermo mattermo    8.7M Apr 23 14:58 mattermost-plugin-nps-v1.0.3-linux-amd64.tar.gz
-rw-r--r--    1 mattermo mattermo     566 Apr 23 14:58 mattermost-plugin-nps-v1.0.3-linux-amd64.tar.gz.sig
-rw-r--r--    1 mattermo mattermo    8.5M Apr 23 14:58 mattermost-plugin-welcomebot-v1.1.1-linux-amd64.tar.gz
-rw-r--r--    1 mattermo mattermo     566 Apr 23 14:58 mattermost-plugin-welcomebot-v1.1.1-linux-amd64.tar.gz.sig
-rw-r--r--    1 mattermo mattermo    8.8M Apr 23 14:58 mattermost-plugin-zoom-v1.3.0-linux-amd64.tar.gz
-rw-r--r--    1 mattermo mattermo     566 Apr 23 14:58 mattermost-plugin-zoom-v1.3.0-linux-amd64.tar.gz.sig

All the plugin permission are drwxr--r--, what should i do now :frowning: jitsi is the plugin i want to activate

Here is what console show when i deploy the plugin

{"level":"error","ts":1591629213.0361173,"caller":"mlog/log.go:175","msg":"Unable to activate plugin","plugin_id":"jitsi","error":"unable to start plugin: jitsi: fork/exec /mattermost/plugins/jitsi/server/dist/plugin-linux-amd64: permission denied","errorVerbose":"fork/exec /mattermost/plugins/jitsi/server/dist/plugin-linux-amd64: permission denied\nunable to start plugin: jitsi\ngithub.com/mattermost/mattermost-server/v5/plugin.(*Environment).Activate\n\tgithub.com/mattermost/mattermost-server/v5@/plugin/environment.go:266\ngithub.com/mattermost/mattermost-server/v5/app.(*App).SyncPluginsActiveState\n\tgithub.com/mattermost/mattermost-server/v5@/app/plugin.go:116\ngithub.com/mattermost/mattermost-server/v5/app.(*App).InitPlugins\n\tgithub.com/mattermost/mattermost-server/v5@/app/plugin.go:149\ngithub.com/mattermost/mattermost-server/v5/app.(*Server).RunOldAppInitialization.func6\n\tgithub.com/mattermost/mattermost-server/v5@/app/server_app_adapters.go:161\ngithub.com/mattermost/mattermost-server/v5/config.(*emitter).invokeConfigListeners.func1\n\tgithub.com/mattermost/mattermost-server/v5@/config/emitter.go:35\nsync.(*Map).Range\n\tsync/map.go:333\ngithub.com/mattermost/mattermost-server/v5/config.(*emitter).invokeConfigListeners\n\tgithub.com/mattermost/mattermost-server/v5@/config/emitter.go:33\ngithub.com/mattermost/mattermost-server/v5/config.(*commonStore).set\n\tgithub.com/mattermost/mattermost-server/v5@/config/common.go:90\ngithub.com/mattermost/mattermost-server/v5/config.(*FileStore).Set\n\tgithub.com/mattermost/mattermost-server/v5@/config/file.go:108\ngithub.com/mattermost/mattermost-server/v5/app.(*Server).UpdateConfig\n\tgithub.com/mattermost/mattermost-server/v5@/app/config.go:53\ngithub.com/mattermost/mattermost-server/v5/app.(*App).UpdateConfig\n\tgithub.com/mattermost/mattermost-server/v5@/app/config.go:59\ngithub.com/mattermost/mattermost-server/v5/app.(*App).EnablePlugin\n\tgithub.com/mattermost/mattermost-server/v5@/app/plugin.go:340\ngithub.com/mattermost/mattermost-server/v5/api4.enablePlugin\n\tgithub.com/mattermost/mattermost-server/v5@/api4/plugin.go:316\ngithub.com/mattermost/mattermost-server/v5/web.Handler.ServeHTTP\n\tgithub.com/mattermost/mattermost-server/v5@/web/handlers.go:212\ngithub.com/NYTimes/gziphandler.GzipHandlerWithOpts.func1.1\n\tgithub.com/NYTimes/gziphandler@v1.1.1/gzip.go:336\nnet/http.HandlerFunc.ServeHTTP\n\tnet/http/server.go:2007\ngithub.com/gorilla/mux.(*Router).ServeHTTP\n\tgithub.com/gorilla/mux@v1.7.3/mux.go:212\ngithub.com/rs/cors.(*Cors).Handler.func1\n\tgithub.com/rs/cors@v1.7.0/cors.go:219\nnet/http.HandlerFunc.ServeHTTP\n\tnet/http/server.go:2007\ngithub.com/mattermost/mattermost-server/v5/app.(*RateLimiter).RateLimitHandler.func1\n\tgithub.com/mattermost/mattermost-server/v5@/app/ratelimit.go:108\nnet/http.HandlerFunc.ServeHTTP\n\tnet/http/server.go:2007\nnet/http.serverHandler.ServeHTTP\n\tnet/http/server.go:2802\nnet/http.(*conn).serve\n\tnet/http/server.go:1890\nruntime.goexit\n\truntime/asm_amd64.s:1357"}

Hello, @huy-lv

I have attempted to upload the latest 1.3.0 Jitsi plugin through the System Console:

{"level":"debug","ts":1591666313.759843,"caller":"web/handlers.go:85","msg":"Received HTTP request","method":"POST","url":"/api/v4/users/status/ids","request_id":"bypqa5c3ntdw3kghsfj1nzpk9r"}
{"level":"debug","ts":1591666322.4742205,"caller":"web/handlers.go:85","msg":"Received HTTP request","method":"POST","url":"/api/v4/plugins","request_id":"9c3nmd8fh7nbpf1m96zidqnwnr"}
{"level":"debug","ts":1591666324.1313791,"caller":"web/handlers.go:85","msg":"Received HTTP request","method":"GET","url":"/api/v4/plugins","request_id":"fj3s3tsctb86bc8rx6ud5m3mcy"}
{"level":"debug","ts":1591666324.632894,"caller":"wsapi/websocket_handler.go:25","msg":"Websocket request","action":"user_update_active_status"}

After configuring the Jitsi Server URL and enable the plugin, it was successful:

{"level":"debug","ts":1591666473.4777794,"caller":"web/handlers.go:85","msg":"Received HTTP request","method":"POST","url":"/api/v4/plugins/jitsi/enable","request_id":"kfactbszfj8x5nfhsiqjz4fcxh"}
{"level":"debug","ts":1591666473.4865808,"caller":"jobs/schedulers.go:190","msg":"Schedulers received config change."}
{"level":"debug","ts":1591666473.4903595,"caller":"jobs/schedulers.go:172","msg":"Next run time for scheduler","scheduler_name":"EnterpriseLdapSync","next_runtime":"2020-06-09 01:38:39 +0000 UTC"}
{"level":"debug","ts":1591666473.4930847,"caller":"jobs/schedulers.go:172","msg":"Next run time for scheduler","scheduler_name":"MigrationsScheduler","next_runtime":"<nil>"}
{"level":"debug","ts":1591666473.5002787,"caller":"jobs/schedulers.go:172","msg":"Next run time for scheduler","scheduler_name":"PluginsScheduler","next_runtime":"2020-06-10 01:34:33.500267344 +0000 UTC m=+87779.368952140"}
{"level":"debug","ts":1591666473.5051196,"caller":"plugin/hclog_adapter.go:51","msg":"starting plugin","plugin_id":"jitsi","wrapped_extras":"pathplugins/jitsi/server/dist/plugin-linux-amd64args[plugins/jitsi/server/dist/plugin-linux-amd64]"}
{"level":"debug","ts":1591666473.5060902,"caller":"plugin/hclog_adapter.go:51","msg":"plugin started","plugin_id":"jitsi","wrapped_extras":"pathplugins/jitsi/server/dist/plugin-linux-amd64pid2805"}
{"level":"debug","ts":1591666473.506802,"caller":"plugin/hclog_adapter.go:51","msg":"waiting for RPC address","plugin_id":"jitsi","wrapped_extras":"pathplugins/jitsi/server/dist/plugin-linux-amd64"}
{"level":"debug","ts":1591666473.5119104,"caller":"plugin/hclog_adapter.go:51","msg":"plugin address","plugin_id":"jitsi","wrapped_extras":"networkunixaddress/tmp/plugin106206643timestamp2020-06-09T01:34:33.511Z"}
{"level":"debug","ts":1591666473.5131638,"caller":"plugin/hclog_adapter.go:51","msg":"using plugin","plugin_id":"jitsi","wrapped_extras":"version1"}
{"level":"debug","ts":1591666473.5188756,"caller":"jobs/workers.go:108","msg":"Workers received config change."}
{"level":"debug","ts":1591666473.5403306,"caller":"jobs/workers.go:108","msg":"Workers received config change."}
{"level":"debug","ts":1591666473.5414236,"caller":"jobs/schedulers.go:190","msg":"Schedulers received config change."}
{"level":"debug","ts":1591666473.5461411,"caller":"jobs/schedulers.go:172","msg":"Next run time for scheduler","scheduler_name":"EnterpriseLdapSync","next_runtime":"2020-06-09 01:38:39 +0000 UTC"}
{"level":"debug","ts":1591666473.5477157,"caller":"jobs/schedulers.go:172","msg":"Next run time for scheduler","scheduler_name":"MigrationsScheduler","next_runtime":"<nil>"}
{"level":"debug","ts":1591666473.549385,"caller":"jobs/schedulers.go:172","msg":"Next run time for scheduler","scheduler_name":"PluginsScheduler","next_runtime":"2020-06-10 01:34:33.54937765 +0000 UTC m=+87779.418062411"}

I have the same set of permission on my end as well:

ahmaddanial@mattermost:/home/# ls -lAh /opt/mattermost/plugins/ /opt/mattermost/prepackaged_plugins/
/opt/mattermost/plugins/:
total 8.0K
drwxr--r-- 5 mattermost mattermost 4.0K Jun  9 01:11 com.mattermost.nps
drwxr--r-- 4 mattermost mattermost 4.0K Jun  9 01:32 jitsi

/opt/mattermost/prepackaged_plugins/:
total 99M
-rw-rw-r-- 1 mattermost mattermost 8.7M May 14 12:20 mattermost-plugin-antivirus-v0.1.2-linux-amd64.tar.gz
-rw-rw-r-- 1 mattermost mattermost  566 May 14 12:20 mattermost-plugin-antivirus-v0.1.2-linux-amd64.tar.gz.sig
-rw-rw-r-- 1 mattermost mattermost 8.7M May 14 12:20 mattermost-plugin-autolink-v1.1.2-linux-amd64.tar.gz
-rw-rw-r-- 1 mattermost mattermost  566 May 14 12:20 mattermost-plugin-autolink-v1.1.2-linux-amd64.tar.gz.sig
-rw-rw-r-- 1 mattermost mattermost 8.8M May 14 12:20 mattermost-plugin-aws-SNS-v1.0.2-linux-amd64.tar.gz
-rw-rw-r-- 1 mattermost mattermost  566 May 14 12:20 mattermost-plugin-aws-SNS-v1.0.2-linux-amd64.tar.gz.sig
-rw-rw-r-- 1 mattermost mattermost 8.8M May 14 12:20 mattermost-plugin-custom-attributes-v1.0.2-linux-amd64.tar.gz
-rw-rw-r-- 1 mattermost mattermost  566 May 14 12:20 mattermost-plugin-custom-attributes-v1.0.2-linux-amd64.tar.gz.sig
-rw-rw-r-- 1 mattermost mattermost 9.7M May 14 12:20 mattermost-plugin-github-v0.11.0-linux-amd64.tar.gz
-rw-rw-r-- 1 mattermost mattermost  566 May 14 12:20 mattermost-plugin-github-v0.11.0-linux-amd64.tar.gz.sig
-rw-rw-r-- 1 mattermost mattermost 9.3M May 14 12:20 mattermost-plugin-gitlab-v1.0.1-linux-amd64.tar.gz
-rw-rw-r-- 1 mattermost mattermost  566 May 14 12:20 mattermost-plugin-gitlab-v1.0.1-linux-amd64.tar.gz.sig
-rw-rw-r-- 1 mattermost mattermost 9.0M May 14 12:20 mattermost-plugin-jenkins-v1.0.0-linux-amd64.tar.gz
-rw-rw-r-- 1 mattermost mattermost  566 May 14 12:20 mattermost-plugin-jenkins-v1.0.0-linux-amd64.tar.gz.sig
-rw-rw-r-- 1 mattermost mattermost  10M May 14 12:20 mattermost-plugin-jira-v2.3.2-linux-amd64.tar.gz
-rw-rw-r-- 1 mattermost mattermost  566 May 14 12:20 mattermost-plugin-jira-v2.3.2-linux-amd64.tar.gz.sig
-rw-rw-r-- 1 mattermost mattermost 8.9M May 14 12:20 mattermost-plugin-nps-v1.0.4-linux-amd64.tar.gz
-rw-rw-r-- 1 mattermost mattermost  566 May 14 12:20 mattermost-plugin-nps-v1.0.4-linux-amd64.tar.gz.sig
-rw-rw-r-- 1 mattermost mattermost 8.6M May 14 12:20 mattermost-plugin-welcomebot-v1.1.1-linux-amd64.tar.gz
-rw-rw-r-- 1 mattermost mattermost  566 May 14 12:20 mattermost-plugin-welcomebot-v1.1.1-linux-amd64.tar.gz.sig
-rw-rw-r-- 1 mattermost mattermost 8.9M May 14 12:20 mattermost-plugin-zoom-v1.3.0-linux-amd64.tar.gz
-rw-rw-r-- 1 mattermost mattermost  566 May 14 12:20 mattermost-plugin-zoom-v1.3.0-linux-amd64.tar.gz.sig

Since the error complains about permission error, may I know if you have the NPS and januss plugin enabled too? If not, can you try to enable them and confirm that the error also complains about permission?

Side note: The NPS plugin will require you to enable Enable Diagnostics and Error Reporting from System Console > Logging section.

I have tried to remove all the plugin (except nps) and make deploy plugin jitsi again, it works fine :smiley: really dont know why :smiley:

Hi, @huy-lv

While I am glad to know that it is working well now, can you please provide more information on which documentation you referred to when you make deploy the Jitsi plugin?

May I know if there was any reason behind it instead of just downloading the .tar.gz and upload it through the UI?

I only cloned the mattermost-plugin-jitsi project and deployed it using make deploy (follow project’s readme). My server deployed on linux server using mattermost-docker project. If i get this problem again, i will mention you here :smiley:

1 Like

@ahmaddanial today i deploy again the mattermost-plugin-jitsi and the last error come again :frowning: i haven’t change anything in this project. Here is the log

{"level":"error","ts":1592023218.0445037,"caller":"mlog/log.go:175","msg":"Unable to activate plugin","plugin_id":"jitsi","error":"unable to start plugin: jitsi: fork/exec /mattermost/plugins/jitsi/server/dist/plugin-linux-amd64: permission denied","errorVerbose":"fork/exec /mattermost/plugins/jitsi/server/dist/plugin-linux-amd64: permission denied\nunable to start plugin: jitsi\ngithub.com/mattermost/mattermost-server/v5/plugin.(*Environment).Activate\n\tgithub.com/mattermost/mattermost-server/v5@/plugin/environment.go:266\ngithub.com/mattermost/mattermost-server/v5/app.(*App).SyncPluginsActiveState\n\tgithub.com/mattermost/mattermost-server/v5@/app/plugin.go:116\ngithub.com/mattermost/mattermost-server/v5/app.(*App).InitPlugins\n\tgithub.com/mattermost/mattermost-server/v5@/app/plugin.go:149\ngithub.com/mattermost/mattermost-server/v5/app.(*Server).RunOldAppInitialization.func6\n\tgithub.com/mattermost/mattermost-server/v5@/app/server_app_adapters.go:161\ngithub.com/mattermost/mattermost-server/v5/config.(*emitter).invokeConfigListeners.func1\n\tgithub.com/mattermost/mattermost-server/v5@/config/emitter.go:35\nsync.(*Map).Range\n\tsync/map.go:333\ngithub.com/mattermost/mattermost-server/v5/config.(*emitter).invokeConfigListeners\n\tgithub.com/mattermost/mattermost-server/v5@/config/emitter.go:33\ngithub.com/mattermost/mattermost-server/v5/config.(*commonStore).set\n\tgithub.com/mattermost/mattermost-server/v5@/config/common.go:90\ngithub.com/mattermost/mattermost-server/v5/config.(*FileStore).Set\n\tgithub.com/mattermost/mattermost-server/v5@/config/file.go:108\ngithub.com/mattermost/mattermost-server/v5/app.(*App).SaveConfig\n\tgithub.com/mattermost/mattermost-server/v5@/app/config.go:382\ngithub.com/mattermost/mattermost-server/v5/app.(*App).EnablePlugin\n\tgithub.com/mattermost/mattermost-server/v5@/app/plugin.go:345\ngithub.com/mattermost/mattermost-server/v5/api4.enablePlugin\n\tgithub.com/mattermost/mattermost-server/v5@/api4/plugin.go:316\ngithub.com/mattermost/mattermost-server/v5/web.Handler.ServeHTTP\n\tgithub.com/mattermost/mattermost-server/v5@/web/handlers.go:212\ngithub.com/NYTimes/gziphandler.GzipHandlerWithOpts.func1.1\n\tgithub.com/NYTimes/gziphandler@v1.1.1/gzip.go:342\nnet/http.HandlerFunc.ServeHTTP\n\tnet/http/server.go:2007\ngithub.com/gorilla/mux.(*Router).ServeHTTP\n\tgithub.com/gorilla/mux@v1.7.3/mux.go:212\ngithub.com/rs/cors.(*Cors).Handler.func1\n\tgithub.com/rs/cors@v1.7.0/cors.go:219\nnet/http.HandlerFunc.ServeHTTP\n\tnet/http/server.go:2007\ngithub.com/mattermost/mattermost-server/v5/app.(*RateLimiter).RateLimitHandler.func1\n\tgithub.com/mattermost/mattermost-server/v5@/app/ratelimit.go:108\nnet/http.HandlerFunc.ServeHTTP\n\tnet/http/server.go:2007\nnet/http.serverHandler.ServeHTTP\n\tnet/http/server.go:2802\nnet/http.(*conn).serve\n\tnet/http/server.go:1890\nruntime.goexit\n\truntime/asm_amd64.s:1357"}

Hello, @huy-lv

Since you mentioned that the error reappeared again after you redeployed the plugin, may I know if you are open to upgrade your Mattermost to the latest version? I revisited the topic description you provided and since you are running on an older version of Mattermost:

I would like to know if you can backup and upgrade Mattermost and attempt this again. This ensures that the instance is running on the latest stable version before we dig deeper into this problem.

Hello @ahmaddanial again :smiley:
I have upgraded my mattermost-server to the latest version (5.23.1) using docker. And install mattermost-plugin-jitsi, i found two errors relate to jitsi:

{"level":"error","ts":1592236094.3634148,"caller":"mlog/log.go:175",
"msg":"Unable to restart plugin on upgrade.",
"path":"/api/v4/plugins","request_id":"xtzynefqd3nt5y6jksat78d3xa",
"ip_addr":"222.252.56.163","user_id":"833byn3fg7yduj36ogym31acpc",
"method":"POST","err_where":"installExtractedPlugin","http_code":500,
"err_details":"unable to start plugin: jitsi: fork/exec /mattermost/plugins/jitsi/server/dist/plugin-linux-amd64: permission denied"
}
{"level":"error","ts":1592236729.3798952,"caller":"mlog/log.go:175",
"msg":"Error saving plugin state in config.",
"path":"/api/v4/plugins/jitsi/enable","request_id":"6dih3cbrfbdetmfxoccj56jtyh",
"ip_addr":"222.252.56.163","user_id":"833byn3fg7yduj36ogym31acpc",
"method":"POST","err_where":"EnablePlugin","http_code":500,
"err_details":"saveConfig: An error occurred saving the configuration., failed to persist: failed to write file: open /mattermost/config/config.json: permission denied"
}

Hi, @huy-lv

Since the errors shown are just permission errors, can you please confirm if you are running Mattermost under the mattermost user?

If yes, you should be able to change the permission of the directories and files to the right user based on the following command:

sudo chown -R mattermost:mattermost /mattermost/

Are you still using make deploy at this point? Are you able to just utilize the Jitsi .tar.gz file here and upload it from the UI directly?

I already have the plugin installed but I don’t know how to use it. There is some place where you see how it is used

Thank you