mattermost-plugin-alertmanager icon indicating copy to clipboard operation
mattermost-plugin-alertmanager copied to clipboard

failed to start plugin 0.2.0

Open keterslayter opened this issue 4 years ago • 7 comments

mattermost version: 6.0.2 (also tried on version 6.1.0) plugin version: 0.2.0

I've followed the steps on the readme file but still not able to activate the plugin, the errors im getting from the mattermost conainer:

{"timestamp":"2021-12-08 11:10:28.882 Z","level":"debug","msg":"starting plugin","caller":"plugin/hclog_adapter.go:52","plugin_id":"alertmanager","wrapped_extras":"pathplugins/alertmanager/server/dist/plugin-linux-amd64args[plugins/alertmanager/server/dist/plugin-linux-amd64]"} {"timestamp":"2021-12-08 11:10:28.883 Z","level":"debug","msg":"Next run time for scheduler","caller":"jobs/schedulers.go:216","scheduler_name":"ResendInvitationEmailJobScheduler","next_runtime":"2021-12-08 11:10:33.883363061 +0000 UTC m=+468.349421553"} {"timestamp":"2021-12-08 11:10:28.884 Z","level":"debug","msg":"plugin started","caller":"plugin/hclog_adapter.go:52","plugin_id":"alertmanager","wrapped_extras":"pathplugins/alertmanager/server/dist/plugin-linux-amd64pid185"} {"timestamp":"2021-12-08 11:10:28.884 Z","level":"debug","msg":"waiting for RPC address","caller":"plugin/hclog_adapter.go:52","plugin_id":"alertmanager","wrapped_extras":"pathplugins/alertmanager/server/dist/plugin-linux-amd64"} {"timestamp":"2021-12-08 11:10:28.884 Z","level":"warn","msg":"plugin failed to exit gracefully","caller":"plugin/hclog_adapter.go:72","plugin_id":"alertmanager"} {"timestamp":"2021-12-08 11:10:28.884 Z","level":"debug","msg":"Error relocating plugins/alertmanager/server/dist/plugin-linux-amd64: __vfprintf_chk: symbol not found","caller":"plugin/hclog_adapter.go:54","plugin_id":"alertmanager"} {"timestamp":"2021-12-08 11:10:28.884 Z","level":"debug","msg":"Error relocating plugins/alertmanager/server/dist/plugin-linux-amd64: __fprintf_chk: symbol not found","caller":"plugin/hclog_adapter.go:54","plugin_id":"alertmanager"} {"timestamp":"2021-12-08 11:10:28.884 Z","level":"debug","msg":"plugin process exited","caller":"plugin/hclog_adapter.go:52","plugin_id":"alertmanager","wrapped_extras":"pathplugins/alertmanager/server/dist/plugin-linux-amd64pid185errorexit status 127"} {"timestamp":"2021-12-08 11:10:28.884 Z","level":"error","msg":"Unable to activate plugin","caller":"app/plugin.go:146","plugin_id":"alertmanager","error":"unable to start plugin: alertmanager: 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."}

keterslayter avatar Dec 08 '21 11:12 keterslayter

Had the same issue ("Unrecognized remote plugin message"), running on MatterMost Team Edition 6.3. Building the plugin manually and uploading that file instead, resolved the issue (download code, run make with 'golangci-lint' installed). I suspect this is caused by an updated API that is not included in the 0.2.0 release, but is in master via #23

RemiWoler avatar Feb 12 '22 20:02 RemiWoler

Runnign make on macOS 12.3 with go 1.18 I get

Checking for style guide compliance
Running golangci-lint
golangci-lint run ./...
WARN [runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner.  Replaced by revive.
WARN [runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner.
server/webhook.go:37:45: SA1019: strings.Title is deprecated: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead. (staticcheck)
			msg = fmt.Sprintf("%s**%s:** %s\n", msg, strings.Title(k), v)
			                                         ^
server/webhook.go:57:45: SA1019: strings.Title is deprecated: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead. (staticcheck)
			msg = fmt.Sprintf("%s**%s:** %s\n", msg, strings.Title(k), v)
			                                         ^
make: *** [check-style] Error 1

I needed to run

make server
make bundle

instead.

However uploading the resulting tarball results in

Received invalid response from the server.

in MM 6.5

Maybe bc the resulting tarball was build for arm rather than x86 which is needed for the MM instance?

pat-s avatar Mar 29 '22 21:03 pat-s

I've now build the latest HEAD from this repo on Ubuntu20 with go 1.18 and uploaded it Yet I receive the same issue as in the OP

{"timestamp":"2022-03-30 09:16:08.356 Z","level":"error","msg":"Unable to activate plugin","caller":"app/plugin.go:142","plugin_id":"alertmanager","error":"unable to start plugin: alertmanager: 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."}

Could it be that this plugin is not functional right now? Is an older go version needed?

pat-s avatar Mar 30 '22 09:03 pat-s

Bump ! Hey any good news ?

HuaweiDonor avatar Apr 22 '22 14:04 HuaweiDonor

I have the same symbol not found error. I use the official mattermost docker container (based on alpine Dockerfile). With the Mattermost Preview image (not based on alpine) the plugin works as expected. I have no idea what is needed to run the plugin, but I found this stackoverflow post where they also get a symbol not found error in an alpine image.

anneum avatar Apr 25 '22 15:04 anneum

I added gcompat package to the Dockerfile , build the container and now the plugin works for me.

FROM alpine:3.14@sha256:635f0aa53d99017b38d1a0aa5b2082f7812b03e3cdb299103fe77b5c8a07f1d2

# Some ENV variables
ENV PATH="/mattermost/bin:${PATH}"
ARG PUID=2000
ARG PGID=2000
ARG MM_PACKAGE="https://releases.mattermost.com/6.6.0/mattermost-6.6.0-linux-amd64.tar.gz?src=docker"


# Install some needed packages
RUN apk add --no-cache \
  ca-certificates \
  curl \
  libc6-compat \
  libffi-dev \
  linux-headers \
  mailcap \
  netcat-openbsd \
  xmlsec-dev \
  tzdata \
  wv \
  poppler-utils \
  tidyhtml \
  gcompat \
  && rm -rf /tmp/*

# Get Mattermost
RUN mkdir -p /mattermost/data /mattermost/plugins /mattermost/client/plugins \
  && if [ ! -z "$MM_PACKAGE" ]; then curl $MM_PACKAGE | tar -xvz ; \
  else echo "please set the MM_PACKAGE" ; fi \
  && addgroup -g ${PGID} mattermost \
  && adduser -D -u ${PUID} -G mattermost -h /mattermost -D mattermost \
  && chown -R mattermost:mattermost /mattermost /mattermost/plugins /mattermost/client/plugins

USER mattermost

#Healthcheck to make sure container is ready
HEALTHCHECK --interval=30s --timeout=10s \
  CMD curl -f http://localhost:8065/api/v4/system/ping || exit 1


# Configure entrypoint and command
COPY entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]
WORKDIR /mattermost
CMD ["mattermost"]

EXPOSE 8065 8067 8074 8075

# Declare volumes for mount point directories
VOLUME ["/mattermost/data", "/mattermost/logs", "/mattermost/config", "/mattermost/plugins", "/mattermost/client/plugins"]

anneum avatar Apr 25 '22 15:04 anneum

Hi. I was try to upload this plugin https://github.com/cpanato/mattermost-plugin-alertmanager/releases/tag/v0.2.0 in mattermost-team-editon https://github.com/mattermost/mattermost-helm/blob/master/charts/mattermost-team-edition/README.md , which i installed in kubernetes cluster. MM version 6.7.0 in kubernetes cluster. Uploading the resulting tarball results in: Received invalid response from the server.

Can anyone help, pls?

Avers90 avatar Jun 08 '22 08:06 Avers90

I had the same problem. My Mattermost is 7.8.0 version over Docker. I downloaded the latest alertmanager release (v0.4.0) and uploaded it to the server though Mattermost desktop client but faced the same issue like the other guys. I just removed unnecessary executable from the plugin downloaded file in the path server/dist (just needed plugin-linux-amd64) and then uploaded the plugin and it was successfully enabled.

meysamfarazmand avatar Feb 24 '23 15:02 meysamfarazmand

please try to use the latest release closing this if this are still an issue, feel free to open a new one

cpanato avatar Mar 13 '23 12:03 cpanato