noxdafox / rabbitmq-cloudwatch-exporter

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

HTTP error on RabbitMQ v3.8.4 #20

Closed stoft closed 3 years ago

stoft commented 4 years ago

Hi!

We tried this out in a test environment with RabbitMQ v3.8.4 (Erlang 23..) and get the following error in our logs:

12:33:28.193 [warn] ExAws: HTTP ERROR: {:options, {:sslv3, {:versions, [:"tlsv1.2", :"tlsv1.1", :tlsv1, :sslv3]}}}
Error: {options,{sslv3,{versions,['tlsv1.2','tlsv1.1',tlsv1,sslv3]}}}

My guess is that this is due to Erlang 23 dropping SSLv3 and adding TLSv1.3: https://elixirforum.com/t/erlang-v-23-0-and-httpoison-error/31615

I started looking into it a bit, but I'm unsure whether upgrading hackney to 1.16 is enough however, as ex_aws also has a dependency to (an older version of afaik) hackney. Maybe it's possible to pass different options to hackney regardless, excluding sslv3, but I'm unsure where / how to do that.

noxdafox commented 4 years ago

Hello,

it seems Erlang/Elixir community is having some particular trouble with SSL/TLS as this is not the first time I struggle with the same issue.

Did you try compiling the plugin with Erlang 23? It is right now compiled with Erlang 21 to ensure best compatibility across versions.

stoft commented 4 years ago

Hi,

Sorry, we already have Prometheus up and running so my employer isn't interested in putting more time into this (and my spare time is unfortunately limited). Someone else will have to take over. 🤷‍♂️ 😢

luzhkovvv commented 3 years ago

Hi! I'm having same issue with erlang 23 based rabbitmq container. Tried compiling the plugin with erlang 23 with no luck. All erlang and elixir things are totally new for me, so maybe i messed up versions somehow, not sure. Have to stick with use rabbitmq 3.8.3.

...
Compiling 10 files (.ex)
Generated rabbitmq_cloudwatch_exporter app
** (UndefinedFunctionError) function Mix.Dep.loaded/1 is undefined or private
    (mix 1.10.4) Mix.Dep.loaded([env: :dev])
    lib/mix/tasks/archive/build.deps.ex:72: Mix.Tasks.Archive.Build.Deps.list/1
    lib/mix/tasks/archive/build.deps.ex:54: Mix.Tasks.Archive.Build.Deps.build_archives/1
    lib/mix/tasks/archive/build.all.ex:62: Mix.Tasks.Archive.Build.All.run/1
    (mix 1.10.4) lib/mix/task.ex:330: Mix.Task.run_task/3
    (elixir 1.10.4) lib/enum.ex:783: Enum."-each/2-lists^foreach/1-0-"/2
    (elixir 1.10.4) lib/enum.ex:783: Enum.each/2
    (mix 1.10.4) lib/mix/task.ex:330: Mix.Task.run_task/3
make[1]: *** [/home/luzhkovvv/code/rabbitmq-cloudwatch-exporter/deps/rabbit_common/mk/rabbitmq-dist.mk:203: plugins/rabbitmq_cloudwatch_exporter-1.0.0.ez] Error 1
make[1]: Leaving directory '/home/luzhkovvv/code/rabbitmq-cloudwatch-exporter'
make: *** [/home/luzhkovvv/code/rabbitmq-cloudwatch-exporter/deps/rabbit_common/mk/rabbitmq-dist.mk:220: dist] Error 2
netbull commented 3 years ago

any update on this?

netbull commented 3 years ago

I can confirm that quick mix deps.update hackney fixed the issue and everything works fine

noxdafox commented 3 years ago

Updated releases with new versions.

netbull commented 3 years ago

That's great and thank you for that!

Unfortunately I needed something else and I created custom metric from the HTTP API :/ Simple PHP script to collect the data and PutMetricData.

ghost commented 3 years ago

Thank you very much for that fix. @noxdafox, you said you have updated releases with the new version, but I still can only see 1.0.0 in releases. Could you please check it?

netbull commented 3 years ago

according to the @noxdafox there is no need to bump the version of the plugin as only the dependencies are updates.. the "broken" ez file /hackney-1.16.0.ez/ however is updated

noxdafox commented 3 years ago

The release remains 1.0.0 but the release files have been updated.

ghost commented 3 years ago

Thanks, got it, still have some dependencies issues, hackney calls string_compat since 1.16, and while it seems to be provided by unicode_util_compat 0.5, we have unicode_util_compat 0.4.1 and no separate string_compat module, so get call to undefined function string_compat:to_lower

noxdafox commented 3 years ago

I'll check it asap, most likely I forgot to push some updated package.

noxdafox commented 3 years ago

Updated the other dependencies. Please let me know if you still experience issues.