2
votes

I am trying to install ejabberd on a EC2 AWS Linux 2 machine running on a public subnet. I did the following:

  1. Assigned the EC2 instance an Elastic IP (52.22.184.194)
  2. Assign this domain to the the EIP - ejabberddev.strax.co
  3. Changed the hostname of the machine to ejabberddev.strax.co
  4. ejabberd is installed.
  5. I get the error:

    20:55:32.313 [error] Failed to open socket at 52.22.184.194:7777 for mod_proxy65_stream: can't assign requested address
    
  6. ejabberd is trying to open a socket using the AWS elastic IP address - this will not work.

  7. I went into the ejabberd.yml file and added the ip variable to get ejabberd to use the AWS private ip for the macine.

    mod_proxy: 
      ip: 10.1.254.240
      access: local
      max_connections: 5
    
  8. This fix and issue the ejabberd was able to come up.

  9. For some reason the user I entered at install time admin and the domain ejabberddev.strax.co was not in the database so I entered it using this command.

    ejabberdctl register admin ejabberddev.strax.co admin
    
  10. This seemed to work so I tried to login into the web using these credentials and the URL containing the domain http://ejabberddev.strax.co:5280/admin

  11. When I logged in the following error happened:

    20:39:13.147 [error] CRASH REPORT Process <0.541.0> with 0 neighbours crashed with reason: bad argument in call to maps:from_list([html]) in ejabberd_http:apply_custom_headers/2 line 860
    20:39:13.147 [error] Supervisor ejabberd_http_sup had child undefined started with {ejabberd_http,start_link,undefined} at <0.541.0> exit with reason bad argument in call to maps:from_list([html]) in ejabberd_http:apply_custom_headers/2 line 860 in context child_terminated
    20:39:13.252 [info] (none) Accepted connection [::ffff:18.232.45.141]:54109 -> [::ffff:10.1.254.240]:5280
    20:39:13.252 [error] CRASH REPORT Process <0.542.0> with 0 neighbours crashed with reason: bad argument in call to maps:from_list([html]) in ejabberd_http:apply_custom_headers/2 line 860
    20:39:13.252 [error] Supervisor ejabberd_http_sup had child undefined started with {ejabberd_http,start_link,undefined} at <0.542.0> exit with reason bad argument in call to maps:from_list([html]) in ejabberd_http:apply_custom_headers/2 line 860 in context child_terminated
    20:39:13.459 [info] (<0.543.0>) Accepted connection [::ffff:18.232.45.141]:54110 -> [::ffff:10.1.254.240]:5280
    20:39:13.459 [error] CRASH REPORT Process <0.543.0> with 0 neighbours crashed with reason: bad argument in call to maps:from_list([html]) in ejabberd_http:apply_custom_headers/2 line 860
    20:39:13.460 [error] Supervisor ejabberd_http_sup had child undefined started with {ejabberd_http,start_link,undefined} at <0.543.0> exit with reason bad argument in call to maps:from_list([html]) in ejabberd_http:apply_custom_headers/2 line 860 in context child_terminated
    20:39:18.582 [info] (none) Accepted connection [::ffff:18.232.45.141]:54113 -> [::ffff:10.1.254.240]:5280
    20:39:18.582 [error] CRASH REPORT Process <0.544.0> with 0 neighbours crashed with reason: bad argument in call to maps:from_list([html]) in ejabberd_http:apply_custom_headers/2 line 860
    20:39:18.582 [error] Supervisor ejabberd_http_sup had child undefined started with {ejabberd_http,start_link,undefined} at <0.544.0> exit with reason bad argument in call to maps:from_list([html]) in ejabberd_http:apply_custom_headers/2 line 860 in context child_terminated
    20:39:48.712 [info] (none) Accepted connection [::ffff:18.232.45.141]:54122 -> [::ffff:10.1.254.240]:5280
    20:39:48.713 [error] CRASH REPORT Process <0.545.0> with 0 neighbours crashed with reason: bad argument in call to maps:from_list([html]) in ejabberd_http:apply_custom_headers/2 line 860
    20:39:48.713 [error] Supervisor ejabberd_http_sup had child undefined started with {ejabberd_http,start_link,undefined} at <0.545.0> exit with reason bad argument in call to maps:from_list([html]) in ejabberd_http:apply_custom_headers/2 line 860 in context child_terminated
    20:40:48.899 [info] (<0.547.0>) Accepted connection [::ffff:18.232.45.141]:54143 -> [::ffff:10.1.254.240]:5280
    20:40:48.900 [error] CRASH REPORT Process <0.547.0> with 0 neighbours crashed with reason: bad argument in call to maps:from_list([html]) in ejabberd_http:apply_custom_headers/2 line 860
    20:40:48.900 [error] Supervisor ejabberd_http_sup had child undefined started with {ejabberd_http,start_link,undefined} at <0.547.0> exit with reason bad argument in call to maps:from_list([html]) in ejabberd_http:apply_custom_headers/2 line 860 in context child_terminated
    20:45:49.083 [info] (none) Accepted connection [::ffff:18.232.45.141]:54241 -> [::ffff:10.1.254.240]:5280
    20:45:49.083 [error] CRASH REPORT Process <0.556.0> with 0 neighbours crashed with reason: bad argument in call to maps:from_list([html]) in ejabberd_http:apply_custom_headers/2 line 860
    20:45:49.083 [error] Supervisor ejabberd_http_sup had child undefined started with {ejabberd_http,start_link,undefined} at <0.556.0> exit with reason bad argument in call to maps:from_list([html]) in ejabberd_http:apply_custom_headers/2 line 860 in context child_terminated
    

Not sure what is error means. Based on the fact I cannot even install the ejabberd package and login in I think something is going wrong regarding the use of AWS elastic IPs. I have not found any document about installing ejabberd on AWS - any help will be appreciated.

Tim McClure

1

1 Answers

1
votes

20:39:13.147 [error] Supervisor ejabberd_http_sup had child undefined started with {ejabberd_http,start_link,undefined} at <0.541.0> exit with reason bad argument in call to maps:from_list([html]) in ejabberd_http:apply_custom_headers/2 line 860

This bug was introduced in ejabberd 20.02 when implementing other stuff, and right now is only fixed in git: https://github.com/processone/ejabberd/commit/00abf5d42c9b9c979b7ac69758a8f6745744f929

You can either apply that fix into your source code, or go back to previous ejabberd version, or wait for the next version.