Giter Club home page Giter Club logo

Comments (5)

matthewbarr avatar matthewbarr commented on May 26, 2024

What's odd is that it looks like that's a python error, not a ruby one. I can run the commands that the mcollective module is trying without an issue on the command line without issue. Only when it's run by puppet is it an issue.

(This is a vagrant install of mcollective, for testing and debugging this problem. it uses the defaults :)

Error: Could not prefetch rabbitmq_exchange provider 'rabbitmqadmin': Execution of '/usr/local/bin/rabbitmqadmin list exchanges' returned 1: Traceback (most recent call last):
File "/usr/local/bin/rabbitmqadmin", line 939, in
main()
File "/usr/local/bin/rabbitmqadmin", line 370, in main
(options, args) = make_configuration()
File "/usr/local/bin/rabbitmqadmin", line 319, in make_configuration
config_file = default_config()
File "/usr/local/bin/rabbitmqadmin", line 310, in default_config
return home + os.sep + ".rabbitmqadmin.conf"
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

Error: Execution of '/usr/local/bin/rabbitmqadmin declare exchange --vhost=/mcollective --user=admin --password=secret name=mcollective_broadcast type=topic' returned 1: Traceback (most recent call last):
File "/usr/local/bin/rabbitmqadmin", line 939, in
main()
File "/usr/local/bin/rabbitmqadmin", line 370, in main
(options, args) = make_configuration()
File "/usr/local/bin/rabbitmqadmin", line 319, in make_configuration
config_file = default_config()
File "/usr/local/bin/rabbitmqadmin", line 310, in default_config
return home + os.sep + ".rabbitmqadmin.conf"
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

from puppet-rabbitmq.

matthewbarr avatar matthewbarr commented on May 26, 2024

Found the issue: RabbitMQ 3.2.0 broke the behavior of the provider. The command doesn't work when run via puppet.

Using the rabbitmqadmin from 3.1.5, - https://raw.github.com/rabbitmq/rabbitmq-management/rabbitmq_v3_1_5/bin/rabbitmqadmin - the provider works just perfectly.

I've opened a bug on their side, since this shouldn't break,
rabbitmq/rabbitmq-management#10

Would it be easier to just the API for this? vs getting rabbitmqadmin?

from puppet-rabbitmq.

Moozaliny avatar Moozaliny commented on May 26, 2024

This error appears because the puppet user has no bash configuration by default. (keyword: /etc/passwd)
Just as quick fix proposal you can do something like this:

define components::rabbitmq::exchange (
  $vhost    = '',
  $type     = '',
  $user     = '',
  $password = '',
) {

  exec { "declare exchange ${name}":
    command     => "/usr/local/bin/rabbitmqadmin declare exchange --vhost=${vhost} --user=${user} --password=${password} name=${name} type=${type}",
    environment => 'HOME=/var/lib/puppet:/bin/bash',
    user        => 'root'
  }
}

from puppet-rabbitmq.

matthewbarr avatar matthewbarr commented on May 26, 2024

Thanks- i'd love to use that, but... the call is actually by the puppetlabs-mcollective module, and i'd prefer to avoid patching that.

For now, i'm just putting the "right" version of the admin tool into the correct place, so the code doesn't try to download it. That way, the type call actually works.

from puppet-rabbitmq.

matthewbarr avatar matthewbarr commented on May 26, 2024

Looks like it was resolved in RMQ 3.2.2, via my bug 25920.

from puppet-rabbitmq.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.