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

rabbitmq_user.present error #33588

Closed
whytewolf opened this issue May 27, 2016 · 12 comments
Closed

rabbitmq_user.present error #33588

whytewolf opened this issue May 27, 2016 · 12 comments
Labels
Bug broken, incorrect, or confusing behavior Confirmed Salt engineer has confirmed bug/feature - often including a MCVE P2 Priority 2 RIoT Relates to integration with cloud providers, hypervisors, API-based services, etc. severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around State-Module
Milestone

Comments

@whytewolf
Copy link
Collaborator

whytewolf commented May 27, 2016

Description of Issue/Question

with 2 users being maintained by rabbitmq_user.present from older builds. on the latest release 2016.3.0 rabbitmq_user.present has an odd error. this setup worked before since at least 2015.5.5

Setup

(Please provide relevant configs and/or SLS files (Be sure to remove sensitive info).)

openstack rabbit user:
  rabbitmq_user.present:
    - name: openstack
    - password: password1
    - perms: [{/: [.*, .*, .*]}]


whytewolf rabbit user:
  rabbitmq_user.present:
    - name: whytewolf
    - password: password2
    - perms: [{/: [.*, .*, .*]}]
    - tags: [administrator]

[DEBUG   ] Results of YAML rendering:
OrderedDict([('openstack rabbit user', OrderedDict([('rabbitmq_user.present', [OrderedDict([('name', 'openstack')]), OrderedDict([('password', 'password1')]), OrderedDict([('perms', [OrderedDict([('/', ['.*', '.*', '.*'])])])])])])), ('whytewolf rabbit user', OrderedDict
([('rabbitmq_user.present', [OrderedDict([('name', 'whytewolf')]), OrderedDict([('password', 'password2')]), OrderedDict([('perms', [OrderedDict([('/', ['.*', '.*', '.*'])])])]), OrderedDict([('tags', ['administrator'])])])]))])

[DEBUG   ] LazyLoaded rabbitmq_user.present
[INFO    ] Running state [openstack] at time 09:02:54.112737
[INFO    ] Executing state rabbitmq_user.present for openstack
[INFO    ] Executing command ['rabbitmqctl', 'list_users'] as user 'root' in directory '/root'
[DEBUG   ] output: Listing users ...
whytewolf       [administrator]
openstack       []
guest   [administrator]
[DEBUG   ] {'openstack': set(['']), 'whytewolf': set(['administrator']), 'guest': set(['administrator'])}
[ERROR   ] Error: RabbitMQ command failed: Error: {undef,
           [{rabbit_auth_backend_internal,check_user_login,
                [<<"openstack">>,[{password,<<"password1">>}]],
                []},
            {erl_eval,do_apply,6,[{file,"erl_eval.erl"},{line,569}]},
            {rpc,'-handle_call_call/6-fun-0-',5,
                [{file,"rpc.erl"},{line,205}]}]}
[INFO    ] Completed state [openstack] at time 09:02:55.139276 duration_in_ms=1026.539
[INFO    ] Running state [whytewolf] at time 09:02:55.139548
[INFO    ] Executing state rabbitmq_user.present for whytewolf
[INFO    ] Executing command ['rabbitmqctl', 'list_users'] as user 'root' in directory '/root'
[DEBUG   ] output: Listing users ...
whytewolf       [administrator]
openstack       []
guest   [administrator]
[DEBUG   ] {'openstack': set(['']), 'whytewolf': set(['administrator']), 'guest': set(['administrator'])}
[ERROR   ] Error: RabbitMQ command failed: Error: {undef,
           [{rabbit_auth_backend_internal,check_user_login,
                [<<"whytewolf">>,[{password,<<"password2">>}]],
                []},
            {erl_eval,do_apply,6,[{file,"erl_eval.erl"},{line,569}]},
            {rpc,'-handle_call_call/6-fun-0-',5,
                [{file,"rpc.erl"},{line,205}]}]}
[INFO    ] Completed state [whytewolf] at time 09:02:56.194518 duration_in_ms=1054.97

rabbitmq version is 3.6.2

Versions Report

(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)

rabbitmq-server.noarch                  3.6.2-1                        @/rabbitmq-server-3.6.2-1.noarch
salt-call --versions
Salt Version:
           Salt: 2016.3.0

Dependency Versions:
           cffi: 1.5.2
       cherrypy: Not Installed
       dateutil: 1.5
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.7.2
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: 0.8.1
   msgpack-pure: Not Installed
 msgpack-python: 0.4.7
   mysql-python: 1.2.3
      pycparser: 2.14
       pycrypto: 2.6.1
         pygit2: Not Installed
         Python: 2.7.5 (default, Nov 20 2015, 02:00:19)
   python-gnupg: Not Installed
         PyYAML: 3.11
          PyZMQ: 14.7.0
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.0.5

System Versions:
           dist: centos 7.2.1511 Core
        machine: x86_64
        release: 3.10.0-327.13.1.el7.x86_64
         system: Linux
        version: CentOS Linux 7.2.1511 Core

salt was installed from repo.saltstack.com

@glomium
Copy link
Contributor

glomium commented May 27, 2016

Got the same error. Creating new users via rabbitmq_user.present works fine.

Salt Version:
           Salt: 2016.3.0rc3

Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: Not Installed
          gitdb: 0.6.4
      gitpython: 1.0.1
          ioflo: Not Installed
         Jinja2: 2.8
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: 0.21.1
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.4.6
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
         pygit2: Not Installed
         Python: 2.7.11+ (default, Apr 17 2016, 14:00:29)
   python-gnupg: Not Installed
         PyYAML: 3.11
          PyZMQ: 15.2.0
           RAET: Not Installed
          smmap: 0.9.0
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.1.4

System Versions:
           dist: Ubuntu 16.04 xenial
        machine: x86_64
        release: 4.4.0-21-generic
         system: Linux
        version: Ubuntu 16.04 xenial
RabbitMQ 3.5.7
Erlang/OTP 18 [erts-7.3]

@Ch3LL
Copy link
Contributor

Ch3LL commented May 28, 2016

hmm this is definitely odd behavior. I was only able to replicate this after upgrading from rabbitmq server 3.1 to rabbitmq-server-3.6.2-1.noarch.

As stated before this is still able to create a new user but then starts to error once run twice.

@Ch3LL Ch3LL added Bug broken, incorrect, or confusing behavior RIoT Relates to integration with cloud providers, hypervisors, API-based services, etc. State-Module P2 Priority 2 severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around labels May 28, 2016
@Ch3LL Ch3LL added this to the Approved milestone May 28, 2016
@Ch3LL Ch3LL added the Confirmed Salt engineer has confirmed bug/feature - often including a MCVE label May 28, 2016
@glomium
Copy link
Contributor

glomium commented May 28, 2016

Looks like it has to do with check_password in modules/rabbitmq.py.

salt-call rabbitmq.check_password user password

RabbitMQ 3.5.7 introduced a authenticate_user method to the cli. Replacing the eval in check_password from modules/rabbitmq.py with this works fine, but breaks backwards compatibility.

@pkruithof
Copy link
Contributor

Is there a workaround for this, without changing the modules/rabbitmq.py file?

@glomium
Copy link
Contributor

glomium commented May 31, 2016

@pkruithof
Copy link
Contributor

I can confirm that it solves my issue 👍

@rallytime
Copy link
Contributor

Thanks everyone! I've back-ported this fix to 2016.3 branch in #33723. This fix will be available in the next release.

@atengler
Copy link

Hi, PR #33734 needs to be backported to 2016.3 branch, because the feature was backported as well, rabbitmq module is not functioning properly at its current state with rabbitmq version 3.6+ in 2016.3.1 packaged release of Salt

@rallytime
Copy link
Contributor

@atengler Thanks for letting us know. I have back-ported this to 2016.3 in #34304.

@atengler
Copy link

It seems PR #33734 is still not in 2016.3 branch, can you please look at it?

@rallytime
Copy link
Contributor

Ah, apologies. I submitted the change against the develop branch accidentally. #34333 is against the 2016.3 branch.

@rallytime
Copy link
Contributor

@atengler ^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior Confirmed Salt engineer has confirmed bug/feature - often including a MCVE P2 Priority 2 RIoT Relates to integration with cloud providers, hypervisors, API-based services, etc. severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around State-Module
Projects
None yet
Development

No branches or pull requests

6 participants