processone / ejabberd-contrib

Growing and curated ejabberd contributions repository - PR or ask to join !
http://ejabberd.im
250 stars 137 forks source link

Webpresence status with php #260

Closed fx02 closed 5 years ago

fx02 commented 5 years ago

Hi, seems webpresence is a bit broken, I'm using php example script from front page. Seems Avatars don't display at all and status is undefined when Online with Miranda client. Away, DND and extended awas works. When I use Conversations client I get blank page. Using latest ejabberd server.

badlop commented 5 years ago

Hi, seems webpresence is a bit broken, I'm using php example script from front page. Seems Avatars don't display at all

I set the user avatar in the vCard as specified in https://xmpp.org/extensions/xep-0153.html with Tkabber client. Then in the .../avatar/ page, I can see it.

and status is undefined when Online with Miranda client. Away, DND and extended awas works.

I guess you refer to "show" element. In my tests I see that problem, and I've fixed it right now.

When I use Conversations client I get blank page. Using latest ejabberd server.

I guess that problem produces some error message in the ejabberd logs. Update the module, try again and check if there are any error lines in the ejabberd log files. If it still fails, please tell what URL you are visiting.

fx02 commented 5 years ago

Ok, that was my mistake with avatar I was expecting it will show some generic avatar if none is defined :) I can see now online! ty :+1:

Here is log:

2018-10-19 20:24:31.384 [debug] <0.812.0>@mod_webpresence:process:882 The call to path [<<"jid">>,<<"my_xmpp_username">>,<<"domain.com">>,<<"xml">>] in the
request: {request,'GET',[<<"presence">>,<<"jid">>,<<"my_xmpp_username">>,<<"domain.com">>,<<"xml">>],[{nokey,<<>>}],{<<>>,<<>>},undefined,<<"en">>,<<>>,{{159,69,195,216},59280},<<"domain.com">>,5280,[{dhfile,<<"/etc/letsencrypt/dhparam.pem">>},{protocol_options,<<"no_sslv2">>},{ciphers,<<"ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256">>},{register,true},{web_admin,true},{tls,true},{request_handlers,[{[<<"ws">>],ejabberd_http_ws},{[<<"bosh">>],mod_bosh},{[<<"oauth">>],ejabberd_oauth},{[<<"api">>],mod_http_api},{[<<"presence">>],mod_webpresence}]}],https,[{'Connection',<<"close">>},{'Host',<<"domain.com:5280">>}],0,fast_tls,{tlssock,#Port<0.22>,#Ref<0.3230567563.3563454465.161282>}}
crashed with error: {badarg,[{erlang,integer_to_list,[undefined],[]},{mod_webpresence,'-get_presences/1-fun-2-',1,[{file,"/opt/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_webpresence/src/mod_webpresence.erl"},{line,617}]},{lists,map,2,[{file,"lists.erl"},{line,1239}]},{mod_webpresence,get_presences,1,[{file,"/opt/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_webpresence/src/mod_webpresence.erl"},{line,610}]},{mod_webpresence,show_presence,1,[{file,"/opt/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_webpresence/src/mod_webpresence.erl"},{line,789}]},{mod_webpresence,process,2,[{file,"/opt/ejabberd/.ejabberd-modules/sources/ejabberd-contrib/mod_webpresence/src/mod_webpresence.erl"},{line,879}]},{ejabberd_http,process,2,[{file,"src/ejabberd_http.erl"},{line,401}]},{ejabberd_http,process_request,1,[{file,"src/ejabberd_http.erl"},{line,514}]}]}

ps. also opening directly gives me not found: https://domain.com:5280/presence/jid/my_xmpp_username/domain.com/xml and this log:

2018-10-19 20:35:28.981 [debug] <0.831.0>@ejabberd_http:process_header:304 ({tlssock,#Port<0.30>,#Ref<0.3230567563.3563454465.162688>}) http query: 'GET' <<"/presence/jid/my_xmpp_username/domain.com/xml">>
2018-10-19 20:35:28.981 [debug] <0.831.0>@ejabberd_http:process:391 [<<"presence">>,<<"jid">>,<<"my_xmpp_username">>,<<"domain.com">>,<<"xml">>] matches [<<"presence">>]
2018-10-19 20:35:28.982 [debug] <0.831.0>@mod_webpresence:process:881 {request,'GET',[<<"presence">>,<<"jid">>,<<"my_xmpp_username">>,<<"domain.com">>,<<"xml">>],[{nokey,<<>>}],{<<>>,<<>>},undefined,<<"en-US">>,<<>>,{{213,149,62,194},54038},<<"domain.com">>,5280,[{dhfile,<<"/etc/letsencrypt/dhparam.pem">>},{protocol_options,<<"no_sslv2">>},{ciphers,<<"ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256">>},{register,true},{web_admin,true},{tls,true},{request_handlers,[{[<<"ws">>],ejabberd_http_ws},{[<<"bosh">>],mod_bosh},{[<<"oauth">>],ejabberd_oauth},{[<<"api">>],mod_http_api},{[<<"presence">>],mod_webpresence}]}],https,[{'Accept-Language',<<"en-US,en;q=0.9,hr;q=0.8">>},{'Accept-Encoding',<<"gzip, deflate, br">>},{'Accept',<<"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8">>},{<<"Dnt">>,<<"1">>},{'User-Agent',<<"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36">>},{<<"Upgrade-Insecure-Requests">>,<<"1">>},{'Cache-Control',<<"max-age=0">>},{'Connection',<<"keep-alive">>},{'Host',<<"domain.com:5280">>}],0,fast_tls,{tlssock,#Port<0.30>,#Ref<0.3230567563.3563454465.162688>}}
2018-10-19 20:35:28.983 [debug] <0.831.0>@mod_webpresence:process:882 The call to path [<<"jid">>,<<"my_xmpp_username">>,<<"domain.com">>,<<"xml">>] in the
request: {request,'GET',[<<"presence">>,<<"jid">>,<<"my_xmpp_username">>,<<"domain.com">>,<<"xml">>],[{nokey,<<>>}],{<<>>,<<>>},undefined,<<"en-US">>,<<>>,{{213,149,62,194},54038},<<"domain.com">>,5280,[{dhfile,<<"/etc/letsencrypt/dhparam.pem">>},{protocol_options,<<"no_sslv2">>},{ciphers,<<"ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256">>},{register,true},{web_admin,true},{tls,true},{request_handlers,[{[<<"ws">>],ejabberd_http_ws},{[<<"bosh">>],mod_bosh},{[<<"oauth">>],ejabberd_oauth},{[<<"api">>],mod_http_api},{[<<"presence">>],mod_webpresence}]}],https,[{'Accept-Language',<<"en-US,en;q=0.9,hr;q=0.8">>},{'Accept-Encoding',<<"gzip, deflate, br">>},{'Accept',<<"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8">>},{<<"Dnt">>,<<"1">>},{'User-Agent',<<"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36">>},{<<"Upgrade-Insecure-Requests">>,<<"1">>},{'Cache-Control',<<"max-age=0">>},{'Connection',<<"keep-alive">>},{'Host',<<"domain.com:5280">>}],0,fast_tls,{tlssock,#Port<0.30>,#Ref<0.3230567563.3563454465.162688>}}
crashed with error: {noproc,{p1_server,call,[<0.810.0>,get_presence,1000]}}
badlop commented 5 years ago

Let's handle the problems one by one. If the one first mentioned in the ticket is solved, then this ticket can be closed. Then, after you update the code, if you find any other problem, open a new ticket, describing what happens wrong, how to reproduce it, etc. Otherwise, this becomes a mess of contradicting information and a headache to understand what is current and what is passed.