deadtrickster / prometheus_rabbitmq_exporter

Prometheus.io exporter as a RabbitMQ Managment Plugin plugin
MIT License
291 stars 72 forks source link

Failed to enable plugin "prometheus_process_collector": it may have been built with an incompatible (more recent?) version of Erlang #31

Closed jperville closed 7 years ago

jperville commented 7 years ago

I am building a custom rabbitmq docker images (based on the official rabbitmq 3.6.12 image) that includes this collector. The image builds successfully but running it fails with the following message:

Failed to enable plugin "prometheus_process_collector": it may have been built with an incompatible (more recent?) version of Erlang

Would it be possible to release new binaries of this plugin that are compatible with the current version of the official rabbitmq:3.6.12 docker image? Thank you very much.

Here is the Dockerfile I used:

$ cat Dockerfile
FROM rabbitmq:3.6.12

# prometheus exporter plugin
ADD ["https://github.com/deadtrickster/prometheus_rabbitmq_exporter/releases/download/rabbitmq-3.6.12.1/accept-0.3.3.ez", \
     "https://github.com/deadtrickster/prometheus_rabbitmq_exporter/releases/download/rabbitmq-3.6.12.1/prometheus-3.4.0.ez", \
     "https://github.com/deadtrickster/prometheus_rabbitmq_exporter/releases/download/rabbitmq-3.6.12.1/prometheus_httpd-2.1.4.ez", \
     "https://github.com/deadtrickster/prometheus_rabbitmq_exporter/releases/download/rabbitmq-3.6.12.1/prometheus_process_collector-1.1.0.ez", \
     "https://github.com/deadtrickster/prometheus_rabbitmq_exporter/releases/download/rabbitmq-3.6.12.1/prometheus_rabbitmq_exporter-v3.6.12.1.ez", \
     "/usr/lib/rabbitmq/lib/rabbitmq_server-${RABBITMQ_VERSION}/plugins/"]
RUN chmod a+r /usr/lib/rabbitmq/lib/rabbitmq_server-${RABBITMQ_VERSION}/plugins/prometheus*.ez /usr/lib/rabbitmq/lib/rabbitmq_server-${RABBITMQ_VERSION}/plugins/accept*.ez \
    && rabbitmq-plugins enable --offline accept prometheus_rabbitmq_exporter prometheus_process_collector prometheus_httpd \
    && chmod -R 777 /etc/rabbitmq
$ docker build -t myrabbitmq .
$ docker run --rm -ti myrabbitmq

=ERROR REPORT==== 3-Oct-2017::10:00:34 ===
Loading of /var/lib/rabbitmq/mnesia/rabbit@99e8e5aaa7e3-plugins-expand/prometheus_process_collector-1.1.0/ebin/prometheus_process_collector.beam failed: badfile

=ERROR REPORT==== 3-Oct-2017::10:00:34 ===
beam/beam_load.c(1287): Error loading module prometheus_process_collector:
  mandatory chunk of type 'Atom' not found

BOOT FAILED
===========

Error description:
   {plugin_built_with_incompatible_erlang,"prometheus_process_collector"}

Log files (may contain more information):
   tty
   tty

Stack trace:
   [{rabbit_plugins,prepare_dir_plugin,1,
                    [{file,"src/rabbit_plugins.erl"},{line,236}]},
    {rabbit_plugins,'-prepare_plugins/1-lc$^0/1-0-',2,
                    [{file,"src/rabbit_plugins.erl"},{line,202}]},
    {rabbit_plugins,prepare_plugins,1,
                    [{file,"src/rabbit_plugins.erl"},{line,202}]},
    {rabbit,broker_start,0,[{file,"src/rabbit.erl"},{line,293}]},
    {rabbit,start_it,1,[{file,"src/rabbit.erl"},{line,417}]},
    {init,start_em,1,[]},
    {init,do_boot,3,[]}]

=ERROR REPORT==== 3-Oct-2017::10:00:34 ===
Failed to enable plugin "prometheus_process_collector": it may have been built with an incompatible (more recent?) version of Erlang

=INFO REPORT==== 3-Oct-2017::10:00:34 ===
Error description:
   {plugin_built_with_incompatible_erlang,"prometheus_process_collector"}

Log files (may contain more information):
   tty
   tty

Stack trace:
   [{rabbit_plugins,prepare_dir_plugin,1,
                    [{file,"src/rabbit_plugins.erl"},{line,236}]},
    {rabbit_plugins,'-prepare_plugins/1-lc$^0/1-0-',2,
                    [{file,"src/rabbit_plugins.erl"},{line,202}]},
    {rabbit_plugins,prepare_plugins,1,
                    [{file,"src/rabbit_plugins.erl"},{line,202}]},
    {rabbit,broker_start,0,[{file,"src/rabbit.erl"},{line,293}]},
    {rabbit,start_it,1,[{file,"src/rabbit.erl"},{line,417}]},
    {init,start_em,1,[]},
    {init,do_boot,3,[]}]

{"init terminating in do_boot",{plugin_built_with_incompatible_erlang,"prometheus_process_collector"}}
init terminating in do_boot ()

Crash dump is being written to: erl_crash.dump...%                                                                                                                                                                               
deadtrickster commented 7 years ago

Hi,

I recently rebuilt everything with R16B03 - https://github.com/deadtrickster/prometheus_rabbitmq_exporter/releases/tag/rabbitmq-3.6.12-pre18. I also modified Dockerfile to include local copies of the plugins as I always forgot to update the links :-)

Please let me know

jperville commented 7 years ago

I will try it up and report my success ASAP.

jperville commented 7 years ago

The rabbitmq-3.6.12-pre18 release works for me, closing this issue. Thank you @deadtrickster.