Rabbitmq 3.8.5 User definition import not working

188 views
Skip to first unread message

Peter Hospodka

unread,
Jul 28, 2020, 5:42:39 PM7/28/20
to rabbitmq-users
Hello,

I am trying to import users intro rabbitmq using the management plugin UI.  It used to work but I am not sure when it stopped.  I have tried a couple iterations, one with the password in plaintext, and another where I created the user, exported it to get the sample, deleted the user and tried to re-import.  Both are accepted but report no errors on the UI nor in the logs.   I tried adding permissions to an existing user and that similarly did nothing.  When included in a file with other definitions (exchanges, queues, bindings) the other definitions load just fine.  It only seems to be the users and their permissions that silently do no work.   I am using rabbitmq version 3.8.5 running on Linux Mint.  Below are samples of what the imported json attempts were.  Is there any additional logging can that show me more? 

{
 
"users": [
   
{
     
"name": "testuser",
     
"password": "password",
     
"tags": "management"
   
}
 
]
}

{
 
"users": [
   
{
     
"name": "testuser",
     
"password_hash": "RFEsCXCXM1O4HL/nJG+T6KEX5RFdQ/KdYlQYmzBeCf7vi7O6",
     
"hashing_algorithm": "rabbit_password_hashing_sha256",
     
"tags": "management"
   
}
 
]
}
 
{
 
"permissions": [
   
{
     
"user": "testuser",
     
"vhost": "/",
     
"configure": ".*",
     
"write": ".*",
     
"read": ".*"
   
}
 
]
}

Luke Bakken

unread,
Jul 29, 2020, 11:44:44 AM7/29/20
to rabbitmq-users
Hello,


Thanks,
Luke

Luke Bakken

unread,
Jul 29, 2020, 11:45:48 AM7/29/20
to rabbitmq-users
Hello,

Actually you are describing a different issue. Please share a complete, un-edited definitions file that reproduces this issue.

Thanks,
Luke

Peter Hospodka

unread,
Jul 29, 2020, 6:13:45 PM7/29/20
to rabbitmq-users
Hello Luke!

I did see that other topic, but it looked like it was when loading at startup.  Mine is attempting  to load through the management UI.  I have attempts with two config files.  I'll share them inline, but can attach as files if you'd like.  Using RabbitMQ 3.8.5 and Erlang 23.0.3.

(1) first where the password is plaintext

{
 
"users": [
   
{
     
"name": "testuser",
     
"password": "password",
     
"tags": "management"
   
}

 
],

 
"permissions": [
   
{
     
"user": "testuser",
     
"vhost": "/",
     
"configure": ".*",
     
"write": ".*",
     
"read": ".*"
   
}
 
]
}

(2) second where the password is an export from a manual user creation (value is a hash of password).  

{
 
"users": [
   
{
     
"name": "testuser",
     
"password_hash": "RFEsCXCXM1O4HL/nJG+T6KEX5RFdQ/KdYlQYmzBeCf7vi7O6",
     
"hashing_algorithm": "rabbit_password_hashing_sha256",
     
"tags": "management"
   
}

 
],

 
"permissions": [
   
{
     
"user": "testuser",
     
"vhost": "/",
     
"configure": ".*",
     
"write": ".*",
     
"read": ".*"
   
}
 
]
}

Luke Bakken

unread,
Jul 30, 2020, 11:06:08 AM7/30/20
to rabbitmq-users
Hi Peter,

I tried the first import file which worked successfully using RabbitMQ version 3.8.6-rc.1. I saved it as /tmp/definitions.json, uploaded it in the management UI, and the user was created:

$ ./sbin/rabbitmqctl authenticate_user testuser password
Authenticating user "testuser" ...
Success

Thanks,
Luke
rabbitmq-3.8.6-user-created.png

Peter Hospodka

unread,
Jul 31, 2020, 6:17:35 PM7/31/20
to rabbitmq-users
Hey Luke,

It still fails on the one machine, but I tried it on a separate box in a docker container with the same RabbitMQ 3.8.5 and Erlang 23.0.3.  It works there.  Interestingly the logs look different.  For the machine that fails, it just mentions importing definitions, but not what was in it:

2020-07-31 17:03:36.404 [info] <0.24794.3> Asked to import definitions for a virtual host. Virtual host: <<"/">>, acting user: <<"guest">>

For the container that succeeds it says, it does not mention it is importing definitions, but does says it is importing individual things (users, permissions):

2020-07-31 22:07:51.749 [info] <0.1163.0> Importing concurrently 1 users...
2020-07-31 22:07:51.762 [info] <0.617.0> Created user 'testuser'
2020-07-31 22:07:51.766 [info] <0.617.0> Successfully set user tags for user 'testuser' to [management]
2020-07-31 22:07:51.766 [info] <0.1163.0> Importing concurrently 1 permissions...
2020-07-31 22:07:51.770 [info] <0.617.0> Successfully set permissions for 'testuser' in virtual host '/' to '.*', '.*', '.*'

The machine I was using is quite an old version.  I think still on a Ubuntu 14.04 base, so maybe a library just behaves differently.  I think this is probably okay since it does work elsewhere.  Thanks for checking.
Reply all
Reply to author
Forward
0 new messages