title: ejabberd server does not start because ``mod_shared_roster`` module fails to start
body: <p>I am trying to start an ejabberd server but when I run the command <code>ejabberdctl live</code> or <code>ejabberdctl foreground</code> I am getting an error.</p>
  
  <p>The error states that the <code>mod_shared_roster</code> module cannot start, but the error reason is <code>undef</code> which doesn't help much.</p>
  
  <p>I am new to ejabberd, I tried to change <code>hosts</code> value of <code>ejabberd.yml</code> (In ejabberd.yml file I changed <code>hosts - 'localhost'</code> to <code>hosts -'127.0.0.1'</code>) but found no success.</p>
  
  <p>Here's the terminal output</p>
  
  <pre><code>--------------------------------------------------------------------
  
  IMPORTANT: ejabberd is going to start in LIVE (interactive) mode.
  All log messages will be shown in the command shell.
  You can interact with the ejabberd node if you know how to use it.
  Please be extremely cautious with your actions,
  and exit immediately if you are not completely sure.
  
  To exit this LIVE mode and stop ejabberd, press:
    q().  and press the Enter key
  
  --------------------------------------------------------------------
  To bypass permanently this warning, add to ejabberdctl.cfg the line:
    EJABBERD_BYPASS_WARNINGS=true
  Press return to continue
  
  
  Erlang/OTP 20 [erts-9.0] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:10] [hipe] [kernel-poll:true]
  
  Eshell V9.0  (abort with ^G)
  (ejabberd@localhost)1&amp;gt; 00:22:49.650 [info] Application lager started on node ejabberd@localhost
  00:22:49.655 [info] Application crypto started on node ejabberd@localhost
  00:22:49.666 [info] Application sasl started on node ejabberd@localhost
  00:22:49.682 [info] Application asn1 started on node ejabberd@localhost
  00:22:49.682 [info] Application public_key started on node ejabberd@localhost
  00:22:49.729 [info] Application ssl started on node ejabberd@localhost
  00:22:49.732 [info] Application p1_utils started on node ejabberd@localhost
  00:22:49.742 [info] Application fast_yaml started on node ejabberd@localhost
  00:22:49.762 [info] Application fast_tls started on node ejabberd@localhost
  00:22:49.781 [info] Application fast_xml started on node ejabberd@localhost
  00:22:49.790 [info] Application stringprep started on node ejabberd@localhost
  00:22:49.797 [info] Application xmpp started on node ejabberd@localhost
  00:22:49.814 [info] Application cache_tab started on node ejabberd@localhost
  00:22:49.824 [info] Application iconv started on node ejabberd@localhost
  00:22:49.826 [info] Application jiffy started on node ejabberd@localhost
  00:22:49.826 [info] Loading configuration from /usr/local/etc/ejabberd/ejabberd.yml
  00:22:50.951 [info] Application mnesia started on node ejabberd@localhost
  00:22:51.055 [warning] module &amp;apos;ejabberd_c2s&amp;apos; doesn&amp;apos;t export listen_opt_type/1
  00:22:51.183 [info] Application inets started on node ejabberd@localhost
  00:22:51.277 [warning] module &amp;apos;mod_shared_roster&amp;apos; doesn&amp;apos;t export mod_opt_type/1
  00:22:51.280 [critical] Problem starting the module mod_shared_roster for host 127.0.0.1 
   options: []
   error: undef
  [{mod_shared_roster,start,[&amp;lt;&amp;lt;&amp;quot;127.0.0.1&amp;quot;&amp;gt;&amp;gt;,[]],[]},
   {gen_mod,start_module,4,[{file,&amp;quot;src/gen_mod.erl&amp;quot;},{line,199}]},
   {lists,foreach,2,[{file,&amp;quot;lists.erl&amp;quot;},{line,1338}]},
   {gen_mod,start_link,0,[{file,&amp;quot;src/gen_mod.erl&amp;quot;},{line,78}]},
   {supervisor,do_start_child,2,[{file,&amp;quot;supervisor.erl&amp;quot;},{line,365}]},
   {supervisor,start_children,3,[{file,&amp;quot;supervisor.erl&amp;quot;},{line,348}]},
   {supervisor,init_children,2,[{file,&amp;quot;supervisor.erl&amp;quot;},{line,314}]},
   {gen_server,init_it,2,[{file,&amp;quot;gen_server.erl&amp;quot;},{line,365}]}]
  00:22:51.280 [critical] ejabberd initialization was aborted because a module start failed.
  Problem starting the module mod_shared_roster for host 127.0.0.1 
   options: []
   error: undef
  [{mod_shared_roster,start,[&amp;lt;&amp;lt;&amp;quot;127.0.0.1&amp;quot;&amp;gt;&amp;gt;,[]],[]},
   {gen_mod,start_module,4,[{file,&amp;quot;src/gen_mod.erl&amp;quot;},{li
  
  Crash dump is being written to: /usr/local/var/log/ejabberd/erl_crash_20200520-002248.dump...done
  </code></pre>
  
  <p>here are partial contents of .dump file</p>
  
  <pre><code>=erl_crash_dump:0.3
  Wed May 20 01:20:15 2020
  Slogan: Problem starting the module mod_shared_roster for host localhost 
   options: []
   error: undef
  [{mod_shared_roster,start,[&lt;&lt;"localhost"&gt;&gt;,[]],[]},
   {gen_mod,start_module,4,[{file,"src/gen_mod.erl"},{li
  System version: Erlang/OTP 20 [erts-9.0] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:10] [hipe] [kernel-poll:true]
  Compiled: Sun May 17 03:40:44 2020
  Taints: ets_cache,iconv,jid,stringprep,fxml_stream,fxml,p1_sha,fast_yaml,crypto,erl_tracer
  Atoms: 21914
  Calling Thread: scheduler:1
  =scheduler:1
  Scheduler Sleep Info Flags: 
  Scheduler Sleep Info Aux Work: THR_PRGR_LATER_OP
  Current Port: 
  Run Queue Max Length: 0
  Run Queue High Length: 0
  Run Queue Normal Length: 1
  Run Queue Low Length: 0
  Run Queue Port Length: 0
  Run Queue Flags: NONEMPTY_NORMAL | OUT_OF_WORK | HALFTIME_OUT_OF_WORK | NONEMPTY | EXEC
  Current Process: &lt;0.231.0&gt;
  Current Process State: Running
  Current Process Internal State: ACT_PRIO_NORMAL | USR_PRIO_NORMAL | PRQ_PRIO_NORMAL | ACTIVE | RUNNING | TRAP_EXIT | ON_HEAP_MSGQ
  Current Process Program counter: 0x00007fe7a2a3ffa0 (timer:sleep/1 + 80)
  Current Process CP: 0x0000000000000000 (invalid)
  Current Process Limited Stack Trace:
  0x00007fe7a117fa38:SReturn addr 0xA1555C58 (gen_mod:start_module/4 + 3008)
  0x00007fe7a117fa40:SReturn addr 0xA579CCA0 (lists:foreach/2 + 120)
  0x00007fe7a117fa68:SReturn addr 0xA579CCA0 (lists:foreach/2 + 120)
  0x00007fe7a117fa80:SReturn addr 0xA15546D0 (gen_mod:start_link/0 + 176)
  0x00007fe7a117fa98:SReturn addr 0xA5784F08 (supervisor:do_start_child/2 + 280)
  0x00007fe7a117faa8:SReturn addr 0xA5784828 (supervisor:start_children/3 + 128)
  0x00007fe7a117fac8:SReturn addr 0xA5784248 (supervisor:init_children/2 + 224)
  0x00007fe7a117faf0:SReturn addr 0xA5945328 (gen_server:init_it/2 + 112)
  0x00007fe7a117fb08:SReturn addr 0xA5944BD0 (gen_server:init_it/6 + 280)
  0x00007fe7a117fb20:SReturn addr 0xA5764300 (proc_lib:init_p_do_apply/3 + 72)
  0x00007fe7a117fb60:SReturn addr 0x74E758 (&lt;terminate process normally&gt;)
  =scheduler:2
  Scheduler Sleep Info Flags: SLEEPING | POLL_SLEEPING | WAITING
  Scheduler Sleep Info Aux Work: 
  Current Port: 
  Run Queue Max Length: 0
  Run Queue High Length: 0
  Run Queue Normal Length: 0
  Run Queue Low Length: 0
  Run Queue Port Length: 0
  Run Queue Flags: OUT_OF_WORK
  Current Process: 
  =memory
  total: 34086872
  processes: 7603192
  processes_used: 7589856
  system: 26483680
  atom: 662433
  atom_used: 654099
  binary: 387144
  code: 15169299
  ets: 3073496
  =hash_table:atom_tab
  size: 19289
  used: 13177
  objs: 21913
  depth: 7
  =index_table:atom_tab
  size: 22528
  limit: 1048576
  entries: 21914
  =hash_table:module_code
  size: 397
  used: 266
  objs: 394
  depth: 5
  =index_table:module_code
  size: 1024
  limit: 65536
  entries: 394
  =hash_table:export_list
  size: 6421
  used: 4751
  objs: 8652
  depth: 7
  =index_table:export_list
  size: 9216
  limit: 524288
  entries: 8652
  =hash_table:export_list
  size: 6421
  used: 4741
  objs: 8607
  depth: 7
  =hash_table:process_reg
  size: 97
  used: 71
  objs: 116
  depth: 4
  =hash_table:fun_table
  size: 3203
  used: 2370
  objs: 4015
  depth: 7
  =hash_table:node_table
  size: 11
  used: 1
  objs: 1
  depth: 1
  =hash_table:dist_table
  size: 11
  used: 1
  objs: 1
  depth: 1
  =allocated_areas
  sys_misc: 72644
  static: 527312
  atom_space: 327760 319426
  atom_table: 334673
  module_table: 174456
  export_table: 375708
  export_list: 1522752
  register_table: 892
  fun_table: 25738
  module_refs: 18960
  loaded_code: 13051685
  dist_table: 563
  node_table: 251
  bits_bufs_size: 0
  bif_timer: 0
  link_lh: 0
  process_table: 3145728
  port_table: 393216
  ets_misc: 32768
  =allocator:sys_alloc
  option e: true
  option m: libc
  option tt: 131072
  option tp: 0
  =allocator:temp_alloc[0]
  versions: 2.1 3.0
  option e: true
  option t: 3
  option ramv: false
  option sbct: 524288
  option asbcst: 4145152
  option rsbcst: 90
  option rsbcmt: 80
  option rmbcmt: 100
  option mmbcs: 131072
  option mmsbc: 256
  option mmmbc: 18446744073709551615
  option lmbcs: 10485760
  option smbcs: 1048576
  option mbcgs: 10
  option acul: 0
  option mbsd: 3
  option as: gf
  mbcs blocks: 0 4 4
  mbcs blocks size: 0 8512 8512
  mbcs carriers: 1 1 1
  mbcs mseg carriers: 0
  mbcs sys_alloc carriers: 1
  mbcs carriers size: 131072 131072 131072
  mbcs mseg carriers size: 0
  mbcs sys_alloc carriers size: 131072
  sbcs blocks: 0 0 0
  sbcs blocks size: 0 0 0
  sbcs carriers: 0 0 0
  sbcs mseg carriers: 0
  sbcs sys_alloc carriers: 0
  sbcs carriers size: 0 0 0
  sbcs mseg carriers size: 0
  sbcs sys_alloc carriers size: 0
  temp_alloc calls: 2274
  temp_free calls: 2274
  temp_realloc calls: 0
  mseg_alloc calls: 0
  mseg_dealloc calls: 0
  mseg_realloc calls: 0
  sys_alloc calls: 1
  sys_free calls: 0
  sys_realloc calls: 0
  =allocator:temp_alloc[1]
  versions: 0.9 3.0
  option e: true
  option t: 3
  option ramv: false
  option sbct: 524288
  option asbcst: 4145152
  option rsbcst: 90
  option rsbcmt: 80
  option rmbcmt: 100
  option mmbcs: 131072
  option mmsbc: 256
  option mmmbc: 18446744073709551615
  option lmbcs: 10485760
  option smbcs: 1048576
  option mbcgs: 10
  option acul: 0
  option as: af
  mbcs blocks: 0 5 5
  mbcs blocks size: 0 423040 423040
  mbcs carriers: 1 2 2
  mbcs mseg carriers: 0
  mbcs sys_alloc carriers: 1
  mbcs carriers size: 131072 1179648 1179648
  mbcs mseg carriers size: 0
  mbcs sys_alloc carriers size: 131072
  sbcs blocks: 0 0 0
  sbcs blocks size: 0 0 0
  sbcs carriers: 0 0 0
  sbcs mseg carriers: 0
  sbcs sys_alloc carriers: 0
  sbcs carriers size: 0 0 0
  sbcs mseg carriers size: 0
  sbcs sys_alloc carriers size: 0
  temp_alloc calls: 186388
  temp_free calls: 186388
  temp_realloc calls: 1595
  mseg_alloc calls: 4
  mseg_dealloc calls: 4
  mseg_realloc calls: 0
  sys_alloc calls: 1
  sys_free calls: 0
  sys_realloc calls: 0
  =allocator:temp_alloc[2]
  versions: 0.9 3.0
  option e: true
  option t: 3
  option ramv: false
  option sbct: 524288
  option asbcst: 4145152
  option rsbcst: 90
  option rsbcmt: 80
  option rmbcmt: 100
  option mmbcs: 131072
  option mmsbc: 256
  option mmmbc: 18446744073709551615
  option lmbcs: 10485760
  option smbcs: 1048576
  option mbcgs: 10
  option acul: 0
  option as: af
  mbcs blocks: 1 4 4
  mbcs blocks size: 4104 29152 29152
  mbcs carriers: 1 1 1
  mbcs mseg carriers: 0
  mbcs sys_alloc carriers: 1
  mbcs carriers size: 131072 131072 131072
  mbcs mseg carriers size: 0
  mbcs sys_alloc carriers size: 131072
  sbcs blocks: 0 0 0
  sbcs blocks size: 0 0 0
  sbcs carriers: 0 0 0
  sbcs mseg carriers: 0
  sbcs sys_alloc carriers: 0
  sbcs carriers size: 0 0 0
  sbcs mseg carriers size: 0
  sbcs sys_alloc carriers size: 0
  temp_alloc calls: 14712
  temp_free calls: 14711
  temp_realloc calls: 674
  mseg_alloc calls: 0
  mseg_dealloc calls: 0
  mseg_realloc calls: 0
  sys_alloc calls: 1
  sys_free calls: 0
  sys_realloc calls: 0
  =allocator:sl_alloc[0]
  versions: 0.9 3.0
  option e: true
  option t: 3
  option ramv: false
  option sbct: 524288
  option asbcst: 4145152
  option rsbcst: 80
  option rsbcmt: 80
  option rmbcmt: 50
  option mmbcs: 65536
  option mmsbc: 256
  option mmmbc: 18446744073709551615
  option lmbcs: 5242880
  option smbcs: 524288
  option mbcgs: 10
  option acul: 0
  option as: aoffcbf
  mbcs blocks: 1 183 183
  mbcs blocks size: 520 49192 49192
  mbcs carriers: 1 1 1
  mbcs mseg carriers: 0
  mbcs sys_alloc carriers: 1
  mbcs carriers size: 65536 65536 65536
  mbcs mseg carriers size: 0
  mbcs sys_alloc carriers size: 65536
  sbcs blocks: 0 0 0
  sbcs blocks size: 0 0 0
  sbcs carriers: 0 0 0
  sbcs mseg carriers: 0
  sbcs sys_alloc carriers: 0
  sbcs carriers size: 0 0 0
  
  </code></pre>
  
  <p>Please help me find out what I am doing wrong, thanks.</p>