noxdafox / rabbitmq-cloudwatch-exporter

RabbitMQ Plugin for publishing cluster metrics to AWS CloudWatch
Mozilla Public License 2.0
41 stars 9 forks source link

released .ez files can't be installed on 3.7 #8

Closed dwarburt closed 4 years ago

dwarburt commented 4 years ago

I'm encountering an error while installing. We're running rabbitmq from docker so I updated our Dockerfile to pull down this plugin and install it, but it fails with {invalid_ez,einval}.

Using this dockerfile:

FROM rabbitmq:3.7-management

ENV CWPLUGIN https://api.github.com/repos/noxdafox/rabbitmq-cloudwatch-exporter/releases/18074331
WORKDIR /opt/rabbitmq/plugins
RUN apt-get update && \
    apt-get install -y jq curl && \
    export DLS="$(curl $CWPLUGIN | jq -r '.assets[].browser_download_url')" && \
    (for u in $DLS; do curl -O $u; done;) && \
    apt-get purge -y jq curl
RUN rabbitmq-plugins enable rabbitmq_cloudwatch_exporter

the final command gives this error message:


2019-09-16T15:31:09.7540788Z Step 5/5 : RUN rabbitmq-plugins enable rabbitmq_cloudwatch_exporter
2019-09-16T15:31:10.3590127Z  ---> Running in 4477ce81c079
2019-09-16T15:31:12.4438676Z Enabling plugins on node rabbit@4477ce81c079:
2019-09-16T15:31:12.4441404Z rabbitmq_cloudwatch_exporter
2019-09-16T15:31:12.6652172Z Problem reading some plugins: [{"/opt/rabbitmq/plugins/unicode_util_compat-0.4.1.ez",
2019-09-16T15:31:12.6652416Z                                 {invalid_ez,einval}},
2019-09-16T15:31:12.6652792Z                                {"/opt/rabbitmq/plugins/ssl_verify_fun-1.1.4.ez",
2019-09-16T15:31:12.6652912Z                                 {invalid_ez,einval}},
2019-09-16T15:31:12.6653233Z                                {"/opt/rabbitmq/plugins/singleton-1.2.0.ez",
2019-09-16T15:31:12.6653347Z                                 {invalid_ez,einval}},
2019-09-16T15:31:12.6654225Z                                {"/opt/rabbitmq/plugins/rabbitmq_cloudwatch_exporter-0.2.1.ez",
2019-09-16T15:31:12.6654347Z                                 {invalid_ez,einval}},
2019-09-16T15:31:12.6654681Z                                {"/opt/rabbitmq/plugins/poison-3.1.0.ez",
2019-09-16T15:31:12.6654777Z                                 {invalid_ez,einval}},
2019-09-16T15:31:12.6655121Z                                {"/opt/rabbitmq/plugins/mimerl-1.2.0.ez",
2019-09-16T15:31:12.6655236Z                                 {invalid_ez,einval}},
2019-09-16T15:31:12.6655566Z                                {"/opt/rabbitmq/plugins/metrics-1.0.1.ez",
2019-09-16T15:31:12.6655662Z                                 {invalid_ez,einval}},
2019-09-16T15:31:12.6655992Z                                {"/opt/rabbitmq/plugins/logger-1.8.2.ez",
2019-09-16T15:31:12.6656103Z                                 {invalid_ez,einval}},
2019-09-16T15:31:12.6656430Z                                {"/opt/rabbitmq/plugins/idna-6.0.0.ez",
2019-09-16T15:31:12.6656550Z                                 {invalid_ez,einval}},
2019-09-16T15:31:12.6656862Z                                {"/opt/rabbitmq/plugins/hackney-1.15.1.ez",
2019-09-16T15:31:12.6656989Z                                 {invalid_ez,einval}},
2019-09-16T15:31:12.6657330Z                                {"/opt/rabbitmq/plugins/ex_aws_cloudwatch-2.0.4.ez",
2019-09-16T15:31:12.6657628Z                                 {invalid_ez,einval}},
2019-09-16T15:31:12.6658004Z                                {"/opt/rabbitmq/plugins/ex_aws-2.1.0.ez",
2019-09-16T15:31:12.6658097Z                                 {invalid_ez,einval}},
2019-09-16T15:31:12.6658423Z                                {"/opt/rabbitmq/plugins/elixir-1.8.2.ez",
2019-09-16T15:31:12.6658533Z                                 {invalid_ez,einval}},
2019-09-16T15:31:12.6659142Z                                {"/opt/rabbitmq/plugins/certifi-2.5.1.ez",
2019-09-16T15:31:12.6659262Z                                 {invalid_ez,einval}}]
2019-09-16T15:31:12.7699242Z Problem reading some plugins: [{"/opt/rabbitmq/plugins/unicode_util_compat-0.4.1.ez",
2019-09-16T15:31:12.7699440Z                                 {invalid_ez,einval}},
2019-09-16T15:31:12.7699845Z                                {"/opt/rabbitmq/plugins/ssl_verify_fun-1.1.4.ez",
2019-09-16T15:31:12.7699967Z                                 {invalid_ez,einval}},
2019-09-16T15:31:12.7700333Z                                {"/opt/rabbitmq/plugins/singleton-1.2.0.ez",
2019-09-16T15:31:12.7700450Z                                 {invalid_ez,einval}},
2019-09-16T15:31:12.7700785Z                                {"/opt/rabbitmq/plugins/rabbitmq_cloudwatch_exporter-0.2.1.ez",
2019-09-16T15:31:12.7700905Z                                 {invalid_ez,einval}},
2019-09-16T15:31:12.7701230Z                                {"/opt/rabbitmq/plugins/poison-3.1.0.ez",
2019-09-16T15:31:12.7701342Z                                 {invalid_ez,einval}},
2019-09-16T15:31:12.7701681Z                                {"/opt/rabbitmq/plugins/mimerl-1.2.0.ez",
2019-09-16T15:31:12.7701775Z                                 {invalid_ez,einval}},
2019-09-16T15:31:12.7702103Z                                {"/opt/rabbitmq/plugins/metrics-1.0.1.ez",
2019-09-16T15:31:12.7702215Z                                 {invalid_ez,einval}},
2019-09-16T15:31:12.7702539Z                                {"/opt/rabbitmq/plugins/logger-1.8.2.ez",
2019-09-16T15:31:12.7702643Z                                 {invalid_ez,einval}},
2019-09-16T15:31:12.7702969Z                                {"/opt/rabbitmq/plugins/idna-6.0.0.ez",
2019-09-16T15:31:12.7703082Z                                 {invalid_ez,einval}},
2019-09-16T15:31:12.7703411Z                                {"/opt/rabbitmq/plugins/hackney-1.15.1.ez",
2019-09-16T15:31:12.7703523Z                                 {invalid_ez,einval}},
2019-09-16T15:31:12.7703841Z                                {"/opt/rabbitmq/plugins/ex_aws_cloudwatch-2.0.4.ez",
2019-09-16T15:31:12.7704326Z                                 {invalid_ez,einval}},
2019-09-16T15:31:12.7704686Z                                {"/opt/rabbitmq/plugins/ex_aws-2.1.0.ez",
2019-09-16T15:31:12.7704796Z                                 {invalid_ez,einval}},
2019-09-16T15:31:12.7705118Z                                {"/opt/rabbitmq/plugins/elixir-1.8.2.ez",
2019-09-16T15:31:12.7705211Z                                 {invalid_ez,einval}},
2019-09-16T15:31:12.7705545Z                                {"/opt/rabbitmq/plugins/certifi-2.5.1.ez",
2019-09-16T15:31:12.7705656Z                                 {invalid_ez,einval}}]
2019-09-16T15:31:12.8733431Z Problem reading some plugins: [{"/opt/rabbitmq/plugins/unicode_util_compat-0.4.1.ez",
2019-09-16T15:31:12.8734479Z                                 {invalid_ez,einval}},
2019-09-16T15:31:12.8735490Z                                {"/opt/rabbitmq/plugins/ssl_verify_fun-1.1.4.ez",
2019-09-16T15:31:12.8735659Z                                 {invalid_ez,einval}},
2019-09-16T15:31:12.8736062Z                                {"/opt/rabbitmq/plugins/singleton-1.2.0.ez",
2019-09-16T15:31:12.8736248Z                                 {invalid_ez,einval}},
2019-09-16T15:31:12.8736613Z                                {"/opt/rabbitmq/plugins/rabbitmq_cloudwatch_exporter-0.2.1.ez",
2019-09-16T15:31:12.8736734Z                                 {invalid_ez,einval}},
2019-09-16T15:31:12.8737493Z                                {"/opt/rabbitmq/plugins/poison-3.1.0.ez",
2019-09-16T15:31:12.8738294Z                                 {invalid_ez,einval}},
2019-09-16T15:31:12.8739067Z                                {"/opt/rabbitmq/plugins/mimerl-1.2.0.ez",
2019-09-16T15:31:12.8739189Z                                 {invalid_ez,einval}},
2019-09-16T15:31:12.8739566Z                                {"/opt/rabbitmq/plugins/metrics-1.0.1.ez",
2019-09-16T15:31:12.8739679Z                                 {invalid_ez,einval}},
2019-09-16T15:31:12.8740003Z                                {"/opt/rabbitmq/plugins/logger-1.8.2.ez",
2019-09-16T15:31:12.8740130Z                                 {invalid_ez,einval}},
2019-09-16T15:31:12.8740437Z                                {"/opt/rabbitmq/plugins/idna-6.0.0.ez",
2019-09-16T15:31:12.8740553Z                                 {invalid_ez,einval}},
2019-09-16T15:31:12.8740883Z                                {"/opt/rabbitmq/plugins/hackney-1.15.1.ez",
2019-09-16T15:31:12.8741006Z                                 {invalid_ez,einval}},
2019-09-16T15:31:12.8741345Z                                {"/opt/rabbitmq/plugins/ex_aws_cloudwatch-2.0.4.ez",
2019-09-16T15:31:12.8741444Z                                 {invalid_ez,einval}},
2019-09-16T15:31:12.8741767Z                                {"/opt/rabbitmq/plugins/ex_aws-2.1.0.ez",
2019-09-16T15:31:12.8741878Z                                 {invalid_ez,einval}},
2019-09-16T15:31:12.8742203Z                                {"/opt/rabbitmq/plugins/elixir-1.8.2.ez",
2019-09-16T15:31:12.8742313Z                                 {invalid_ez,einval}},
2019-09-16T15:31:12.8742632Z                                {"/opt/rabbitmq/plugins/certifi-2.5.1.ez",
2019-09-16T15:31:12.8742744Z                                 {invalid_ez,einval}}]
2019-09-16T15:31:12.8991396Z Error:
2019-09-16T15:31:12.8991693Z {:plugins_not_found, [:rabbitmq_cloudwatch_exporter]}
2019-09-16T15:31:13.2883439Z The command '/bin/sh -c rabbitmq-plugins enable rabbitmq_cloudwatch_exporter' returned a non-zero code: 70
noxdafox commented 4 years ago

Hello,

what version of RMQ and Erlang are you using?

dwarburt commented 4 years ago

This is the rabbitmq image on docker hub, version 3.7.17 with Erlang/OTP 22. details here: https://hub.docker.com/_/rabbitmq

noxdafox commented 4 years ago

I tried your command and it does not download the proper release files as the SHA1 checksums differ. You are using curl incorrectly.

$ export DLS="$(curl $CWPLUGIN | jq -r '.assets[].browser_download_url')" && (for u in $DLS; do curl -O $u; done;) 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 25968  100 25968    0     0  52566      0 --:--:-- --:--:-- --:--:-- 52566
...

$ sha1sum rabbitmq_cloudwatch_exporter-0.2.1.ez 
a4ce25f573ec162619b8acf13185f7c67b5b6403  rabbitmq_cloudwatch_exporter-0.2.1.ez

$ sha1sum ~/downloads/rabbitmq_cloudwatch_exporter-0.2.1.ez 
b21fefe4849b01505f4eb7a19369db3a8661c3c7  ~/downloads/rabbitmq_cloudwatch_exporter-0.2.1.ez

The latter is the correct one as downloaded from GitHub.

Using wget fixes the issue.

$ export DLS="$(curl $CWPLUGIN | jq -r '.assets[].browser_download_url')" && (for u in $DLS; do wget $u; done;) 
...

$ sha1sum rabbitmq_cloudwatch_exporter-0.2.1.ez 
b21fefe4849b01505f4eb7a19369db3a8661c3c7  rabbitmq_cloudwatch_exporter-0.2.1.ez

$ sha1sum ~/downloads/rabbitmq_cloudwatch_exporter-0.2.1.ez 
b21fefe4849b01505f4eb7a19369db3a8661c3c7  ~/downloads/rabbitmq_cloudwatch_exporter-0.2.1.ez
Spoonbender commented 3 years ago

Had a similar issue. What I was trying to do is download a plugin as part of my Dockerfile, using curl. The issue was that the URL in the GitHub Releases page does not lead directly to the plugin - it returns an HTTP Redirect (302) which then leads to the actual plugin. The solution was either use wget or tell curl to follow the redirect.