can not start module mod_http_offline in ejabberd 15.11 - xmpp

I am using ejabberd version 15.11 and erlang/OTP 17.
I am facing problem in adding mod_http_offline module.
I can compile it successfully, but when I add module initialization in ejabberd.yml it can not start module.
here is my error logs about the problem,
2015-12-04 14:27:17.435 [critical] <0.4264.0>#gen_mod:start_module:106 Problem starting the module mod_http_offline
for host <<"host">>
options: []
error: undef
[{ejabberd_logger,info_msg,
[mod_http_offline,20,"mod_http_offline loading",[]],
[]},
{mod_http_offline,start,2,[{file,"src/mod_http_offline.erl"},
{line,20}]},
{gen_mod,start_module,3,[{file,"src/gen_mod.erl"},{line,98}]},
{lists,foreach,2,[{file,"lists.erl"},{line,1336}]},
{ejabberd_app,start,2,[{file,"src/ejabberd_app.erl"},{line,73}]},
{application_master,start_it_old,4,
[{file,"application_master.erl"},{line,272}]}]
I have already refer below question:
INFO_MSG method fails in ejabberd
any little guidance will be a great help,
thanks

You need to compile it from the ejabberd source repository. It is not compile with the same logging option that ejabberd itself.

Related

Unable to open ejabbered web dashboard localhost:5280

I am new to ejabberd and trying to play with it. I installed ejabbered following the instructions present at official doc page with username and password. I am able to start the ejabbered server and connect to it through Java using "Smack" API's.
However, when I try to open Web Dashboard at http://localhost:5280/admin/ and then login with admin user, It doesn't show up anything. When I checked logs, it shows following erros -
2020-03-13 21:03:17.618 [error] <0.1965.0>#ejabberd_http:apply_custom_headers:860 CRASH REPORT Process <0.1965.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
2020-03-13 21:03:17.619 [error] <0.535.0>#ejabberd_http:apply_custom_headers:860 Supervisor ejabberd_http_sup had child undefined started with {ejabberd_http,start_link,undefined} at <0.1965.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
Pleasse help me out with this. Thanks!
Yes, that problem was introduced in ejabberd 20.02, and it's fixed in the following versions.
You have two options:
Download ejabberd 20.01, that doesn't have this problem
Or download ejabberd 20.03 or above.

ejabberd mod_push and mod_push_keepalive does not start

I run a ejabberd 16.09 server on Debian Stretch. When I enable the modules mod_push and/or mod_push_keepalive the server doesn´t start and the log file tells:
2019-03-15 11:16:03.535 [critical] <0.61.0>#gen_mod:start_module:162 Problem starting the module mod_push for host <<"jabber.mydomain.de">>
options: []
error: undef
[{mod_push,start,[<<"jabber.mydomain.de">>,[]],[]},
{gen_mod,start_module,3,[{file,"src/gen_mod.erl"},{line,154}]},
{lists,foreach,2,[{file,"lists.erl"},{line,1338}]},
{ejabberd_app,start,2,[{file,"src/ejabberd_app.erl"},{line,77}]},
{application_master,start_it_old,4,
[{file,"application_master.erl"},{line,273}]}]
2019-03-15 11:19:54.048 [critical] <0.61.0>#gen_mod:maybe_halt_ejabberd:170 ejabberd initialization was aborted because a module start failed.
Does anybody have a solution for it?
If you look closely, you won't find any mod_push file in your installation, because mod_push was first included in ejabberd 17.08 https://github.com/processone/ejabberd/commit/d6f1d3df5b5a75f618bcc6eeb6425bc47dfd84d2

Service gnocchi-api not found

I've been installing Ceilometer for Openstack Pike on Ubuntu 16.04 LTS using this install guide.
Everything went ok, up to the moment, when but when I've tried to restart gnocchi-api I got message
Failed to start gnocchi-api.service: Unit gnocchi-api.service not found.
I checked /etc/init.d and there is no script gnocchi-api (although gnocchi-metricd is, and it's working properly). Tried reinstalling package gnocchi-api, but it didn't help. When starting gnocchi-api normally, from the command line it works, although sends a bunch of warnings (but I think they are common)
I'm looking for a way to make it work normally - like a service and using conf file.
2017-11-27 20:01:40.593 6059 INFO gnocchi.rest.app [-] WSGI config used: /usr/lib/python2.7/dist-packages/gnocchi/rest/api-paste.ini
2017-11-27 20:01:40.753 6059 WARNING keystonemiddleware._common.config [-] The option "__file__" in conf is not known to auth_token
2017-11-27 20:01:40.759 6059 WARNING keystonemiddleware._common.config [-] The option "configkey" in conf is not known to auth_token
2017-11-27 20:01:40.760 6059 WARNING keystonemiddleware._common.config [-] The option "here" in conf is not known to auth_token
2017-11-27 20:01:40.762 6059 WARNING keystonemiddleware.auth_token [-] AuthToken middleware is set with keystone_authtoken.service_token_roles_required set to False. This is backwards compatible but deprecated behaviour. Please set this to True.
2017-11-27 20:01:40.768 6059 WARNING keystonemiddleware.auth_token [-] Configuring auth_uri to point to the public identity endpoint is required; clients may not be able to authenticate against an admin endpoint
STARTING test server gnocchi.rest.app.build_wsgi_app
Available at http://127.0.1.1:8000/
DANGER! For testing only, do not use in production
apt-get currently pulls version 3.1.9 of gnocchi-api. If you manually install gnocchi-api 3.1.2, this service file is very much there in it.
service gnocchi-api start works fine with this.
But I am not sure if functionality is ok or if this is an intended change with 3.1.9.. Still to check these.
This is the same on the latest version on Ubuntu 16.04 / gnocchi version 4.2.0
Confirmed bug as of now: https://bugs.launchpad.net/ceilometer/+bug/1750933
gnocchi-api.service unit cannot be started as it has not been created.

mod_zeropush stopped working in ejabberd 16.03

I am using mod_zeropush to send push to offline users that are offline in xmpp/ejabberd it was working fine with ejabberd version 15.07 but when i updated my version it stopped working and not hitting this given url.
2016-05-12 14:07:57.107 [warning] <0.809.0>#gen_mod:validate_opts:288 module 'mod_zeropush' doesn't export mod_opt_type/1
2016-05-12 14:07:57.107 [warning] <0.809.0>#gen_mod:validate_opts:288 module 'mod_zeropush' doesn't export mod_opt_type/1
2016-05-12 14:07:57.107 [warning] <0.809.0>#gen_mod:validate_opts:288 module 'mod_zeropush' doesn't export mod_opt_type/1
These are warnings it shows before starting module.
Here is error log from ejabberd.log file
Please help me
Thanks
mod_zeropush does not support ejabberd 16.03 because it uses Fast XML instead of p1_xml so don't upgrade to 16.xx version stay with 15.xx

How to resolve undef error in ejabberd hook

I have added a customized module named mod_confirm_delivery in ejabberd which has compiled and added successfully but when i am sending a message an error is coming in my ejabberd error log file, That is:
2016-03-15 17:03:38.306 [error] <0.2653.0>#ejabberd_hooks:run_fold1:368 {undef,[{mod_confirm_delivery,send_packet,[{xmlel,<<"iq">>,[{<<"xml:lang">>,<<"en">>},{<<"type">>,<<"get">>},{<<"id">>,<<"aacfa">>}],[{xmlcdata,<<"\n">>},{xmlel,<<"query">>,[{<<"xmlns">>,<<"jabber:iq:roster">>}],[]},{xmlcdata,<<"\n">>}]},{state,{socket_state,gen_tcp,#Port<0.58993>,<0.2652.0>},ejabberd_socket,#Ref<0.0.1.25301>,false,<<"12664578908237388886">>,undefined,c2s,c2s_shaper,false,false,false,false,[verify_none,compression_none],true,{jid,<<"test1">>,<<"localhost">>,<<"D-5">>,<<"test1">>,<<"localhost">>,<<"D-5">>},<<"test1">>,<<"localhost">>,<<"D-5">>,{{1458,41617,630679},<0.2653.0>},{2,{{<<"test2">>,<<"localhost">>,<<>>},{{<<"test1">>,<<"localhost">>,<<>>},nil,nil},nil}},{2,{{<<"test2">>,<<"localhost">>,<<>>},{{<<"test1">>,<<"localhost">>,<<>>},nil,nil},nil}},{0,nil},undefined,undefined,{userlist,none,[],false},c2s,ejabberd_auth_internal,{{127,0,0,1},41928},[],active,[],inactive,undefined,undefined,1000,undefined,300,300,false,0,0,true,<<"en">>},{jid,<<"test1">>,<<"localhost">>,<<"D-5">>,<<"test1">>,<<"localhost">>,<<"D-5">>},{jid,<<"test1">>,<<"localhost">>,<<>>,<<"test1">>,<<"localhost">>,<<>>}],[]},{ejabberd_hooks,safe_apply,3,[{file,"src/ejabberd_hooks.erl"},{line,382}]},{ejabberd_hooks,run_fold1,4,[{file,"src/ejabberd_hooks.erl"},{line,365}]},{ejabberd_c2s,session_established2,2,[{file,"src/ejabberd_c2s.erl"},{line,1268}]},{p1_fsm,handle_msg,10,[{file,"src/p1_fsm.erl"},{line,582}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,240}]}]}
I have ejabberd 16.02.26 and my module code is:
mod_confirm_delivery.erl
This module is working fine with ejabberd 2.1.13 but i want to upgraded my ejabberd. I can't understand what is the problem and how can I resolve this error.
undef error means the function or module is not found. The most likely error is that the mod_confirm_delivery.beam file is not in Erlang VM path.
You should try moving the compiled beam file with other ejabberd beam files or try setting the path used to launch Erlang to the directory where your mod_confirm_delivery.beam file is located. This is the -pa option of the Erlang VM.
If your code if in right place, other option is that the function is undefined. The hook tries to call mod_confirm_delivery:send_packet/4. Your code is wrong as it indeed does not defined send_packet/4 but only send_packet/3. You need to update your code to match new signature for user_send_packet hook:
user_send_packet(Packet, C2SState, From, To) -> Packet
In case of doubt, you can refer to official hook list in ejabberd documentation: https://docs.ejabberd.im/developer/hooks/