Hi All,
We are trying to query the json rpc server on our registrar for the contact of an aor, but we are seeing the following error(s) being displayed in the log when we query the location table:
ERROR: <core> [core/data_lump_rpl.c:83]: add_lump_rpl2(): LUMP_RPL_BODY already added! ERROR: xhttp [xhttp_mod.c:410]: xhttp_send_reply(): Error while adding reply lump
We are getting the aor details back in response from the rpc call, but the error's in the log are a little concerning and I cannot see where we are doing something wrong.
As an example, the following curl request returns the correct response, but the above error is displayed in the log, Am I doing something wrong here, I cannot see what the issue is:
curl --header 'Content-Type: application/json' --data-binary '{ "jsonrpc": "2.0", "method": "ul.lookup", "params": [ "location", "user@example.com" ], "id": 3 }' http://registrar.example.com/rpc
A secondary question is, is there an upper limit on the size of the "id" parameter?
This kamailio instance is v5.0.6.
Any thoughts as to what this error means?
Thanks
Hello,
this sounds like the body for reply was already set. Can you enable cfgtrace in debugger module and see what actions are executed in that situation?
Cheers, Daniel
On 17.05.18 18:22, Asgaroth wrote:
Hi All,
We are trying to query the json rpc server on our registrar for the contact of an aor, but we are seeing the following error(s) being displayed in the log when we query the location table:
ERROR: <core> [core/data_lump_rpl.c:83]: add_lump_rpl2(): LUMP_RPL_BODY already added! ERROR: xhttp [xhttp_mod.c:410]: xhttp_send_reply(): Error while adding reply lump
We are getting the aor details back in response from the rpc call, but the error's in the log are a little concerning and I cannot see where we are doing something wrong.
As an example, the following curl request returns the correct response, but the above error is displayed in the log, Am I doing something wrong here, I cannot see what the issue is:
curl --header 'Content-Type: application/json' --data-binary '{ "jsonrpc": "2.0", "method": "ul.lookup", "params": [ "location", "user@example.com" ], "id": 3 }' http://registrar.example.com/rpc
A secondary question is, is there an upper limit on the size of the "id" parameter?
This kamailio instance is v5.0.6.
Any thoughts as to what this error means?
Thanks
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Hi Daniel,
Thsnk for the suggestion, I will load the debugger module in the comming days and come back to you with the information.
Thanks
On 18/05/18 13:52, Daniel-Constantin Mierla wrote:
Hello,
this sounds like the body for reply was already set. Can you enable cfgtrace in debugger module and see what actions are executed in that situation?
Cheers, Daniel
On 17.05.18 18:22, Asgaroth wrote:
Hi All,
We are trying to query the json rpc server on our registrar for the contact of an aor, but we are seeing the following error(s) being displayed in the log when we query the location table:
ERROR: <core> [core/data_lump_rpl.c:83]: add_lump_rpl2(): LUMP_RPL_BODY already added! ERROR: xhttp [xhttp_mod.c:410]: xhttp_send_reply(): Error while adding reply lump
We are getting the aor details back in response from the rpc call, but the error's in the log are a little concerning and I cannot see where we are doing something wrong.
As an example, the following curl request returns the correct response, but the above error is displayed in the log, Am I doing something wrong here, I cannot see what the issue is:
curl --header 'Content-Type: application/json' --data-binary '{ "jsonrpc": "2.0", "method": "ul.lookup", "params": [ "location", "user@example.com" ], "id": 3 }' http://registrar.example.com/rpc
A secondary question is, is there an upper limit on the size of the "id" parameter?
This kamailio instance is v5.0.6.
Any thoughts as to what this error means?
Thanks
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Hi,
I performed the following:
# kamcmd dbg.trace on # curl --header 'Content-Type: application/json' \ --data-binary '{\ "jsonrpc": "2.0", \ "method": "ul.lookup", \ "params": [ "location","user@example.com"], \ "id": 3 }' http://registrar.example.com/rpc # kamcmd dbg.trace off
And the following was presented in the log file
[5843]: ERROR: *** cfgtrace:request_route=[xhttp:request] c=[/etc/kamailio/routing_logic.cfg] l=301 a=63 n=assign [5843]: ERROR: *** cfgtrace:request_route=[xhttp:request] c=[/etc/kamailio/routing_logic.cfg] l=305 a=16 n=if [5843]: ERROR: *** cfgtrace:request_route=[xhttp:request] c=[/etc/kamailio/routing_logic.cfg] l=303 a=24 n=jsonrpc_dispatch [5843]: ERROR: *** cfgtrace:request_route=[xhttp:request] c=[/etc/kamailio/routing_logic.cfg] l=305 a=63 n=assign [5843]: ERROR: *** cfgtrace:request_route=[xhttp:request] c=[/etc/kamailio/routing_logic.cfg] l=313 a=16 n=if [5843]: ERROR: *** cfgtrace:request_route=[xhttp:request] c=[/etc/kamailio/routing_logic.cfg] l=314 a=28 n=xhttp_reply [5843]: ERROR: <core> [core/data_lump_rpl.c:83]: add_lump_rpl2(): LUMP_RPL_BODY already added! [5843]: ERROR: xhttp [xhttp_mod.c:410]: xhttp_send_reply(): Error while adding reply lump
The relevent request route is as follows:
# Handling HTTP events event_route[xhttp:request] { $var(xhttp_rpc_root) = $(hu{s.substr,0,4}); if ($var(xhttp_rpc_root) == "/rpc") { jsonrpc_dispatch(); } $var(xhttp_rpc_root) = $(hu{s.substr,0,9}); if ($var(xhttp_rpc_root) == "/http_rpc") { dispatch_xhttp_rpc(); } #$var(xhttp_rpc_root) = $(hu{s.substr,0,8}); #if ($var(xhttp_rpc_root) == "/http_pi") { # dispatch_xhttp_pi(); #} xhttp_reply("200", "OK", "text/html", "<html><body>Wrong URL $hu</body></html>"); }
Just looking at the above event route, do I need to "exit" the if statements above, would the last xhttp_reply be causing this error?
Thanks
On 18/05/18 13:52, Daniel-Constantin Mierla wrote:
this sounds like the body for reply was already set. Can you enable cfgtrace in debugger module and see what actions are executed in that situation?
Updating the event route to:
event_route[xhttp:request] { $var(xhttp_uri) = $(hu{s.tolower});
xlog("L_INFO", "event_route[xhttp:request] : hu = '$hu' var(xhttp_uri) = '$var(xhttp_uri)'");
if ( $var(xhttp_uri) =~ "^/rpc") { jsonrpc_dispatch(); } else if ( $var(xhttp_uri) =~ "^/http_rpc") { dispatch_xhttp_rpc(); } else { xhttp_reply("200", "OK", "text/html", "<html><body>Wrong URL $hu</body></html>"); } return; }
Fixed the issue, sorry for the noise :)
On 06/06/18 15:47, Asgaroth wrote:
Hi,
I performed the following:
# kamcmd dbg.trace on # curl --header 'Content-Type: application/json' \ --data-binary '{\ "jsonrpc": "2.0", \ "method": "ul.lookup", \ "params": [ "location","user@example.com"], \ "id": 3 }' http://registrar.example.com/rpc # kamcmd dbg.trace off
And the following was presented in the log file
[5843]: ERROR: *** cfgtrace:request_route=[xhttp:request] c=[/etc/kamailio/routing_logic.cfg] l=301 a=63 n=assign [5843]: ERROR: *** cfgtrace:request_route=[xhttp:request] c=[/etc/kamailio/routing_logic.cfg] l=305 a=16 n=if [5843]: ERROR: *** cfgtrace:request_route=[xhttp:request] c=[/etc/kamailio/routing_logic.cfg] l=303 a=24 n=jsonrpc_dispatch [5843]: ERROR: *** cfgtrace:request_route=[xhttp:request] c=[/etc/kamailio/routing_logic.cfg] l=305 a=63 n=assign [5843]: ERROR: *** cfgtrace:request_route=[xhttp:request] c=[/etc/kamailio/routing_logic.cfg] l=313 a=16 n=if [5843]: ERROR: *** cfgtrace:request_route=[xhttp:request] c=[/etc/kamailio/routing_logic.cfg] l=314 a=28 n=xhttp_reply [5843]: ERROR: <core> [core/data_lump_rpl.c:83]: add_lump_rpl2(): LUMP_RPL_BODY already added! [5843]: ERROR: xhttp [xhttp_mod.c:410]: xhttp_send_reply(): Error while adding reply lump
The relevent request route is as follows:
# Handling HTTP events event_route[xhttp:request] { $var(xhttp_rpc_root) = $(hu{s.substr,0,4}); if ($var(xhttp_rpc_root) == "/rpc") { jsonrpc_dispatch(); } $var(xhttp_rpc_root) = $(hu{s.substr,0,9}); if ($var(xhttp_rpc_root) == "/http_rpc") { dispatch_xhttp_rpc(); } #$var(xhttp_rpc_root) = $(hu{s.substr,0,8}); #if ($var(xhttp_rpc_root) == "/http_pi") { # dispatch_xhttp_pi(); #} xhttp_reply("200", "OK", "text/html", "<html><body>Wrong URL $hu</body></html>"); }
Just looking at the above event route, do I need to "exit" the if statements above, would the last xhttp_reply be causing this error?
Thanks
On 18/05/18 13:52, Daniel-Constantin Mierla wrote:
this sounds like the body for reply was already set. Can you enable cfgtrace in debugger module and see what actions are executed in that situation?
OK, good it was sorted out, body being indeed added in two places with the first config.
Cheers, Daniel
On 06.06.18 17:41, Asgaroth wrote:
Updating the event route to:
event_route[xhttp:request] { $var(xhttp_uri) = $(hu{s.tolower});
xlog("L_INFO", "event_route[xhttp:request] : hu = '$hu' var(xhttp_uri) = '$var(xhttp_uri)'");
if ( $var(xhttp_uri) =~ "^/rpc") { jsonrpc_dispatch(); } else if ( $var(xhttp_uri) =~ "^/http_rpc") { dispatch_xhttp_rpc(); } else { xhttp_reply("200", "OK", "text/html", "<html><body>Wrong URL $hu</body></html>"); } return; }
Fixed the issue, sorry for the noise :)
On 06/06/18 15:47, Asgaroth wrote:
Hi,
I performed the following:
# kamcmd dbg.trace on # curl --header 'Content-Type: application/json' \ --data-binary '{\ "jsonrpc": "2.0", \ "method": "ul.lookup", \ "params": [ "location","user@example.com"], \ "id": 3 }' http://registrar.example.com/rpc # kamcmd dbg.trace off
And the following was presented in the log file
[5843]: ERROR: *** cfgtrace:request_route=[xhttp:request] c=[/etc/kamailio/routing_logic.cfg] l=301 a=63 n=assign [5843]: ERROR: *** cfgtrace:request_route=[xhttp:request] c=[/etc/kamailio/routing_logic.cfg] l=305 a=16 n=if [5843]: ERROR: *** cfgtrace:request_route=[xhttp:request] c=[/etc/kamailio/routing_logic.cfg] l=303 a=24 n=jsonrpc_dispatch [5843]: ERROR: *** cfgtrace:request_route=[xhttp:request] c=[/etc/kamailio/routing_logic.cfg] l=305 a=63 n=assign [5843]: ERROR: *** cfgtrace:request_route=[xhttp:request] c=[/etc/kamailio/routing_logic.cfg] l=313 a=16 n=if [5843]: ERROR: *** cfgtrace:request_route=[xhttp:request] c=[/etc/kamailio/routing_logic.cfg] l=314 a=28 n=xhttp_reply [5843]: ERROR: <core> [core/data_lump_rpl.c:83]: add_lump_rpl2(): LUMP_RPL_BODY already added! [5843]: ERROR: xhttp [xhttp_mod.c:410]: xhttp_send_reply(): Error while adding reply lump
The relevent request route is as follows:
# Handling HTTP events event_route[xhttp:request] { $var(xhttp_rpc_root) = $(hu{s.substr,0,4}); if ($var(xhttp_rpc_root) == "/rpc") { jsonrpc_dispatch(); } $var(xhttp_rpc_root) = $(hu{s.substr,0,9}); if ($var(xhttp_rpc_root) == "/http_rpc") { dispatch_xhttp_rpc(); } #$var(xhttp_rpc_root) = $(hu{s.substr,0,8}); #if ($var(xhttp_rpc_root) == "/http_pi") { # dispatch_xhttp_pi(); #} xhttp_reply("200", "OK", "text/html", "<html><body>Wrong URL $hu</body></html>"); }
Just looking at the above event route, do I need to "exit" the if statements above, would the last xhttp_reply be causing this error?
Thanks
On 18/05/18 13:52, Daniel-Constantin Mierla wrote:
this sounds like the body for reply was already set. Can you enable cfgtrace in debugger module and see what actions are executed in that situation?
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users