Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation of latest Rabbit (3.7) fails on EL7 due to erlang 20 dependency #788

Closed
tobixen opened this issue Apr 2, 2019 · 12 comments
Closed
Labels
needs-feedback Further information is requested

Comments

@tobixen
Copy link
Contributor

tobixen commented Apr 2, 2019

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 5.5.12
  • Ruby: ruby 2.0.0p648
  • Distribution: EL7 (CentOS7)
  • Module version: master (7613f08)

How to reproduce (e.g Puppet code you use)

rabbitmq::repos_ensure is set to true in hieradata, except for that I'm doing a plain
"include rabbitmq"

What are you seeing

It seems like the 3.7-version of rabbitmq requires a newer erlang than what comes out of the box with EL7. I believe this can be fixed by setting up the correct repository for newer erlang as well.

Error: Execution of '/usr/bin/yum -d 0 -e 0 -y install rabbitmq-server' returned 1: Error: Package: rabbitmq-server-3.7.14-1.el7.noarch (rabbitmq_rabbitmq-server)
           Requires: erlang >= 20.3
           Available: erlang-R16B-03.18.el7.x86_64 (epel)
               erlang = R16B-03.18.el7
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest
Error: /Stage[main]/Rabbitmq::Install/Package[rabbitmq-server]/ensure: change from 'purged' to 'present' failed: Execution of '/usr/bin/yum -d 0 -e 0 -y install rabbitmq-server' returned 1: Error: Package: rabbitmq-server-3.7.14-1.el7.noarch (rabbitmq_rabbitmq-server)
           Requires: erlang >= 20.3
           Available: erlang-R16B-03.18.el7.x86_64 (epel)
               erlang = R16B-03.18.el7
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

What behaviour did you expect instead

I did expect the puppet module to organize the latest erlang version for me as well.

Output log

Notice: /Stage[main]/Rabbitmq::Repo::Rhel/Yumrepo[rabbitmq]/ensure: created
Info: Yumrepo[rabbitmq](provider=inifile): changing mode of /etc/yum.repos.d/rabbitmq_rabbitmq-server.repo from 600 to 644
Notice: /Stage[main]/Rabbitmq::Repo::Rhel/Exec[rpm --import https://www.rabbitmq.com/rabbitmq-release-signing-key.asc]/returns: executed successfully
(...)
Notice: /Stage[main]/Rabbitmq::Config/File[/etc/rabbitmq]: Dependency Package[rabbitmq-server] has failures: true

Any additional information you'd like to impart

  • Without setting rabbitmq::repos_ensure to true, rabbitmq gets up and running, but on version 3.3.5.
  • I tried setting up the repos for erlang and rabbitmq outside this module, then I got rabbit 3.7 installed, though it did not want to start due to a permission problem with /var/lib/rabbitmq/.erlang.cookie
@wyardley
Copy link
Contributor

wyardley commented Apr 2, 2019

I think the README documents that the erlang dep has to be satisfied externally. Unfortunately, the puppet erlang module recommended there doesn’t seem to be well maintained anymore.

I have run across the same problem when testing things. If you want to do a pass at reworking things, I’d be happy to review the PR. One option would be a new param, disabled by default, to use the rmq provided erlang package

On the permissions problem, you may want to file a separate issue.

@tobixen
Copy link
Contributor Author

tobixen commented Apr 3, 2019

As far as I can see, there is no information in the README (though I am not very skilled on reading documentation, may be I've overlooked something).

The README is quite short and references the REFERENCE file - which is quite big. I was doing some searching through the REFERENCE file yesterday without finding anything obvious.

Hence the documentation probably ought to be improved, as a minimum.

I think letting the module set up the rabbitmq-erlang repo if a parameter is set to "true" (and cross-documented from the repos_ensure) is a reasonable fix for this issue (obviously we don't want to break backward compatibility, but a parameter with the name "repos_ensure" ought to fix all needed repositories). I probably don't have capacity to deal with this myself anytime soon, and my motivation for fixing it has also been reduced now as I already got rabbitmq up and working now.

@tobixen tobixen changed the title Can't install Rabbit 3.7 on EL7? Installation of latest Rabbit (3.7) fails on EL7 due to erlang 20 dependency Apr 3, 2019
@tobixen
Copy link
Contributor Author

tobixen commented Apr 3, 2019

(The permission problem disappeared when letting puppet-rabbitmq control the rabbitmq-server repo and controlling the rabbitmq-erlang repo on my side. I find it bizarre ... but I don't have capacity to try to reproduce it at the moment).

@wyardley
Copy link
Contributor

wyardley commented Apr 3, 2019

Yes, you’re right, in fact, I took out those docs, probably because they were so out of date, in af1c79b
and they’ve never gotten replaced 😓

https://www.rabbitmq.com/which-erlang.html is a good breakdown of the different ways of handling the erlang deps. If someone can take a stab at improving the docs and / or implementing an option to allow installing the erlang deps, that would be great.

@dhoppe
Copy link
Member

dhoppe commented May 2, 2019

This also affects Debian and Ubuntu. Maybe we should migrate to Bintray, since they also provide packages for Erlang.

sudo tee /etc/apt/sources.list.d/bintray.rabbitmq.list <<EOF
deb https://dl.bintray.com/rabbitmq-erlang/debian bionic erlang
deb https://dl.bintray.com/rabbitmq/debian bionic main
EOF

@dhoppe dhoppe added the needs-feedback Further information is requested label May 2, 2019
@wyardley
Copy link
Contributor

wyardley commented May 3, 2019

Maybe we should migrate to Bintray, since they also provide packages for Erlang.

@dhoppe This is probably one of the better options.
But, if you check out the link above, there are some things to think about -- specifically, the bintray version could conflict with other versions of Erlang the user wants to install, and may not satisfy everyone's requirements. Also, different RMQ versions require different erlang versions (see matrix above). So this would probably need to be implemented as a new, separate option from repos_ensure or whatever, as well as maybe an option to allow setting the preferred version?

@ToonSpinISAAC
Copy link

I'm now using this module for the first time, so perhaps my perspective on things might be helpful.

I am not very familiar with RabbitMQ or Erlang at all. So for me, it would have been very helpful to have a parameter I could pass to rabbitmq that would have it set up Bintray for Erlang along with RabbitMQ, or even to have that be the default behavior.

the bintray version could conflict with other versions of Erlang the user wants to install

This is totally not a concern for me, and I expect that goes for many people like me: my use case for this module is that I need to set up a Linux box with RabbitMQ on it for a Magento installation that resides on another node, and nobody in my entire company does anything at all with Erlang.

My two cents would be to make it optional for people to have other versions of Erlang on their nodes, and to have them pass in a false value to some parameter of rabbitmq if they don't want repos_ensure to manage Erlang for them. If someone wants rabbitmq to manage RabbitMQ over Bintray but not Erlang, then my guess they will know what they are doing and will look for this sort of option in the documentation.

The way the module works now, I have to spend time looking into how to get the correct version of Erlang to install - I'm glad you're being considerate of what I might want to do with Erlang but since I honestly don't know, I'd rather you show a little less concern. :)

@italicninja
Copy link

  • Puppet: 6.19.1
  • Ruby: ruby 2.0.0p648
  • Distribution: EL7 (CentOS7 7.8.2003)
  • Module version: Forge 10.2.0
  • Rabbit version: 3.8.9
  • Erlang version: 23.2.1

I needed to deploy rabbitmq as well for my shop and have encountered this problem. I was able to install erlang like so:

package { 'erlang':
  ensure   => 'present',
  provider => 'rpm',
  source   => 'https://github.com/rabbitmq/erlang-rpm/releases/download/v23.2.1/erlang-23.2.1-1.el7.x86_64.rpm',
  before   => Package['rabbitmq-server'],
}

Which does end up working correctly on the cli rabbitmqctl.

[root@rabbit1 ~]# rabbitmqctl add_user admin admin
Adding user "admin" ...
[root@rabbit1 ~]# rabbitmqctl set_user_tags admin administrator
Setting tags for user "admin" to [administrator] ...

However the module starts throwing errors during runs:

Error: Could not prefetch rabbitmq_user provider 'rabbitmqctl': Cannot parse invalid user line: warning: the VM is running with native name encoding of latin1 which may cause Elixir to malfunction as it expects utf8. Please ensure your locale is set to UTF-8 (which can be verified by running "locale" in your shell)

I can work around this for now but just wanted to provide some addition information when upgrading to a newer rabbit/erlang version.

@wyardley
Copy link
Contributor

wyardley commented Jan 8, 2021

Have you tried configuring the system’s locale to utf-8? There are some existing workarounds in the module that try to force it in the env of commands that run but could be that.

@wyardley
Copy link
Contributor

wyardley commented Jan 8, 2021

ps - as far as Erlang goes, once the puppet-erlang module actually gets released, I’m hoping someone will work on getting the changes in #845 to work, which I think would help with some of these issues.

@italicninja
Copy link

Have you tried configuring the system’s locale to utf-8? There are some existing workarounds in the module that try to force it in the env of commands that run but could be that.

I've tried what I could think of. My system appears to be utf-8 already. Searching for this error yeilds really old threads mostly and I've tried some of the solutions in those.

[root@rabbit1 ~]# locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

I think this related to the newer version of Rabbit, as using the repos_ensure: true and using an updated version of erlang is the way to get this error. If I do not specifiy any user creation like this:

   rabbitmq_user { 'admin':
     admin    => true,
     password => $rabbitmq_admin_password,
     provider => 'rabbitmqctl',
     require  => Class['rabbitmq']
   }

Then Puppet runs cleanly. So it may be directly related to that provider or something it inherits. Sadly my Ruby isn't good :(

@wyardley
Copy link
Contributor

Going to close this since el7 isn’t supported any longer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-feedback Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants