Node Crash for inets config 'SocketType ssl'

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Node Crash for inets config 'SocketType ssl'

Prakash Parmar-3

Hello,


I have a web-server based on inets otp application and running completely fine over 'http' in order to support 'https' I have changed inets configuration 

as per the sample configuration located at Erlang's repo [1]. 


Here are the config file snippet I had changed/added,

...
SocketType ssl
SSLCertificateFile      {{install_dir}}/config/www/certs/server.pem
SSLCertificateKeyFile   {{install_dir}}/config/www/certs/server.pem
SSLVerifyClient 0
...
 
I have also generated certificate files[2] and kept it in above mentioned path. 

unfortunately node is crashing at startup and following logs is printed on shell.  

=CRASH REPORT==== 9-Jul-2018::12:13:50 ===
  crasher:
    initial call: application_master:init/4
    pid: <0.902.0>
    registered_name: []
    exception exit: {{shutdown,
                      {failed_to_start_child,httpd_sup,
                       {shutdown,
                        {failed_to_start_child,
                         {httpd_instance_sup,any,8881,default},
                         {shutdown,
                          {failed_to_start_child,
                           {httpd_acceptor_sup,any,8881,default},
                           {shutdown,
                            {failed_to_start_child,
                             {httpd_acceptor_sup,any,8881,default},
                             {'EXIT',
                              {function_clause,
                               [{http_transport,start,
                                 [ssl],
                                 [{file,"http_transport.erl"},{line,54}]},
                                {httpd_acceptor,do_socket_start,1,
                                 [{file,"httpd_acceptor.erl"},{line,101}]},
                                {httpd_acceptor,do_init,4,
                                 [{file,"httpd_acceptor.erl"},{line,94}]},
                                {httpd_acceptor,acceptor_init,8,
                                 [{file,"httpd_acceptor.erl"},{line,82}]},
                                {proc_lib,init_p_do_apply,3,
                                 [{file,"proc_lib.erl"},
                                  {line,247}]}]}}}}}}}}}},
                     {inets_app,start,[normal,[]]}}
      in function  application_master:init/4 (application_master.erl, line 134)
    ancestors: [<0.901.0>]
    messages: [{'EXIT',<0.903.0>,normal}]
    links: [<0.901.0>,<0.739.0>]
    dictionary: []
    trap_exit: true
    status: running
    heap_size: 987
    stack_size: 27
    reductions: 166
  neighbours:



Does anyone know what might be the problem ? 

I have looked into 'http_transport' module's code and it seems that start/1 function[3] is not accepting 'ssl' atom as an arity,
Arity for this function is like {ssl, <Certificate_file_path>}Any idea on this ? Did I missed anything ?

/ cheers,
Prakash Parmar



Reference,






_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Node Crash for inets config 'SocketType ssl'

Ingela Andin
Hi!

Did you start the ssl application?

Regards Ingela Erlang/OTP Team - Ericsson AB




2018-07-10 8:21 GMT+02:00 Prakash Parmar <[hidden email]>:

Hello,


I have a web-server based on inets otp application and running completely fine over 'http' in order to support 'https' I have changed inets configuration 

as per the sample configuration located at Erlang's repo [1]. 


Here are the config file snippet I had changed/added,

...
SocketType ssl
SSLCertificateFile      {{install_dir}}/config/www/certs/server.pem
SSLCertificateKeyFile   {{install_dir}}/config/www/certs/server.pem
SSLVerifyClient 0
...
 
I have also generated certificate files[2] and kept it in above mentioned path. 

unfortunately node is crashing at startup and following logs is printed on shell.  

=CRASH REPORT==== 9-Jul-2018::12:13:50 ===
  crasher:
    initial call: application_master:init/4
    pid: <0.902.0>
    registered_name: []
    exception exit: {{shutdown,
                      {failed_to_start_child,httpd_sup,
                       {shutdown,
                        {failed_to_start_child,
                         {httpd_instance_sup,any,8881,default},
                         {shutdown,
                          {failed_to_start_child,
                           {httpd_acceptor_sup,any,8881,default},
                           {shutdown,
                            {failed_to_start_child,
                             {httpd_acceptor_sup,any,8881,default},
                             {'EXIT',
                              {function_clause,
                               [{http_transport,start,
                                 [ssl],
                                 [{file,"http_transport.erl"},{line,54}]},
                                {httpd_acceptor,do_socket_start,1,
                                 [{file,"httpd_acceptor.erl"},{line,101}]},
                                {httpd_acceptor,do_init,4,
                                 [{file,"httpd_acceptor.erl"},{line,94}]},
                                {httpd_acceptor,acceptor_init,8,
                                 [{file,"httpd_acceptor.erl"},{line,82}]},
                                {proc_lib,init_p_do_apply,3,
                                 [{file,"proc_lib.erl"},
                                  {line,247}]}]}}}}}}}}}},
                     {inets_app,start,[normal,[]]}}
      in function  application_master:init/4 (application_master.erl, line 134)
    ancestors: [<0.901.0>]
    messages: [{'EXIT',<0.903.0>,normal}]
    links: [<0.901.0>,<0.739.0>]
    dictionary: []
    trap_exit: true
    status: running
    heap_size: 987
    stack_size: 27
    reductions: 166
  neighbours:



Does anyone know what might be the problem ? 

I have looked into 'http_transport' module's code and it seems that start/1 function[3] is not accepting 'ssl' atom as an arity,
Arity for this function is like {ssl, <Certificate_file_path>}Any idea on this ? Did I missed anything ?

/ cheers,
Prakash Parmar



Reference,






_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions



_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Node Crash for inets config 'SocketType ssl'

Prakash Parmar-3

Hello Ingela,


Thanks for your response ��


I'm using rebar3 for release. I have mentioned ssl application in config file prior to inets application(though sequence doesn't matter) and as per my understanding rebar3 will take care of start sequence and I don't think so there is an option to define application start sequence explicitly. Am I right ? 


Let me know if there is any way to make sure to start ssl application before inets application.


/Cheers,

Prakash Parmar



From: Ingela Andin <[hidden email]>
Sent: Tuesday, July 10, 2018 9:33:50 PM
To: Prakash Parmar
Cc: Erlang Questions
Subject: Re: [erlang-questions] Node Crash for inets config 'SocketType ssl'
 
Hi!

Did you start the ssl application?

Regards Ingela Erlang/OTP Team - Ericsson AB




2018-07-10 8:21 GMT+02:00 Prakash Parmar <[hidden email]>:

Hello,


I have a web-server based on inets otp application and running completely fine over 'http' in order to support 'https' I have changed inets configuration 

as per the sample configuration located at Erlang's repo [1]. 


Here are the config file snippet I had changed/added,

...
SocketType ssl
SSLCertificateFile      {{install_dir}}/config/www/certs/server.pem
SSLCertificateKeyFile   {{install_dir}}/config/www/certs/server.pem
SSLVerifyClient 0
...
 
I have also generated certificate files[2] and kept it in above mentioned path. 

unfortunately node is crashing at startup and following logs is printed on shell.  

=CRASH REPORT==== 9-Jul-2018::12:13:50 ===
  crasher:
    initial call: application_master:init/4
    pid: <0.902.0>
    registered_name: []
    exception exit: {{shutdown,
                      {failed_to_start_child,httpd_sup,
                       {shutdown,
                        {failed_to_start_child,
                         {httpd_instance_sup,any,8881,default},
                         {shutdown,
                          {failed_to_start_child,
                           {httpd_acceptor_sup,any,8881,default},
                           {shutdown,
                            {failed_to_start_child,
                             {httpd_acceptor_sup,any,8881,default},
                             {'EXIT',
                              {function_clause,
                               [{http_transport,start,
                                 [ssl],
                                 [{file,"http_transport.erl"},{line,54}]},
                                {httpd_acceptor,do_socket_start,1,
                                 [{file,"httpd_acceptor.erl"},{line,101}]},
                                {httpd_acceptor,do_init,4,
                                 [{file,"httpd_acceptor.erl"},{line,94}]},
                                {httpd_acceptor,acceptor_init,8,
                                 [{file,"httpd_acceptor.erl"},{line,82}]},
                                {proc_lib,init_p_do_apply,3,
                                 [{file,"proc_lib.erl"},
                                  {line,247}]}]}}}}}}}}}},
                     {inets_app,start,[normal,[]]}}
      in function  application_master:init/4 (application_master.erl, line 134)
    ancestors: [<0.901.0>]
    messages: [{'EXIT',<0.903.0>,normal}]
    links: [<0.901.0>,<0.739.0>]
    dictionary: []
    trap_exit: true
    status: running
    heap_size: 987
    stack_size: 27
    reductions: 166
  neighbours:



Does anyone know what might be the problem ? 

I have looked into 'http_transport' module's code and it seems that start/1 function[3] is not accepting 'ssl' atom as an arity,
Arity for this function is like {ssl, <Certificate_file_path>}Any idea on this ? Did I missed anything ?

/ cheers,
Prakash Parmar



Reference,






_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions



_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Node Crash for inets config 'SocketType ssl'

Ingela Andin
Hi!

Well I am no rebar3 expert, but inets does not list ssl as a dependency as it is an "optional" dependency. You can check with application:which_applications() to see if it was started.

Regards Ingela Erlang/OTP team - Ericsson AB


2018-07-11 7:12 GMT+02:00 Prakash Parmar <[hidden email]>:

Hello Ingela,


Thanks for your response 😊


I'm using rebar3 for release. I have mentioned ssl application in config file prior to inets application(though sequence doesn't matter) and as per my understanding rebar3 will take care of start sequence and I don't think so there is an option to define application start sequence explicitly. Am I right ? 


Let me know if there is any way to make sure to start ssl application before inets application.


/Cheers,

Prakash Parmar



From: Ingela Andin <[hidden email]>
Sent: Tuesday, July 10, 2018 9:33:50 PM
To: Prakash Parmar
Cc: Erlang Questions
Subject: Re: [erlang-questions] Node Crash for inets config 'SocketType ssl'
 
Hi!

Did you start the ssl application?

Regards Ingela Erlang/OTP Team - Ericsson AB




2018-07-10 8:21 GMT+02:00 Prakash Parmar <[hidden email]>:

Hello,


I have a web-server based on inets otp application and running completely fine over 'http' in order to support 'https' I have changed inets configuration 

as per the sample configuration located at Erlang's repo [1]. 


Here are the config file snippet I had changed/added,

...
SocketType ssl
SSLCertificateFile      {{install_dir}}/config/www/certs/server.pem
SSLCertificateKeyFile   {{install_dir}}/config/www/certs/server.pem
SSLVerifyClient 0
...
 
I have also generated certificate files[2] and kept it in above mentioned path. 

unfortunately node is crashing at startup and following logs is printed on shell.  

=CRASH REPORT==== 9-Jul-2018::12:13:50 ===
  crasher:
    initial call: application_master:init/4
    pid: <0.902.0>
    registered_name: []
    exception exit: {{shutdown,
                      {failed_to_start_child,httpd_sup,
                       {shutdown,
                        {failed_to_start_child,
                         {httpd_instance_sup,any,8881,default},
                         {shutdown,
                          {failed_to_start_child,
                           {httpd_acceptor_sup,any,8881,default},
                           {shutdown,
                            {failed_to_start_child,
                             {httpd_acceptor_sup,any,8881,default},
                             {'EXIT',
                              {function_clause,
                               [{http_transport,start,
                                 [ssl],
                                 [{file,"http_transport.erl"},{line,54}]},
                                {httpd_acceptor,do_socket_start,1,
                                 [{file,"httpd_acceptor.erl"},{line,101}]},
                                {httpd_acceptor,do_init,4,
                                 [{file,"httpd_acceptor.erl"},{line,94}]},
                                {httpd_acceptor,acceptor_init,8,
                                 [{file,"httpd_acceptor.erl"},{line,82}]},
                                {proc_lib,init_p_do_apply,3,
                                 [{file,"proc_lib.erl"},
                                  {line,247}]}]}}}}}}}}}},
                     {inets_app,start,[normal,[]]}}
      in function  application_master:init/4 (application_master.erl, line 134)
    ancestors: [<0.901.0>]
    messages: [{'EXIT',<0.903.0>,normal}]
    links: [<0.901.0>,<0.739.0>]
    dictionary: []
    trap_exit: true
    status: running
    heap_size: 987
    stack_size: 27
    reductions: 166
  neighbours:



Does anyone know what might be the problem ? 

I have looked into 'http_transport' module's code and it seems that start/1 function[3] is not accepting 'ssl' atom as an arity,
Arity for this function is like {ssl, <Certificate_file_path>}Any idea on this ? Did I missed anything ?

/ cheers,
Prakash Parmar



Reference,






_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions




_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Node Crash for inets config 'SocketType ssl'

Prakash Parmar-3

Hello Ingela,


I tweak rebar3 config to just load inets application rather than starting along with node using relx configuration {inets, load}. From node shell I have started ssl application and then inets application. But still I'm getting same Crash. Do you have any idea what might be wrong with it ?


/Cheers,

Prakash Parmar 



From: Ingela Andin <[hidden email]>
Sent: Wednesday, July 11, 2018 5:05 PM
To: Prakash Parmar
Cc: Erlang Questions
Subject: Re: [erlang-questions] Node Crash for inets config 'SocketType ssl'
 
Hi!

Well I am no rebar3 expert, but inets does not list ssl as a dependency as it is an "optional" dependency. You can check with application:which_applications() to see if it was started.

Regards Ingela Erlang/OTP team - Ericsson AB


2018-07-11 7:12 GMT+02:00 Prakash Parmar <[hidden email]>:

Hello Ingela,


Thanks for your response 😊


I'm using rebar3 for release. I have mentioned ssl application in config file prior to inets application(though sequence doesn't matter) and as per my understanding rebar3 will take care of start sequence and I don't think so there is an option to define application start sequence explicitly. Am I right ? 


Let me know if there is any way to make sure to start ssl application before inets application.


/Cheers,

Prakash Parmar



From: Ingela Andin <[hidden email]>
Sent: Tuesday, July 10, 2018 9:33:50 PM
To: Prakash Parmar
Cc: Erlang Questions
Subject: Re: [erlang-questions] Node Crash for inets config 'SocketType ssl'
 
Hi!

Did you start the ssl application?

Regards Ingela Erlang/OTP Team - Ericsson AB




2018-07-10 8:21 GMT+02:00 Prakash Parmar <[hidden email]>:

Hello,


I have a web-server based on inets otp application and running completely fine over 'http' in order to support 'https' I have changed inets configuration 

as per the sample configuration located at Erlang's repo [1]. 


Here are the config file snippet I had changed/added,

...
SocketType ssl
SSLCertificateFile      {{install_dir}}/config/www/certs/server.pem
SSLCertificateKeyFile   {{install_dir}}/config/www/certs/server.pem
SSLVerifyClient 0
...
 
I have also generated certificate files[2] and kept it in above mentioned path. 

unfortunately node is crashing at startup and following logs is printed on shell.  

=CRASH REPORT==== 9-Jul-2018::12:13:50 ===
  crasher:
    initial call: application_master:init/4
    pid: <0.902.0>
    registered_name: []
    exception exit: {{shutdown,
                      {failed_to_start_child,httpd_sup,
                       {shutdown,
                        {failed_to_start_child,
                         {httpd_instance_sup,any,8881,default},
                         {shutdown,
                          {failed_to_start_child,
                           {httpd_acceptor_sup,any,8881,default},
                           {shutdown,
                            {failed_to_start_child,
                             {httpd_acceptor_sup,any,8881,default},
                             {'EXIT',
                              {function_clause,
                               [{http_transport,start,
                                 [ssl],
                                 [{file,"http_transport.erl"},{line,54}]},
                                {httpd_acceptor,do_socket_start,1,
                                 [{file,"httpd_acceptor.erl"},{line,101}]},
                                {httpd_acceptor,do_init,4,
                                 [{file,"httpd_acceptor.erl"},{line,94}]},
                                {httpd_acceptor,acceptor_init,8,
                                 [{file,"httpd_acceptor.erl"},{line,82}]},
                                {proc_lib,init_p_do_apply,3,
                                 [{file,"proc_lib.erl"},
                                  {line,247}]}]}}}}}}}}}},
                     {inets_app,start,[normal,[]]}}
      in function  application_master:init/4 (application_master.erl, line 134)
    ancestors: [<0.901.0>]
    messages: [{'EXIT',<0.903.0>,normal}]
    links: [<0.901.0>,<0.739.0>]
    dictionary: []
    trap_exit: true
    status: running
    heap_size: 987
    stack_size: 27
    reductions: 166
  neighbours:



Does anyone know what might be the problem ? 

I have looked into 'http_transport' module's code and it seems that start/1 function[3] is not accepting 'ssl' atom as an arity,
Arity for this function is like {ssl, <Certificate_file_path>}Any idea on this ? Did I missed anything ?

/ cheers,
Prakash Parmar



Reference,






_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions




_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Node Crash for inets config 'SocketType ssl'

Ingela Andin
HI Parmar!

I see that you have a legacy apache like config file, you might want to try using a the documented config file format instead.

Regards Ingela Erlang/OTP team - Ericsson AB

2018-07-12 7:19 GMT+02:00 Prakash Parmar <[hidden email]>:

Hello Ingela,


I tweak rebar3 config to just load inets application rather than starting along with node using relx configuration {inets, load}. From node shell I have started ssl application and then inets application. But still I'm getting same Crash. Do you have any idea what might be wrong with it ?


/Cheers,

Prakash Parmar 



From: Ingela Andin <[hidden email]>
Sent: Wednesday, July 11, 2018 5:05 PM

To: Prakash Parmar
Cc: Erlang Questions
Subject: Re: [erlang-questions] Node Crash for inets config 'SocketType ssl'
 
Hi!

Well I am no rebar3 expert, but inets does not list ssl as a dependency as it is an "optional" dependency. You can check with application:which_applications() to see if it was started.

Regards Ingela Erlang/OTP team - Ericsson AB


2018-07-11 7:12 GMT+02:00 Prakash Parmar <[hidden email]>:

Hello Ingela,


Thanks for your response 😊


I'm using rebar3 for release. I have mentioned ssl application in config file prior to inets application(though sequence doesn't matter) and as per my understanding rebar3 will take care of start sequence and I don't think so there is an option to define application start sequence explicitly. Am I right ? 


Let me know if there is any way to make sure to start ssl application before inets application.


/Cheers,

Prakash Parmar



From: Ingela Andin <[hidden email]>
Sent: Tuesday, July 10, 2018 9:33:50 PM
To: Prakash Parmar
Cc: Erlang Questions
Subject: Re: [erlang-questions] Node Crash for inets config 'SocketType ssl'
 
Hi!

Did you start the ssl application?

Regards Ingela Erlang/OTP Team - Ericsson AB




2018-07-10 8:21 GMT+02:00 Prakash Parmar <[hidden email]>:

Hello,


I have a web-server based on inets otp application and running completely fine over 'http' in order to support 'https' I have changed inets configuration 

as per the sample configuration located at Erlang's repo [1]. 


Here are the config file snippet I had changed/added,

...
SocketType ssl
SSLCertificateFile      {{install_dir}}/config/www/certs/server.pem
SSLCertificateKeyFile   {{install_dir}}/config/www/certs/server.pem
SSLVerifyClient 0
...
 
I have also generated certificate files[2] and kept it in above mentioned path. 

unfortunately node is crashing at startup and following logs is printed on shell.  

=CRASH REPORT==== 9-Jul-2018::12:13:50 ===
  crasher:
    initial call: application_master:init/4
    pid: <0.902.0>
    registered_name: []
    exception exit: {{shutdown,
                      {failed_to_start_child,httpd_sup,
                       {shutdown,
                        {failed_to_start_child,
                         {httpd_instance_sup,any,8881,default},
                         {shutdown,
                          {failed_to_start_child,
                           {httpd_acceptor_sup,any,8881,default},
                           {shutdown,
                            {failed_to_start_child,
                             {httpd_acceptor_sup,any,8881,default},
                             {'EXIT',
                              {function_clause,
                               [{http_transport,start,
                                 [ssl],
                                 [{file,"http_transport.erl"},{line,54}]},
                                {httpd_acceptor,do_socket_start,1,
                                 [{file,"httpd_acceptor.erl"},{line,101}]},
                                {httpd_acceptor,do_init,4,
                                 [{file,"httpd_acceptor.erl"},{line,94}]},
                                {httpd_acceptor,acceptor_init,8,
                                 [{file,"httpd_acceptor.erl"},{line,82}]},
                                {proc_lib,init_p_do_apply,3,
                                 [{file,"proc_lib.erl"},
                                  {line,247}]}]}}}}}}}}}},
                     {inets_app,start,[normal,[]]}}
      in function  application_master:init/4 (application_master.erl, line 134)
    ancestors: [<0.901.0>]
    messages: [{'EXIT',<0.903.0>,normal}]
    links: [<0.901.0>,<0.739.0>]
    dictionary: []
    trap_exit: true
    status: running
    heap_size: 987
    stack_size: 27
    reductions: 166
  neighbours:



Does anyone know what might be the problem ? 

I have looked into 'http_transport' module's code and it seems that start/1 function[3] is not accepting 'ssl' atom as an arity,
Arity for this function is like {ssl, <Certificate_file_path>}Any idea on this ? Did I missed anything ?

/ cheers,
Prakash Parmar



Reference,






_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions





_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions