weixin_39658619
weixin_39658619
2020-12-26 00:44

Cannot provide rabbitmq.conf, crash on boot

I can't seem to bring my own rabbitmq.conf using a single-file volume. I get a crash report on boot that says

Could not open file (/etc/rabbitmq/rabbitmq.conf) for Reason einval

I'm using the latest 3.7.15 management image


$ docker pull rabbitmq:3.7.15-management-alpine
...

I got this error with my own custom conf, too, but I figured I'd reproduce with the default running conf.


$ docker run --name rabbitmq -d rabbitmq:3.7.15-management-alpine
<some-docker-container-id>
$ docker exec rabbitmq cat /etc/rabbitmq/rabbitmq.conf | tee rabbitmq.conf
loopback_users.guest = false    
listeners.tcp.default = 5672    
management.listener.port = 15672
management.listener.ssl = false
$ docker rm -f rabbitmq
</some-docker-container-id>

Then, I try using a simple single-file volume to bring just that conf file.


$ docker run --name rabbitmq -d -v "$(pwd)/rabbitmq.conf:/etc/rabbitmq/rabbitmq.conf" rabbitmq:3.7.15-management-alpine
<some-docker-container-id>
</some-docker-container-id>

And it fails immediately.


$ docker logs -f rabbitmq
BOOT FAILED
===========

Config file generation failed:
=CRASH REPORT==== 2-Jul-2019::17:43:19.833086 ===
  crasher:
    initial call: lager_handler_watcher:init/1
    pid: <0.94.0>
    registered_name: []
    exception exit: noproc
      in function  gen:do_for_proc/2 (gen.erl, line 228)
      in call from gen_event:rpc/2 (gen_event.erl, line 239)
      in call from lager_handler_watcher:install_handler2/3 (src/lager_handler_watcher.erl, line 117)
      in call from lager_handler_watcher:init/1 (src/lager_handler_watcher.erl, line 51)
      in call from gen_server:init_it/2 (gen_server.erl, line 374)
      in call from gen_server:init_it/6 (gen_server.erl, line 342)
    ancestors: [lager_handler_watcher_sup,lager_sup,<0.86.0>]
    message_queue_len: 0
    messages: []
    links: [<0.89.0>]
    dictionary: []
    trap_exit: false
    status: running
    heap_size: 610
    stack_size: 27
    reductions: 228
  neighbours:

17:43:20.715 [error] Could not open file (/etc/rabbitmq/rabbitmq.conf) for Reason einval
=SUPERVISOR REPORT==== 2-Jul-2019::17:43:20.716879 ===
    supervisor: {local,gr_counter_sup}
    errorContext: child_terminated
    reason: killed
    offender: [{pid,<0.96.0>},
               {id,gr_lager_default_tracer_counters},
               {mfargs,{gr_counter,start_link,
                                   [gr_lager_default_tracer_counters]}},
               {restart_type,transient},
               {shutdown,brutal_kill},
               {child_type,worker}]
=SUPERVISOR REPORT==== 2-Jul-2019::17:43:20.717047 ===
    supervisor: {local,gr_param_sup}
    errorContext: child_terminated
    reason: killed
    offender: [{pid,<0.95.0>},
               {id,gr_lager_default_tracer_params},
               {mfargs,{gr_param,start_link,[gr_lager_default_tracer_params]}},
               {restart_type,transient},
               {shutdown,brutal_kill},
               {child_type,worker}]


{"init terminating in do_boot",generate_config_file}
init terminating in do_boot (generate_config_file)

Crash dump is being written to: /var/log/rabbitmq/erl_crash.dump...done

I don't know what to do with this dump file or this EINVAL message.

该提问来源于开源项目:docker-library/rabbitmq

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

4条回答

  • weixin_39658619 weixin_39658619 4月前

    Maybe seems a little like https://github.com/docker-library/rabbitmq/issues/341?

    点赞 评论 复制链接分享
  • weixin_39976499 weixin_39976499 4月前

    That's an interesting error www.google.com/search?ei=vqMbXe-YNony-gSitI6IDg&q=Could+not+open+file+(%2Fetc%2Frabbitmq%2Frabbitmq.conf)+for+"Reason+einval"&oq=Could+not+open+file+(%2Fetc%2Frabbitmq%2Frabbitmq.conf)+for+"Reason+einval"

    I'm not able to reproduce and the only suggestions I have would be: try the Debian version (or maybe you have a corrupt layer that needs to be re-downloaded), ensure selinux/apparmor aren't interfering

    console
    $ cat rabbitmq.conf 
    loopback_users.guest = false    
    listeners.tcp.default = 5672    
    management.listener.port = 15672
    management.listener.ssl = false
    
    $ docker run -d --name rabid -v "$(pwd)/rabbitmq.conf:/etc/rabbitmq/rabbitmq.conf" rabbitmq:3.7.15-management-alpine   
    e16a0a9c064b523a79b2e1c1751fb087bf14590e76b314ba347cb3b32e5f6518
    
    $ docker logs -f rabid
    
      ##  ##                                                                                                                               
      ##  ##      RabbitMQ 3.7.15. Copyright (C) 2007-2019 Pivotal Software, Inc.                                                          
      ##########  Licensed under the MPL.  See https://www.rabbitmq.com/                                                                   
      ######  ##                                                                                                                           
      ##########  Logs: <stdout>                                                                                                           
    
                  Starting broker...                                                                                                       
    2019-07-02 18:42:00.297 [info] <0.223.0>                                                                                               
     Starting RabbitMQ 3.7.15 on Erlang 21.3.8.2                                                                                           
     Copyright (C) 2007-2019 Pivotal Software, Inc.                                                                                        
     Licensed under the MPL.  See https://www.rabbitmq.com/                                                                                
    2019-07-02 18:42:00.303 [info] <0.223.0>                                                                                               
     node           : rabbit                                                                                                  
     home dir       : /var/lib/rabbitmq                                                                                                    
     config file(s) : /etc/rabbitmq/rabbitmq.conf                                                                                          
     cookie hash    : gWCnNcfrqh1wr8ACBHyZTQ==                                                                                             
     log(s)         : <stdout>
     database dir   : /var/lib/rabbitmq/mnesia/rabbit
    2019-07-02 18:42:01.468 [info] <0.223.0> Running boot step pre_boot defined by app rabbit
    2019-07-02 18:42:01.468 [info] <0.223.0> Running boot step rabbit_core_metrics defined by app rabbit
    2019-07-02 18:42:01.468 [info] <0.223.0> Running boot step rabbit_alarm defined by app rabbit
    2019-07-02 18:42:01.473 [info] <0.231.0> Memory high watermark set to 2694 MiB (2825065267 bytes) of 6735 MiB (7062663168 bytes) total
    2019-07-02 18:42:01.478 [info] <0.233.0> Enabling free disk space monitoring
    2019-07-02 18:42:01.478 [info] <0.233.0> Disk free limit set to 50MB
    2019-07-02 18:42:01.480 [info] <0.223.0> Running boot step code_server_cache defined by app rabbit
    2019-07-02 18:42:01.480 [info] <0.223.0> Running boot step file_handle_cache defined by app rabbit
    2019-07-02 18:42:01.480 [info] <0.236.0> Limiting to approx 1048476 file handles (943626 sockets)
    2019-07-02 18:42:01.480 [info] <0.237.0> FHC read buffering:  OFF
    2019-07-02 18:42:01.480 [info] <0.237.0> FHC write buffering: ON
    2019-07-02 18:42:01.482 [info] <0.223.0> Running boot step worker_pool defined by app rabbit
    2019-07-02 18:42:01.482 [info] <0.223.0> Running boot step database defined by app rabbit
    2019-07-02 18:42:01.483 [info] <0.223.0> Node database directory at /var/lib/rabbitmq/mnesia/rabbit is empty. Assuming we need to join an existing cluster or initialise from scratch...
    2019-07-02 18:42:01.483 [info] <0.223.0> Configured peer discovery backend: rabbit_peer_discovery_classic_config
    2019-07-02 18:42:01.483 [info] <0.223.0> Will try to lock with peer discovery backend rabbit_peer_discovery_classic_config
    2019-07-02 18:42:01.483 [info] <0.223.0> Peer discovery backend does not support locking, falling back to randomized delay
    2019-07-02 18:42:01.483 [info] <0.223.0> Peer discovery backend rabbit_peer_discovery_classic_config does not support registration, skipping randomized startup delay.
    2019-07-02 18:42:01.483 [info] <0.223.0> All discovered existing cluster peers: 
    2019-07-02 18:42:01.483 [info] <0.223.0> Discovered no peer nodes to cluster with
    2019-07-02 18:42:01.484 [info] <0.43.0> Application mnesia exited with reason: stopped
    2019-07-02 18:42:01.658 [info] <0.223.0> Waiting for Mnesia tables for 30000 ms, 9 retries left
    2019-07-02 18:42:01.692 [info] <0.223.0> Waiting for Mnesia tables for 30000 ms, 9 retries left
    2019-07-02 18:42:01.727 [info] <0.223.0> Waiting for Mnesia tables for 30000 ms, 9 retries left
    2019-07-02 18:42:01.727 [info] <0.223.0> Peer discovery backend rabbit_peer_discovery_classic_config does not support registration, skipping registration.
    2019-07-02 18:42:01.727 [info] <0.223.0> Running boot step database_sync defined by app rabbit
    2019-07-02 18:42:01.727 [info] <0.223.0> Running boot step codec_correctness_check defined by app rabbit
    2019-07-02 18:42:01.727 [info] <0.223.0> Running boot step external_infrastructure defined by app rabbit
    2019-07-02 18:42:01.727 [info] <0.223.0> Running boot step rabbit_registry defined by app rabbit
    2019-07-02 18:42:01.727 [info] <0.223.0> Running boot step rabbit_auth_mechanism_cr_demo defined by app rabbit
    2019-07-02 18:42:01.727 [info] <0.223.0> Running boot step rabbit_queue_location_random defined by app rabbit
    2019-07-02 18:42:01.727 [info] <0.223.0> Running boot step rabbit_event defined by app rabbit
    2019-07-02 18:42:01.728 [info] <0.223.0> Running boot step rabbit_auth_mechanism_amqplain defined by app rabbit
    2019-07-02 18:42:01.728 [info] <0.223.0> Running boot step rabbit_auth_mechanism_plain defined by app rabbit
    2019-07-02 18:42:01.728 [info] <0.223.0> Running boot step rabbit_exchange_type_direct defined by app rabbit
    2019-07-02 18:42:01.728 [info] <0.223.0> Running boot step rabbit_exchange_type_fanout defined by app rabbit
    2019-07-02 18:42:01.728 [info] <0.223.0> Running boot step rabbit_exchange_type_headers defined by app rabbit
    2019-07-02 18:42:01.728 [info] <0.223.0> Running boot step rabbit_exchange_type_topic defined by app rabbit
    2019-07-02 18:42:01.728 [info] <0.223.0> Running boot step rabbit_mirror_queue_mode_all defined by app rabbit
    2019-07-02 18:42:01.728 [info] <0.223.0> Running boot step rabbit_mirror_queue_mode_exactly defined by app rabbit
    2019-07-02 18:42:01.729 [info] <0.223.0> Running boot step rabbit_mirror_queue_mode_nodes defined by app rabbit
    2019-07-02 18:42:01.729 [info] <0.223.0> Running boot step rabbit_priority_queue defined by app rabbit
    2019-07-02 18:42:01.729 [info] <0.223.0> Priority queues enabled, real BQ is rabbit_variable_queue
    2019-07-02 18:42:01.729 [info] <0.223.0> Running boot step rabbit_queue_location_client_local defined by app rabbit
    2019-07-02 18:42:01.729 [info] <0.223.0> Running boot step rabbit_queue_location_min_masters defined by app rabbit
    2019-07-02 18:42:01.729 [info] <0.223.0> Running boot step kernel_ready defined by app rabbit
    2019-07-02 18:42:01.729 [info] <0.223.0> Running boot step rabbit_sysmon_minder defined by app rabbit
    2019-07-02 18:42:01.729 [info] <0.223.0> Running boot step rabbit_epmd_monitor defined by app rabbit
    2019-07-02 18:42:01.731 [info] <0.223.0> Running boot step guid_generator defined by app rabbit
    2019-07-02 18:42:01.735 [info] <0.223.0> Running boot step rabbit_node_monitor defined by app rabbit
    2019-07-02 18:42:01.735 [info] <0.409.0> Starting rabbit_node_monitor
    2019-07-02 18:42:01.735 [info] <0.223.0> Running boot step delegate_sup defined by app rabbit
    2019-07-02 18:42:01.736 [info] <0.223.0> Running boot step rabbit_memory_monitor defined by app rabbit
    2019-07-02 18:42:01.736 [info] <0.223.0> Running boot step core_initialized defined by app rabbit
    2019-07-02 18:42:01.736 [info] <0.223.0> Running boot step upgrade_queues defined by app rabbit
    2019-07-02 18:42:01.761 [info] <0.223.0> message_store upgrades: 1 to apply
    2019-07-02 18:42:01.761 [info] <0.223.0> message_store upgrades: Applying rabbit_variable_queue:move_messages_to_vhost_store
    2019-07-02 18:42:01.762 [info] <0.223.0> message_store upgrades: No durable queues found. Skipping message store migration
    2019-07-02 18:42:01.762 [info] <0.223.0> message_store upgrades: Removing the old message store data
    2019-07-02 18:42:01.763 [info] <0.223.0> message_store upgrades: All upgrades applied successfully
    2019-07-02 18:42:01.789 [info] <0.223.0> Running boot step rabbit_connection_tracking defined by app rabbit
    2019-07-02 18:42:01.789 [info] <0.223.0> Running boot step rabbit_connection_tracking_handler defined by app rabbit
    2019-07-02 18:42:01.789 [info] <0.223.0> Running boot step rabbit_exchange_parameters defined by app rabbit
    2019-07-02 18:42:01.789 [info] <0.223.0> Running boot step rabbit_mirror_queue_misc defined by app rabbit
    2019-07-02 18:42:01.790 [info] <0.223.0> Running boot step rabbit_policies defined by app rabbit
    2019-07-02 18:42:01.790 [info] <0.223.0> Running boot step rabbit_policy defined by app rabbit
    2019-07-02 18:42:01.790 [info] <0.223.0> Running boot step rabbit_queue_location_validator defined by app rabbit
    2019-07-02 18:42:01.790 [info] <0.223.0> Running boot step rabbit_vhost_limit defined by app rabbit
    2019-07-02 18:42:01.790 [info] <0.223.0> Running boot step rabbit_mgmt_reset_handler defined by app rabbitmq_management
    2019-07-02 18:42:01.790 [info] <0.223.0> Running boot step rabbit_mgmt_db_handler defined by app rabbitmq_management_agent
    2019-07-02 18:42:01.790 [info] <0.223.0> Management plugin: using rates mode 'basic'
    2019-07-02 18:42:01.791 [info] <0.223.0> Running boot step recovery defined by app rabbit
    2019-07-02 18:42:01.792 [info] <0.223.0> Running boot step load_definitions defined by app rabbitmq_management
    2019-07-02 18:42:01.792 [info] <0.223.0> Running boot step empty_db_check defined by app rabbit
    2019-07-02 18:42:01.792 [info] <0.223.0> Adding vhost '/'
    2019-07-02 18:42:01.841 [info] <0.450.0> Making sure data directory '/var/lib/rabbitmq/mnesia/rabbit/msg_stores/vhosts/628WB79CIFDYO9LJI6DKMI09L' for vhost '/' exists
    2019-07-02 18:42:01.853 [info] <0.450.0> Starting message stores for vhost '/'
    2019-07-02 18:42:01.854 [info] <0.454.0> Message store "628WB79CIFDYO9LJI6DKMI09L/msg_store_transient": using rabbit_msg_store_ets_index to provide index
    2019-07-02 18:42:01.857 [info] <0.450.0> Started message store of type transient for vhost '/'
    2019-07-02 18:42:01.858 [info] <0.457.0> Message store "628WB79CIFDYO9LJI6DKMI09L/msg_store_persistent": using rabbit_msg_store_ets_index to provide index
    2019-07-02 18:42:01.859 [warning] <0.457.0> Message store "628WB79CIFDYO9LJI6DKMI09L/msg_store_persistent": rebuilding indices from scratch
    2019-07-02 18:42:01.861 [info] <0.450.0> Started message store of type persistent for vhost '/'
    2019-07-02 18:42:01.863 [info] <0.223.0> Creating user 'guest'
    2019-07-02 18:42:01.866 [info] <0.223.0> Setting user tags for user 'guest' to [administrator]
    2019-07-02 18:42:01.869 [info] <0.223.0> Setting permissions for 'guest' in '/' to '.*', '.*', '.*'
    2019-07-02 18:42:01.872 [info] <0.223.0> Running boot step rabbit_looking_glass defined by app rabbit
    2019-07-02 18:42:01.872 [info] <0.223.0> Running boot step rabbit_core_metrics_gc defined by app rabbit
    2019-07-02 18:42:01.872 [info] <0.223.0> Running boot step background_gc defined by app rabbit
    2019-07-02 18:42:01.873 [info] <0.223.0> Running boot step connection_tracking defined by app rabbit
    2019-07-02 18:42:01.884 [info] <0.223.0> Setting up a table for connection tracking on this node: tracked_connection_on_node_rabbit
    2019-07-02 18:42:01.888 [info] <0.223.0> Setting up a table for per-vhost connection counting on this node: tracked_connection_per_vhost_on_node_rabbit
    2019-07-02 18:42:01.889 [info] <0.223.0> Running boot step routing_ready defined by app rabbit
    2019-07-02 18:42:01.889 [info] <0.223.0> Running boot step pre_flight defined by app rabbit
    2019-07-02 18:42:01.889 [info] <0.223.0> Running boot step notify_cluster defined by app rabbit
    2019-07-02 18:42:01.889 [info] <0.223.0> Running boot step networking defined by app rabbit
    2019-07-02 18:42:01.890 [warning] <0.489.0> Setting Ranch options together with socket options is deprecated. Please use the new map syntax that allows specifying socket options separately from other options.
    2019-07-02 18:42:01.891 [info] <0.503.0> started TCP listener on [::]:5672
    2019-07-02 18:42:01.891 [info] <0.223.0> Running boot step direct_client defined by app rabbit
    2019-07-02 18:42:01.917 [info] <0.553.0> Management plugin: HTTP (non-TLS) listener started on port 15672
    2019-07-02 18:42:01.917 [info] <0.659.0> Statistics database started.
    2019-07-02 18:42:01.976 [info] <0.8.0> Server startup complete; 3 plugins started.
     * rabbitmq_management
     * rabbitmq_web_dispatch
     * rabbitmq_management_agent
     completed with 3 plugins.
    </stdout></stdout>
    点赞 评论 复制链接分享
  • weixin_39658619 weixin_39658619 4月前

    That was very weird... I removed all rabbitmq images and re-pulled and things seem to be OK now!

    点赞 评论 复制链接分享
  • weixin_39976499 weixin_39976499 4月前

    Yeah that was a corrupt image, if the error is really esoteric then something rather abnormal is happening which could stem from a corrupt pull

    点赞 评论 复制链接分享

相关推荐