Reputation: 382
I am trying to configure RabbitMQ using rabbitmq.config. I am getting error {could_not_start,rabbit,{error,<<"{not_base64,<<\"guest\">>}">>}}
I have created rabbitmq.conf and definitions.json
[
{rabbit, [
{loopback_users, []}
]},
{rabbitmq_management, [
{load_definitions, "/etc/rabbitmq/definitions.json"}
]}
].
{
"rabbit_version": "3.6.6",
"users": [
{
"name": "guest",
"password_hash": "abcd",
"hashing_algorithm": "rabbit_password_hashing_sha256",
"tags": ""
},
{
"name": "admin",
"password_hash": "abcd",
"hashing_algorithm": "rabbit_password_hashing_sha256",
"tags": "administrator"
}
],
"vhosts": [
{
"name": "\/abc"
}
],
"permissions": [
{
"user": "guest",
"vhost": "\/abc",
"configure": ".*",
"write": ".*",
"read": ".*"
}
],
"parameters": [],
"policies": [],
"queues": [],
"exchanges": [],
"bindings": []
}
Docker-compose file
rabbitmq:
image: rabbitmq
container_name: rabbitmq
hostname: rabbitmq
ports:
- "5672:5672"
- "15672:15672"
volumes:
- ./path/rabbitmq.config:/etc/rabbitmq/rabbitmq.config:ro
- ./path/definitions.json:/etc/rabbitmq/definitions.json:ro
Error log:
=CRASH REPORT==== 30-Sep-2019::18:50:35 ===
rabbitmq | crasher:
rabbitmq | initial call: application_master:init/4
rabbitmq | pid: <1.123.1>
rabbitmq | registered_name: []
rabbitmq | exception exit: {bad_return,
rabbitmq | {{rabbit,start,[normal,[]]},
rabbitmq | {'EXIT',{error,<<"{not_base64,<<\"guest\">>}">>}}}}
rabbitmq | in function application_master:init/4 (application_master.erl, line 134)
rabbitmq | ancestors: [<0.136.0>]
rabbitmq | messages: []
rabbitmq | links: [<1.124.1>,<1.128.1>,<1.31.1>]
rabbitmq | dictionary: []
rabbitmq | trap_exit: true
rabbitmq | status: running
rabbitmq | heap_size: 587
rabbitmq | stack_size: 21
rabbitmq | reductions: 97
rabbitmq | neighbours:
What mistake I am making? It looks like I am making some mistake while configuring. But I am not able to identify it.
Upvotes: 0
Views: 1241
Reputation: 3262
The Value of password_hash is incorrect both for the guest account and for the admin account.
"password_hash": "abcd"
If you want to generate your own Hash then It is very nicely explained in this answer
How to generate password_hash for RabbitMQ Management HTTP API
Upvotes: 2