gotthardp / rabbitmq-email

SMTP Gateway Plugin for RabbitMQ
Mozilla Public License 2.0
179 stars 20 forks source link

plugin_built_with_incompatible_erlang #48

Closed softronsts closed 2 years ago

softronsts commented 2 years ago

Spent hours to compile at the end below is the result.

My env is Ubuntu 20.04 Erlang/OTP 24 [erts-12.2.1] elixir 1.10.4 rabbitmq 3.9.13

Could you please advise the lib stack required to build rabbitmq_email?

Error: Enabling plugins on node rabbit@rabbit: rabbitmq_email The following plugins have been configured: rabbitmq_email rabbitmq_management rabbitmq_management_agent rabbitmq_web_dispatch Applying plugin configuration to rabbit@rabbit... Stack trace:

** (CaseClauseError) no case clause matching: {:plugin_built_with_incompatible_erlang, 'rabbitmq_email'} (rabbitmqctl 3.8.0-dev) lib/rabbitmq/cli/plugins/plugins_helpers.ex:210: RabbitMQ.CLI.Plugins.Helpers.update_enabled_plugins/2 (rabbitmqctl 3.8.0-dev) lib/rabbitmq/cli/plugins/plugins_helpers.ex:107: RabbitMQ.CLI.Plugins.Helpers.update_enabled_plugins/4 (rabbitmqctl 3.8.0-dev) lib/rabbitmq/cli/plugins/commands/enable_command.ex:121: anonymous fn/6 in RabbitMQ.CLI.Plugins.Commands.EnableCommand.do_run/2 (elixir 1.10.4) lib/stream.ex:1325: anonymous fn/2 in Stream.iterate/2 (elixir 1.10.4) lib/stream.ex:1538: Stream.do_unfold/4 (elixir 1.10.4) lib/stream.ex:1609: Enumerable.Stream.do_each/4 (elixir 1.10.4) lib/stream.ex:956: Stream.do_enum_transform/7 (elixir 1.10.4) lib/stream.ex:1609: Enumerable.Stream.do_each/4

{:case_clause, {:plugin_built_with_incompatible_erlang, 'rabbitmq_email'}}

lukebakken commented 2 years ago

Thanks for the information. I'd also like to know which commands you're running to build this plugin and then copy it your RabbitMQ 3.9.13 installation.

In general, you should build this plugin using the minimum supported Erlang for the version of RabbitMQ you wish to use - https://www.rabbitmq.com/which-erlang.html

In this case, that means Erlang 23.2 and Elixir 1.10.4. I will make sure that the README reflects this. I also just realized I should improve the build instructions there.

I have attached a transcript of a successful build (truncated to remove excessive noise), installation, enablement and start of RabbitMQ using the master branch of this plugin. I'm running RabbitMQ using Erlang 24.2.2:

transcript.txt

Basically, these are the commands I ran in my clone of this repo:

git clean -xffd
asdf local erlang 23.2; asdf local elixir 1.10.4-otp-23
make
make dist
rsync -a plugins/rabbitmq_email-1.0.0 /home/bakkenl/rmq-server/rabbitmq_server-3.9.13/plugins/
rsync -a plugins/eiconv-1.0.0 /home/bakkenl/rmq-server/rabbitmq_server-3.9.13/plugins/
rsync -a plugins/gen_smtp-1.2.0-dev /home/bakkenl/rmq-server/rabbitmq_server-3.9.13/plugins/
a-marcellini commented 2 years ago

You are syncing the dev. version of gen_smtp, however in the readme you declare the dependency to the 1.1.1. What's more I'm not sure if your code acknowledges the mimemail encode modification: from list to map. here the code

I'm not an erlang expert, however, I think that the code doesn't use maps as parameter but it uses lists:

Look at rabbit_email_sender.erl row 22 as an example, 4th parameter: Message = mimemail:encode({Type, Subtype, lists:foldr(fun set_header/2, [], Headers2), [], Payload}),

lukebakken commented 2 years ago

@a-marcellini I noticed the gen_smtp dependency as well and was going to investigate it today. Thanks for pointing out the other line as well. In the future, please feel free to open pull requests if you find something to fix!

https://github.com/gen-smtp/gen_smtp/issues/205

lukebakken commented 2 years ago

@softronsts please see the build instructions here - https://github.com/gotthardp/rabbitmq-email#installation

lukebakken commented 2 years ago

https://github.com/gotthardp/rabbitmq-email/releases/tag/v1.0.1

softronsts commented 2 years ago

Thanks for your help. Managed to install the plugin. asdf erlang is a kill in ubuntu 20.04. Pinned to specific version and got erlang working without asdf. elixir should be handled via asdf.

a-marcellini commented 2 years ago

I'm unable to do a pull request. I've just created a Issue (51) and a local branch (gh-51), which I cannot push for lack of permissions:

@. rabbitmq-email (gh-51) $ git push --set-upstream origin gh-51 Username for 'https://github.com': @. Password for @.***@github.com': remote: Permission to gotthardp/rabbitmq-email.git denied to a-marcellini. fatal: unable to access 'https://github.com/gotthardp/rabbitmq-email.git/': The requested URL returned error: 403

Let me know if I can try again in the future Regards Alessandro

Il giorno mar 8 mar 2022 alle ore 14:53 Luke Bakken < @.***> ha scritto:

@a-marcellini https://github.com/a-marcellini I noticed the gen_smtp dependency as well and was going to investigate it today. Thanks for pointing out the other line as well. In the future, please feel free to open pull requests if you find something to fix!

— Reply to this email directly, view it on GitHub https://github.com/gotthardp/rabbitmq-email/issues/48#issuecomment-1061802408, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXVNDQRAAT5QDY2I7GYI3HTU65LV7ANCNFSM5QDTS2ZA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

lukebakken commented 2 years ago

@a-marcellini you'll find the GitHub docs helpful - https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests

To contribute to this repository, you fork it to your GitHub account and then push your local branch to your fork. Then you can use the GitHub web site to open the pull request.

At any rate, I have fixed the issue and re-tagged version 1.0.1.

Thanks everyone!