mattermost-community / mattermost-plugin-autolink

Automatically rewrite text matching a regular expression into a markdown link.
Apache License 2.0
131 stars 57 forks source link

Run plugin on ARM #47

Closed asiniy closed 4 years ago

asiniy commented 5 years ago

How could I build & run this plugin on ARMv7? I can't get it, since plugin.json has no plugin-linux-arm entry?

hanzei commented 5 years ago

Did you tried running the latest release of this plugin on your system? If it fails, what is the error message in the logs?

asiniy commented 5 years ago

Hey @hanzei this is log. I just uploaded 0.4.0 version to my mattermost-server docker app image

{
    "level":"error",
    "ts":1553621786.3554552,
    "caller":"app/plugin.go:97",
    "msg":"Unable to activate plugin",
    "plugin_id":"mattermost-autolink",
    "error":"unable to start plugin: mattermost-autolink: fork/exec plugins/mattermost-autolink: permission denied","errorVerbose":"fork/exec plugins/mattermost-autolink: permission denied\nunable to start plugin: mattermost-autolink\ngithub.com/mattermost/mattermost-server/plugin.(*Environment).Activate\n\t/home/alex/go/src/github.com/mattermost/mattermost-server/plugin/environment.go:216\ngithub.com/mattermost/mattermost-server/app.(*App).SyncPluginsActiveState\n\t/home/alex/go/src/github.com/mattermost/mattermost-server/app/plugin.go:95\ngithub.com/mattermost/mattermost-server/app.(*App).InitPlugins\n\t/home/alex/go/src/github.com/mattermost/mattermost-server/app/plugin.go:126\ngithub.com/mattermost/mattermost-server/app.(*Server).RunOldAppInitalization.func6\n\t/home/alex/go/src/github.com/mattermost/mattermost-server/app/server_app_adapters.go:142\ngithub.com/mattermost/mattermost-server/app.(*Server).InvokeConfigListeners\n\t/home/alex/go/src/github.com/mattermost/mattermost-server/app/config.go:169\ngithub.com/mattermost/mattermost-server/app.(*Server).UpdateConfig\n\t/home/alex/go/src/github.com/mattermost/mattermost-server/app/config.go:58\ngithub.com/mattermost/mattermost-server/app.(*App).UpdateConfig\n\t/home/alex/go/src/github.com/mattermost/mattermost-server/app/config.go:62\ngithub.com/mattermost/mattermost-server/app.(*App).EnablePlugin\n\t/home/alex/go/src/github.com/mattermost/mattermost-server/app/plugin.go:245\ngithub.com/mattermost/mattermost-server/app.(*App).installPlugin\n\t/home/alex/go/src/github.com/mattermost/mattermost-server/app/plugin_install.go:87\ngithub.com/mattermost/mattermost-server/app.(*App).InstallPlugin\n\t/home/alex/go/src/github.com/mattermost/mattermost-server/app/plugin_install.go:21\ngithub.com/mattermost/mattermost-server/api4.uploadPlugin\n\t/home/alex/go/src/github.com/mattermost/mattermost-server/api4/plugin.go:73\ngithub.com/mattermost/mattermost-server/web.Handler.ServeHTTP\n\t/home/alex/go/src/github.com/mattermost/mattermost-server/web/handlers.go:151\ngithub.com/mattermost/mattermost-server/vendor/github.com/gorilla/mux.(*Router).ServeHTTP\n\t/home/alex/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/home/alex/go/src/github.com/mattermost/mattermost-server/vendor/github.com/gorilla/handlers/recovery.go:78\nnet/http.serverHandler.ServeHTTP\n\t/home/pi/.asdf/installs/golang/1.12.1/go/src/net/http/server.go:2774\nnet/http.(*conn).serve\n\t/home/pi/.asdf/installs/golang/1.12.1/go/src/net/http/server.go:1878\nruntime.goexit\n\t/home/pi/.asdf/installs/golang/1.12.1/go/src/runtime/asm_arm.s:868"
}
asiniy commented 5 years ago

Mattermost version is 5.9.0

hanzei commented 5 years ago

Would you mind testing a different plugin e.g. Matterpoll? This might be a general issue with plugins.

John-Appleseed commented 5 years ago

Matterpoll produces the same error

"error":"unable to start plugin: com.github.matterpoll.matterpoll: fork/exec plugins/com.github.matterpoll.matterpoll: permission denied",
"errorVerbose":"fork/exec plugins/com.github.matterpoll.matterpoll: permission denied\nunable to start plugin: com.github.matterpoll.matterpoll\ngithub.com/mattermost/mattermost-server/plugin

The plugin config is missing an arm executable path

 "server": {
    "executables": {
      "linux-amd64": "server/dist/plugin-linux-amd64",
      "darwin-amd64": "server/dist/plugin-darwin-amd64",
      "windows-amd64": "server/dist/plugin-windows-amd64.exe"
    }

Had to modify matterpoll Makefile to build for arm 7

# build for pi
cd server && env GOOS=linux GOARCH=arm GOARM=7  $(GO) build -o dist/plugin-linux-arm;

The arm binary produces a proper response

./server/dist/plugin-linux-arm 
This binary is a plugin. These are not meant to be executed directly.
Please execute the program that consumes these plugins, which will
load any plugins automatically

The error logs are unclear what mattermost is trying to execute. Renaming plugin-linux-arm to plugin-linux-amd64 has no effect.

hanzei commented 5 years ago

Thank you very much for the update @John-Appleseed! Could you please check that the user that's running Mattermost has access to plugins/com.github.matterpoll.matterpoll?

John-Appleseed commented 5 years ago

Ownership and rwx are set to the same user of the Mattermost server. chown -R m:m ~/mm/plugins ~/mm/plugins/com.github.matterpoll.matterpoll ~/mm/client/plugins/com.github.matterpoll.matterpoll -- This folder might not be unnecessary

Mattermost Plugin doc - https://github.com/mattermost/docs/blob/master/source/administration/plugins.rst#troubleshooting

hanzei commented 4 years ago

ARM is currently not supported by the plugin framework and Mattermost. Would you please open a feature request on https://mattermost.uservoice.com/forums/306457-general?

Nopasaran13 commented 4 years ago

Hi, i installed mattermost on debian butcher on a raspberrypi and have the same error when i try to use the matterpoll plugin. Mattermost plugin still does'nt work with arm? is there any fix for this? Thanks in advance