<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi there.<br>
    <br>
    We're using Erlang Solutions' packages of erlang for ubuntu
    (specifically1:16.b.1-1~ubuntu~precise) , and there seems to be some
    bad interaction between this, mochiweb, and ssl, meaning that the
    ASN1 application (seemingly) doesn't get started on boot, and rabbit
    crashes trying to start the mochiweb listeners (crash logs below).<br>
    <br>
    The odd thing is, that with a version of R16B01 built from source
    with <a href="https://github.com/spawngrid/kerl">kerl</a>,
    everything works perfectly well. Also, we can work around this by
    adding ssl as an application dependency to either the mochiweb <tt>.app</tt>
    or the rabbit <tt>.app</tt> descriptor files. But we'd like to
    understand this better, and get the root issue fixed. <br>
    <br>
    I don't suppose that anyone could shed any light on this, perhaps?<br>
    <br>
    Thanks.<br>
    <br>
    ---<br>
    <br>
    <tt>-- Rabbit Log<br>
      =ERROR REPORT==== 9-Sep-2013::16:21:22 ===</tt><tt><br>
    </tt><tt>** Generic server rabbit_web_dispatch_registry terminating
    </tt><tt><br>
    </tt><tt>** Last message in was {add,rabbit_mgmt,</tt><tt><br>
    </tt><tt>                           [{port,15672},</tt><tt><br>
    </tt><tt>                            {ssl,true},</tt><tt><br>
    </tt><tt>                            {ssl_opts,</tt><tt><br>
    </tt><tt>                                [{cacertfile,</tt><tt><br>
    </tt><tt>                                    
      "/etc/ssl/certs/cacert.pem"},</tt><tt><br>
    </tt><tt>                                 {certfile,</tt><tt><br>
    </tt><tt>                                    
      "/etc/ssl/certs/my-certfile.crt"},</tt><tt><br>
    </tt><tt>                                 {keyfile,</tt><tt><br>
    </tt><tt>                                    
      "/etc/ssl/rabbit/my-certfile.key"}]}],</tt><tt><br>
    </tt><tt>                          
      #Fun&lt;rabbit_web_dispatch.1.31447083&gt;,</tt><tt><br>
    </tt><tt>                          
      #Fun&lt;rabbit_mgmt_app.2.5043001&gt;,</tt><tt><br>
    </tt><tt>                           {[],"RabbitMQ Management"}}</tt><tt><br>
    </tt><tt>** When Server state == undefined</tt><tt><br>
    </tt><tt>** Reason for termination == </tt><tt><br>
    </tt><tt>** {could_not_start_listener,</tt><tt><br>
    </tt><tt>       [{port,15672},</tt><tt><br>
    </tt><tt>        {ssl,true},</tt><tt><br>
    </tt><tt>        {ssl_opts,</tt><tt><br>
    </tt><tt>            [{cacertfile,"/etc/ssl/certs/cacert.pem"},</tt><tt><br>
    </tt><tt>             {certfile,"/etc/ssl/certs/my-certfile.crt"},</tt><tt><br>
    </tt><tt>            
      {keyfile,"/etc/ssl/rabbit/my-certfile.key"}]}],</tt><tt><br>
    </tt><tt>       {'EXIT',</tt><tt><br>
    </tt><tt>           {{case_clause,{error,{not_started,asn1}}},</tt><tt><br>
    </tt><tt>            [{mochiweb,ensure_started,1,[]},</tt><tt><br>
    </tt><tt>             {mochiweb_socket_server,prep_ssl,1,[]},</tt><tt><br>
    </tt><tt>             {mochiweb_socket_server,start_server,2,[]},</tt><tt><br>
    </tt><tt>             {supervisor,do_start_child,2,</tt><tt><br>
    </tt><tt>                 [{file,"supervisor.erl"},{line,310}]},</tt><tt><br>
    </tt><tt>             {supervisor,handle_start_child,2,</tt><tt><br>
    </tt><tt>                 [{file,"supervisor.erl"},{line,681}]},</tt><tt><br>
    </tt><tt>            
      {supervisor,handle_call,3,[{file,"supervisor.erl"},{line,390}]},</tt><tt><br>
    </tt><tt>            
      {gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,585}]},</tt><tt><br>
    </tt><tt>             {proc_lib,init_p_do_apply,3,</tt><tt><br>
    </tt><tt>                 [{file,"proc_lib.erl"},{line,239}]}]}}}</tt><tt><br>
    </tt><tt><br>
      -- Sasl log</tt><tt><br>
    </tt><tt><br>
    </tt><tt>=CRASH REPORT==== 9-Sep-2013::16:21:22 ===</tt><tt><br>
    </tt><tt>  crasher:</tt><tt><br>
    </tt><tt>    initial call: rabbit_web_dispatch_registry:init/1</tt><tt><br>
    </tt><tt>    pid: &lt;0.258.0&gt;</tt><tt><br>
    </tt><tt>    registered_name: rabbit_web_dispatch_registry</tt><tt><br>
    </tt><tt>    exception exit: {could_not_start_listener,</tt><tt><br>
    </tt><tt>                        [{port,15672},</tt><tt><br>
    </tt><tt>                         {ssl,true},</tt><tt><br>
    </tt><tt>                         {ssl_opts,</tt><tt><br>
    </tt><tt>                            
      [{cacertfile,"/etc/ssl/certs/cacert.pem"},</tt><tt><br>
    </tt><tt>                              {certfile,</tt><tt><br>
    </tt><tt>                                 
      "/etc/ssl/certs/my-certfile.crt"},</tt><tt><br>
    </tt><tt>                              {keyfile,</tt><tt><br>
    </tt><tt>                                 
      "/etc/ssl/rabbit/my-certfile.key"}]}],</tt><tt><br>
    </tt><tt>                        {'EXIT',</tt><tt><br>
    </tt><tt>                           
      {{case_clause,{error,{not_started,asn1}}},</tt><tt><br>
    </tt><tt>                            
      [{mochiweb,ensure_started,1,[]},</tt><tt><br>
    </tt><tt>                             
      {mochiweb_socket_server,prep_ssl,1,[]},</tt><tt><br>
    </tt><tt>                             
      {mochiweb_socket_server,start_server,2,[]},</tt><tt><br>
    </tt><tt>                              {supervisor,do_start_child,2,</tt><tt><br>
    </tt><tt>                                 
      [{file,"supervisor.erl"},{line,310}]},</tt><tt><br>
    </tt><tt>                             
      {supervisor,handle_start_child,2,</tt><tt><br>
    </tt><tt>                                 
      [{file,"supervisor.erl"},{line,681}]},</tt><tt><br>
    </tt><tt>                              {supervisor,handle_call,3,</tt><tt><br>
    </tt><tt>                                 
      [{file,"supervisor.erl"},{line,390}]},</tt><tt><br>
    </tt><tt>                              {gen_server,handle_msg,5,</tt><tt><br>
    </tt><tt>                                 
      [{file,"gen_server.erl"},{line,585}]},</tt><tt><br>
    </tt><tt>                              {proc_lib,init_p_do_apply,3,</tt><tt><br>
    </tt><tt>                                 
      [{file,"proc_lib.erl"},{line,239}]}]}}}</tt><tt><br>
    </tt><tt>      in function  gen_server:terminate/6 (gen_server.erl,
      line 744)</tt><tt><br>
    </tt><tt>    ancestors: [rabbit_web_dispatch_sup,&lt;0.256.0&gt;]</tt><tt><br>
    </tt><tt>    messages: []</tt><tt><br>
    </tt><tt>    links: [&lt;0.257.0&gt;]</tt><tt><br>
    </tt><tt>    dictionary: []</tt><tt><br>
    </tt><tt>    trap_exit: false</tt><tt><br>
    </tt><tt>    status: running</tt><tt><br>
    </tt><tt>    heap_size: 4185</tt><tt><br>
    </tt><tt>    stack_size: 27</tt><tt><br>
    </tt><tt>    reductions: 594</tt><tt><br>
    </tt><tt>  neighbours:</tt><tt><br>
    </tt><tt><br>
    </tt><tt>=SUPERVISOR REPORT==== 9-Sep-2013::16:21:22 ===</tt><tt><br>
    </tt><tt>     Supervisor: {local,rabbit_web_dispatch_sup}</tt><tt><br>
    </tt><tt>     Context:    child_terminated</tt><tt><br>
    </tt><tt>     Reason:     {could_not_start_listener,</tt><tt><br>
    </tt><tt>                     [{port,15672},</tt><tt><br>
    </tt><tt>                      {ssl,true},</tt><tt><br>
    </tt><tt>                      {ssl_opts,</tt><tt><br>
    </tt><tt>                         
      [{cacertfile,"/etc/ssl/certs/cacert.pem"},</tt><tt><br>
    </tt><tt>                           {certfile,</tt><tt><br>
    </tt><tt>                              
      "/etc/ssl/certs/my-certfile.crt"},</tt><tt><br>
    </tt><tt>                           {keyfile,</tt><tt><br>
    </tt><tt>                              
      "/etc/ssl/rabbit/my-certfile.key"}]}],</tt><tt><br>
    </tt><tt>                     {'EXIT',</tt><tt><br>
    </tt><tt>                        
      {{case_clause,{error,{not_started,asn1}}},</tt><tt><br>
    </tt><tt>                          [{mochiweb,ensure_started,1,[]},</tt><tt><br>
    </tt><tt>                          
      {mochiweb_socket_server,prep_ssl,1,[]},</tt><tt><br>
    </tt><tt>                          
      {mochiweb_socket_server,start_server,2,[]},</tt><tt><br>
    </tt><tt>                           {supervisor,do_start_child,2,</tt><tt><br>
    </tt><tt>                              
      [{file,"supervisor.erl"},{line,310}]},</tt><tt><br>
    </tt><tt>                          
      {supervisor,handle_start_child,2,</tt><tt><br>
    </tt><tt>                              
      [{file,"supervisor.erl"},{line,681}]},</tt><tt><br>
    </tt><tt>                           {supervisor,handle_call,3,</tt><tt><br>
    </tt><tt>                              
      [{file,"supervisor.erl"},{line,390}]},</tt><tt><br>
    </tt><tt>                           {gen_server,handle_msg,5,</tt><tt><br>
    </tt><tt>                              
      [{file,"gen_server.erl"},{line,585}]},</tt><tt><br>
    </tt><tt>                           {proc_lib,init_p_do_apply,3,</tt><tt><br>
    </tt><tt>                              
      [{file,"proc_lib.erl"},{line,239}]}]}}}</tt><tt><br>
    </tt><tt>     Offender:   [{pid,&lt;0.258.0&gt;},</tt><tt><br>
    </tt><tt>                  {name,rabbit_web_dispatch_registry},</tt><tt><br>
    </tt><tt>                 
      {mfargs,{rabbit_web_dispatch_registry,start_link,[]}},</tt><tt><br>
    </tt><tt>                  {restart_type,transient},</tt><tt><br>
    </tt><tt>                  {shutdown,5000},</tt><tt><br>
    </tt><tt>                  {child_type,worker}]</tt><tt><br>
    </tt><tt><br>
    </tt><tt><br>
    </tt><tt>=CRASH REPORT==== 9-Sep-2013::16:21:22 ===</tt><tt><br>
    </tt><tt>  crasher:</tt><tt><br>
    </tt><tt>    initial call: application_master:init/4</tt><tt><br>
    </tt><tt>    pid: &lt;0.260.0&gt;</tt><tt><br>
    </tt><tt>    registered_name: []</tt><tt><br>
    </tt><tt>    exception exit: {bad_return,</tt><tt><br>
    </tt><tt>                     {{rabbit_mgmt_app,start,[normal,[]]},</tt><tt><br>
    </tt><tt>                      {'EXIT',</tt><tt><br>
    </tt><tt>                       {{could_not_start_listener,</tt><tt><br>
    </tt><tt>                         [{port,15672},</tt><tt><br>
    </tt><tt>                          {ssl,true},</tt><tt><br>
    </tt><tt>                          {ssl_opts,</tt><tt><br>
    </tt><tt>                          
      [{cacertfile,"/etc/ssl/certs/cacert.pem"},</tt><tt><br>
    </tt><tt>                            {certfile,</tt><tt><br>
    </tt><tt>                            
      "/etc/ssl/certs/my-certfile.crt"},</tt><tt><br>
    </tt><tt>                            {keyfile,</tt><tt><br>
    </tt><tt>                            
      "/etc/ssl/rabbit/my-certfile.key"}]}],</tt><tt><br>
    </tt><tt>                         {'EXIT',</tt><tt><br>
    </tt><tt>                         
      {{case_clause,{error,{not_started,asn1}}},</tt><tt><br>
    </tt><tt>                           [{mochiweb,ensure_started,1,[]},</tt><tt><br>
    </tt><tt>                           
      {mochiweb_socket_server,prep_ssl,1,[]},</tt><tt><br>
    </tt><tt>                           
      {mochiweb_socket_server,start_server,2,[]},</tt><tt><br>
    </tt><tt>                            {supervisor,do_start_child,2,</tt><tt><br>
    </tt><tt>                            
      [{file,"supervisor.erl"},{line,310}]},</tt><tt><br>
    </tt><tt>                           
      {supervisor,handle_start_child,2,</tt><tt><br>
    </tt><tt>                            
      [{file,"supervisor.erl"},{line,681}]},</tt><tt><br>
    </tt><tt>                            {supervisor,handle_call,3,</tt><tt><br>
    </tt><tt>                            
      [{file,"supervisor.erl"},{line,390}]},</tt><tt><br>
    </tt><tt>                            {gen_server,handle_msg,5,</tt><tt><br>
    </tt><tt>                            
      [{file,"gen_server.erl"},{line,585}]},</tt><tt><br>
    </tt><tt>                            {proc_lib,init_p_do_apply,3,</tt><tt><br>
    </tt><tt>                            
      [{file,"proc_lib.erl"},{line,239}]}]}}},</tt><tt><br>
    </tt><tt>                        {gen_server,call,</tt><tt><br>
    </tt><tt>                         [rabbit_web_dispatch_registry,</tt><tt><br>
    </tt><tt>                          {add,rabbit_mgmt,</tt><tt><br>
    </tt><tt>                           [{port,15672},</tt><tt><br>
    </tt><tt>                            {ssl,true},</tt><tt><br>
    </tt><tt>                            {ssl_opts,</tt><tt><br>
    </tt><tt>                            
      [{cacertfile,"/etc/ssl/certs/cacert.pem"},</tt><tt><br>
    </tt><tt>                              {certfile,</tt><tt><br>
    </tt><tt>                              
      "/etc/ssl/certs/my-certfile.crt"},</tt><tt><br>
    </tt><tt>                              {keyfile,</tt><tt><br>
    </tt><tt>                              
      "/etc/ssl/rabbit/my-certfile.key"}]}],</tt><tt><br>
    </tt><tt>                          
      #Fun&lt;rabbit_web_dispatch.1.31447083&gt;,</tt><tt><br>
    </tt><tt>                          
      #Fun&lt;rabbit_mgmt_app.2.5043001&gt;,</tt><tt><br>
    </tt><tt>                           {[],"RabbitMQ Management"}},</tt><tt><br>
    </tt><tt>                          infinity]}}}}}</tt><tt><br>
    </tt><tt>      in function  application_master:init/4
      (application_master.erl, line 133)</tt><tt><br>
    </tt><tt>    ancestors: [&lt;0.259.0&gt;]</tt><tt><br>
    </tt><tt>    messages: [{'EXIT',&lt;0.261.0&gt;,normal}]</tt><tt><br>
    </tt><tt>    links: [&lt;0.259.0&gt;,&lt;0.7.0&gt;]</tt><tt><br>
    </tt><tt>    dictionary: []</tt><tt><br>
    </tt><tt>    trap_exit: true</tt><tt><br>
    </tt><tt>    status: running</tt><tt><br>
    </tt><tt>    heap_size: 4185</tt><tt><br>
    </tt><tt>    stack_size: 27</tt><tt><br>
    </tt><tt>    reductions: 423</tt><tt><br>
    </tt><tt>  neighbours:</tt><br>
    <br>
  </body>
</html>