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 with password keyword throws exception #34481

Closed
L4rS6 opened this issue Jul 6, 2016 · 4 comments
Closed

rabbitmq_user.present with password keyword throws exception #34481

L4rS6 opened this issue Jul 6, 2016 · 4 comments
Labels
Bug broken, incorrect, or confusing behavior P3 Priority 3 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

@L4rS6
Copy link
Contributor

L4rS6 commented Jul 6, 2016

Description of Issue/Question

rabbitmq_user.present throws an exception if I try to set a password for the user.

Setup

rabbitmq.sls:

rabbitmq_user_testuser:
  rabbitmq_user.present:
    - name: testuser
    - password: mypasword
    - force: True
    - perms:
      - '/':
        - ''
        - ''
        - '.*'
    - runas: rabbitmq

Steps to Reproduce Issue

The following exception is thrown when the state above is executed:

----------
          ID: rabbitmq_user_testuser
    Function: rabbitmq_user.present
        Name: testuser
      Result: False
     Comment: Error: RabbitMQ command failed: Error: {undef,
                         [{rabbit_auth_backend_internal,check_user_login,
                              [<<"testuser">>,[{password,<<"mypassword">>}]],
                              []},
                          {erl_eval,do_apply,6,[{file,"erl_eval.erl"},{line,669}]},
                          {rpc,'-handle_call_call/6-fun-0-',5,
                              [{file,"rpc.erl"},{line,206}]}]}
     Started: 12:43:30.241647
    Duration: 1455.197 ms
     Changes:

Versions Report

Salt Version:
           Salt: 2016.3.1

Dependency Versions:
           cffi: 1.5.0
       cherrypy: 3.2.2
       dateutil: 1.5
          gitdb: 0.5.4
      gitpython: 0.3.2 RC1
          ioflo: Not Installed
         Jinja2: 2.7.2
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: 0.9.1
   msgpack-pure: Not Installed
 msgpack-python: 0.3.0
   mysql-python: 1.2.3
      pycparser: 2.14
       pycrypto: 2.6.1
         pygit2: Not Installed
         Python: 2.7.6 (default, Jun 22 2015, 17:58:13)
   python-gnupg: Not Installed
         PyYAML: 3.10
          PyZMQ: 14.0.1
           RAET: Not Installed
          smmap: 0.8.2
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.0.4

System Versions:
           dist: Ubuntu 14.04 trusty
        machine: x86_64
        release: 3.13.0-87-generic
         system: Linux
        version: Ubuntu 14.04 trusty
@Ch3LL
Copy link
Contributor

Ch3LL commented Jul 6, 2016

@L4rS6 I believe this to be a duplicate of #/33588

Can you verify if PR #33641 fixes this issue for you?

@Ch3LL Ch3LL added Duplicate Duplicate of another issue or PR - will be closed fixed-pls-verify fix is linked, bug author to confirm fix labels Jul 6, 2016
@Ch3LL Ch3LL added this to the Blocked milestone Jul 6, 2016
@L4rS6
Copy link
Contributor Author

L4rS6 commented Jul 7, 2016

@Ch3LL Unfortunately this doesn't fix my issue. We are already running the version which applies this fix.

It looks like the cmd is wrong. If I execute it on the CLI it looks like this:

sudo -s -u rabbitmq rabbitmqctl eval 'rabbit_auth_backend_internal:check_user_login(<<"testuser">>, [{{password, <<"mypassword">>}}]).'
Error: {undef,
           [{rabbit_auth_backend_internal,check_user_login,
                [<<"testuser">>,[{{password,<<"mypassword">>}}]],
                []},
            {erl_eval,do_apply,6,[{file,"erl_eval.erl"},{line,669}]},
            {rpc,'-handle_call_call/6-fun-0-',5,
                [{file,"rpc.erl"},{line,206}]}]}

And this is the salt module code:

cmd = ('rabbit_auth_backend_internal:check_user_login'
        '(<<"{0}">>, [{{password, <<"{1}">>}}]).').format(
        name.replace('"', '\\"'),
        password.replace('"', '\\"'))

We are running RabbitMQ 3.5.4.

@Ch3LL
Copy link
Contributor

Ch3LL commented Jul 7, 2016

@L4rS6 yes you are right the PR is actually already in 2016.3.1. Apologies for that. It does look like there is another PR included in the issue #33588 as well that was not included in 2016.3.1 here: #33734 but I am not certain it would actually resolve your issue because it seems like this fix was specific to rabbitmq versions greater then 3.5.7. Looks like rabbitmq added an api to check username/password in 3.5.7. Either way I'll change the labels on this issue to a bug so we can get it fixed up for 3.5.4

@Ch3LL Ch3LL added Bug broken, incorrect, or confusing behavior P3 Priority 3 severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around State-Module RIoT Relates to integration with cloud providers, hypervisors, API-based services, etc. and removed Duplicate Duplicate of another issue or PR - will be closed fixed-pls-verify fix is linked, bug author to confirm fix labels Jul 7, 2016
@cachedout
Copy link
Contributor

Closed via #35232

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 P3 Priority 3 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

3 participants