wbernest / mattermost-plugin-rssfeed

Mattermost RSSFeed plugin. Allows users to subscribe to an rss feed and allow for updates to the feed to be posted in a channel.
Apache License 2.0
69 stars 40 forks source link

Unable to activate plugin in Mattermost 5.30.1 #39

Open ragnarok189 opened 3 years ago

ragnarok189 commented 3 years ago

I have compiled the plugin source code (both release v0.2.0 and latest commit from master branch) with make dist and uploaded the compiled plugin to Mattermost v5.30.1 from the Plugin Management window in the app. When enabling, the Mattermost UI reports "This plugin failed to start. Check your system logs for errors.".

Mattermost logs from mattermost/logs/mattermost.log report

{"level":"warn","ts":1609276282.193012,"caller":"plugin/hclog_adapter.go:71","msg":"plugin failed to exit gracefully","plugin_id":"rssfeed"}
{"level":"error","ts":1609276282.193582,"caller":"mlog/log.go:229","msg":"Unable to activate plugin","plugin_id":"rssfeed","error":"unable to start plugin: rssfeed: Unrecognized remote plugin message: \n\nThis usually means that the plugin is either invalid or simply\nneeds to be recompiled to support the latest protocol.","errorVerbose":"Unrecognized remote plugin message: \n\nThis usually means that the plugin is either invalid or simply\nneeds to be recompiled to support the latest protocol.\nunable to start plugin: rssfeed\ngithub.com/mattermost/mattermost-server/v5/plugin.(*Environment).Activate\n\tgithub.com/mattermost/mattermost-server/v5/plugin/environment.go:267\ngithub.com/mattermost/mattermost-server/v5/app.(*App).SyncPluginsActiveState.func2\n\tgithub.com/mattermost/mattermost-server/v5/app/plugin.go:132\nruntime.goexit\n\truntime/asm_amd64.s:1373"}

Plugin compiled on Arch Linux with Go version 1.15.6. Mattermost running on Centos 8.

Compilation output

$ make dist
./build/bin/manifest apply
mkdir -p server/dist;
cd server && env GOOS=linux GOARCH=amd64 /usr/bin/go build  -o dist/plugin-linux-amd64;
cd server && env GOOS=darwin GOARCH=amd64 /usr/bin/go build  -o dist/plugin-darwin-amd64;
cd server && env GOOS=windows GOARCH=amd64 /usr/bin/go build  -o dist/plugin-windows-amd64.exe;
rm -rf dist/
mkdir -p dist/rssfeed
cp plugin.json dist/rssfeed/
cp -r assets dist/rssfeed/
mkdir -p dist/rssfeed/server/dist;
cp -r server/dist/* dist/rssfeed/server/dist/;
cd dist && tar -cvzf rssfeed-0.2.0.tar.gz rssfeed
rssfeed/
rssfeed/assets/
rssfeed/assets/rss.png
rssfeed/plugin.json
rssfeed/server/
rssfeed/server/dist/
rssfeed/server/dist/plugin-windows-amd64.exe
rssfeed/server/dist/plugin-darwin-amd64
rssfeed/server/dist/plugin-linux-amd64
plugin built at: dist/rssfeed-0.2.0.tar.gz
doncoffin commented 3 years ago

Having the same issue. I've built the server binary without issues, but Mattermost gives the exact same error about an invalid plugin:

"error":"unable to start plugin: rssfeed: Unrecognized remote plugin message: \n\nThis usually means that the plugin is either invalid or simply\nneeds to be recompiled to support the latest protocol."

Plugin compiled on Ubuntu 18.04 with Go 1.13.8, running Mattermost 5.31.6.

MoeRT09 commented 3 years ago

Hey,

I had the same issue. I compiled on Ubuntu and tried to run the plugin in a mattermost instance run via Docker using the guide from here.

After changing the Mattermost log level to DEBUG, I saw the following message: __fprintf_chk: symbol not found. The reason for this was, that the Docker image is based on Alpine Linux, which is using musl as standard C library.

The solution for me was disabling cgo, by putting export CGO_ENABLED=0 into the Makefile (right below export GO111MODULE=on. After recompiling, the plugin could be enabled.

Note, that the problem in your cases could be different, and disabling cgo might not work for you, as you are not running it on Alpine Linux. But it's worth a try.

Have a look at the log with the level set to DEBUG to get more clues.

doncoffin commented 3 years ago

@MoeRT09 Brilliant! I am, in fact, running a dockerized Mattermost using Alpine Linux. Disabling CGO, as you suggested, did the trick. Thanks much for the pointer (and context)!

mb706 commented 1 year ago

Btw, this was still a problem with my setup (7.1.4 ESR) today and still solved by disabling CGO.