Score:1

failed_to_parse_configuration_file on rabbitmq

us flag

So I just wanted to change default username password from guest to sth else on rabbitmq but nothing works for me... this is my rabbitmq.conf

[
  {rabbit,
    [
      {default_vhost,       <<"/">>},
      {default_user,        <<"itsme">>},
      {default_pass,        <<"ok">>}
    ]
  }
].

and my docker-compose:

  rabbitmq:
    image: rabbitmq:3-management-alpine
    container_name: rabbitmq
    hostname: rabbitmq
    restart: always
    # Also tried env_file and environment variables
    # env_file:
    #     - ./docs/server/stack/dev/configs/rabbitmq/.env
    # environment:
    #   RABBITMQ_DEFAULT_USER: itsme
    #   RABBITMQ_DEFAULT_PASS: ok
    ports:
      - 5672:5672
      - 15672:15672
    volumes:
      - ./configs/rabbitmq/rabbitmq.conf:/etc/rabbitmq/rabbitmq.conf:ro
    networks:
      - rabbitmq_network

and error that i get:

    BOOT FAILED
    
    ===========
    
    Error during startup: {error,failed_to_parse_configuration_file}
    
    Application rabbitmq_prelaunch exited with reason: {{shutdown,{failed_to_start_child,prelaunch,failed_to_parse_configuration_file}},{rabbit_prelaunch_app,start,[normal,[]]}}

{"Kernel pid terminated",application_controller,"{application_start_failure,rabbitmq_prelaunch,{{shutdown,{failed_to_start_child,prelaunch,failed_to_parse_configuration_file}},{rabbit_prelaunch_app,start,[normal,[]]}}}"}

2022-01-03 11:50:58.446386+00:00 [erro] <0.130.0> Error parsing configuration:

2022-01-03 11:50:58.464588+00:00 [erro] <0.130.0>   - Syntax error in /etc/rabbitmq/rabbitmq.conf after line 1 column 1, parsing incomplete

2022-01-03 11:50:58.464617+00:00 [erro] <0.130.0> Are these files using the Cuttlefish format?

i also tried to do it as config file:

default_user = itsme
default_pass = ok
stomp.default_user = itsme
stomp.default_pass = ok
mqtt.default_user = itsme
mqtt.default_pass = ok
amqp1_0.default_user = itsme

and errors:

{rabbit_prelaunch_app,start,[normal,[]]}}

{"Kernel pid terminated",application_controller,"{application_start_failure,rabbitmq_prelaunch,{{shutdown,{failed_to_start_child,prelaunch,failed_to_read_advanced_configuration_file}},{rabbit_prelaunch_app,start,[normal,[]]}}}"}

2022-01-03 12:20:01.457976+00:00 [erro] <0.130.0> Failed to load advanced configuration file "/etc/rabbitmq/rabbitmq.config": 2: syntax error before: default_pass
Score:0
kr flag

For me, the issue was that the file was named with the ".config" suffix. ".config" is for the advanced configuration.

Modifying it to ".conf" resolved the issue for me.

Reference: https://www.rabbitmq.com/configure.html#config-file

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.