<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        mso-fareast-language:EN-IE;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-IE link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>Hi Igor,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>I personally don’t use the xcap module, but looking at that error message, it seems to me that Kamailio cannot find the subscriber table which it will use to lookup the authentication details.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>Are you sure you have your Kamailio database and Kamailio database related settings setup properly?<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>Cheers<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif'> sr-users [mailto:sr-users-bounces@lists.sip-router.org] <b>On Behalf Of </b>Igor Olhovskiy<br><b>Sent:</b> Wednesday 12 August 2015 11:37<br><b>To:</b> sr-users@lists.sip-router.org<br><b>Subject:</b> [SR-Users] XCap Server + Postgre<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>Hi!<o:p></o:p></p><div><p class=MsoNormal>I'm experience really strange behavior of Kamailio.<o:p></o:p></p></div><div><p class=MsoNormal>Right now it's using postgre database<o:p></o:p></p></div><div><p class=MsoNormal>When trying to implement XCAP server capabilities, according to <a href="http://kamailio.org/docs/modules/4.3.x/modules/xcap_server.html#idp76784">http://kamailio.org/docs/modules/4.3.x/modules/xcap_server.html#idp76784</a><o:p></o:p></p></div><div><p class=MsoNormal>on a block<o:p></o:p></p></div><div><div style='mso-element:para-border-div;border:solid #99CCCC 1.0pt;padding:0cm 0cm 0cm 15.0pt;background:#FEFEEE'><pre style='background:#FEFEEE;border:none;padding:0cm'><span style='color:black'>    if (!www_authorize("xcap", "subscriber"))<o:p></o:p></span></pre><pre style='background:#FEFEEE;border:none;padding:0cm'><span style='color:black'>    {<o:p></o:p></span></pre><pre style='background:#FEFEEE;border:none;padding:0cm'><span style='color:black'>        www_challenge("xcap", "0");<o:p></o:p></span></pre><pre style='background:#FEFEEE;border:none;padding:0cm'><span style='color:black'>        exit;<o:p></o:p></span></pre><pre style='background:#FEFEEE;border:none;padding:0cm'><span style='color:black'>    }<o:p></o:p></span></pre></div></div><div><div><p class=MsoNormal>While trying to test it via browser (user test, pass test)<o:p></o:p></p></div><div><p class=MsoNormal>I've got these errors in log<o:p></o:p></p></div><div><div><p class=MsoNormal><span style='font-family:"Courier New"'>Aug 12 12:34:57 sip01 /usr/sbin/kamailio[7655]: WARNING: db_postgres [km_dbase.c:235]: db_postgres_submit_query(): postgres result check failed with code 7 (PGRES_FATAL_ERROR)</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Courier New"'>Aug 12 12:34:57 sip01 /usr/sbin/kamailio[7655]: WARNING: db_postgres [km_dbase.c:239]: db_postgres_submit_query(): postgres query command failed, connection status 0, error [ERROR:  relation "subscriber" does not exist#012LINE 1: select password from subscriber where extension='test' AND u...#012                             ^#012]</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Courier New"'>Aug 12 12:34:57 sip01 /usr/sbin/kamailio[7655]: WARNING: db_postgres [km_dbase.c:235]: db_postgres_submit_query(): postgres result check failed with code 7 (PGRES_FATAL_ERROR)</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Courier New"'>Aug 12 12:34:57 sip01 /usr/sbin/kamailio[7655]: WARNING: db_postgres [km_dbase.c:239]: db_postgres_submit_query(): postgres query command failed, connection status 0, error [ERROR:  relation "subscriber" does not exist#012LINE 1: select password from subscriber where extension='test' AND u...#012                             ^#012]</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Courier New"'>Aug 12 12:34:57 sip01 /usr/sbin/kamailio[7655]: WARNING: db_postgres [km_dbase.c:235]: db_postgres_submit_query(): postgres result check failed with code 7 (PGRES_FATAL_ERROR)</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Courier New"'>Aug 12 12:34:57 sip01 /usr/sbin/kamailio[7655]: WARNING: db_postgres [km_dbase.c:239]: db_postgres_submit_query(): postgres query command failed, connection status 0, error [ERROR:  relation "subscriber" does not exist#012LINE 1: select password from subscriber where extension='test' AND u...#012                             ^#012]</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Courier New"'>Aug 12 12:34:57 sip01 /usr/sbin/kamailio[7655]: ERROR: db_postgres [km_dbase.c:247]: db_postgres_submit_query(): 0x7f3fb0660b10 PQsendQuery Error: ERROR:  relation "subscriber" does not exist#012LINE 1: select password from subscriber where extension='test' AND u...#012                             ^#012 Query: select password from subscriber where extension='test' AND user_context='xcap'</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Courier New"'>Aug 12 12:34:57 sip01 /usr/sbin/kamailio[7655]: ERROR: <core> [db_query.c:132]: db_do_query_internal(): error while submitting query</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Courier New"'>Aug 12 12:34:57 sip01 /usr/sbin/kamailio[7655]: ERROR: auth_db [authorize.c:175]: get_ha1(): failed to query database</span><o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div></div><div><p class=MsoNormal>Without this block, I don't get user auth.<o:p></o:p></p></div><div><p class=MsoNormal>Is it a bug or it's mine misconfiguration?<o:p></o:p></p></div><p class=MsoNormal>-- <o:p></o:p></p><div><div><p class=MsoNormal>Best regards,<o:p></o:p></p><div><p class=MsoNormal>Igor<o:p></o:p></p></div></div></div></div></div></div></body></html>