[OpenSIPS-Users] I am facing some issue while creating DB through opensips-cli .

Donat Zenichev donat.zenichev at gmail.com
Thu Nov 26 08:54:38 EST 2020


One remark though :)
I just noticed that the version of my opensips-cli sources was a bit
outdated.
And your "diagnose.py" should have looked different. Nevertheless, this
doesn't change the sense of what I said last time.

A quick search through the sources of fresh opensips-cli (at github of the
project), gives me "defaults.py" as a holder of port number definitions for
sockets.

Then try to pay an attention on:
https://github.com/OpenSIPS/opensips-cli/blob/524c0202eb31eabef90a553c696d59424ea09015/opensipscli/defaults.py#L67
and
https://github.com/OpenSIPS/opensips-cli/blob/524c0202eb31eabef90a553c696d59424ea09015/opensipscli/defaults.py#L79

I didn't try to reproduce your issue with a more fresh opensips-cli
sources, but I'm confident this will be the same reason.
Have a nice day :)

On Thu, Nov 26, 2020 at 10:18 AM Donat Zenichev <donat.zenichev at gmail.com>
wrote:

> Hi Sasmita,
>
> First of all try to make sure that the needed module is loaded indeed,
> what opensips.log says after starting the application?
> There should be something like:
> "opensips[25960]: NOTICE:event_jsonrpc:mod_init: initializing module ..."
>
> Also, as I can see, your output seems to be truncated, could you upload a
> full python traceback?
> A brief attempt to reproduce your problem led me to the following.
>
> Sometimes the output error description can be a bit non-descriptive.
> So that module "event_jsonrpc.so" is loaded indeed, but something else
> appears to be a real obstacle.
>
> In my case, I basically tried to reproduce the issue by begetting a
> contradiction of port numbers used on the system.
> As you run the command "sudo opensips-cli -x diagnose sql", this by
> default tries to engage a TCP socket and bind it to 8888.
> You can easily check this with: sudo watch -n0.5 "netstat -tulpn | grep
> 8888"
> after running diagnose sub-tool of opensips-cli.
>
> And the reason for that is this code "./opensipscli/modules/diagnose.py"
> where it's defined that:
> "JSONRPC_RCV_PORT = 8888"
>
> So it seems to be that the default way to communicate over MI interface is
> http based (I might be mistaken here).
> A quotation taken from: https://github.com/OpenSIPS/opensips-cli
>  "url: The default URL used when http communication_type is used (Default:
> http://127.0.0.1:8888/mi)"
>
> Getting back to the original question.
> We have at least this module - "httpd.so", who could try to engage the
> same port on your system.
> Sometimes "httpd.so" works in common with "mi_http.so" though.
> Eventually after loading at least "httpd.so" on my system, "sudo
> opensips-cli -x diagnose sql" stopped working.
>
> And my traceback was as following (is that similar to what you have?) :
>
> "
> sudo opensips-cli -x diagnose sql
> Exception in thread Thread-1:
> Traceback (most recent call last):
>   File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
>     self.run()
>   File "/usr/lib/python3.6/threading.py", line 864, in run
>     self._target(*self._args, **self._kwargs)
>   File
> "/usr/local/lib/python3.6/dist-packages/opensipscli-0.1.0-py3.6.egg/opensipscli/modules/diagnose.py",
> line 114, in collect_events
>     s.bind((JSONRPC_RCV_HOST, JSONRPC_RCV_PORT))
> OSError: [Errno 98] Address already in use
>
> ERROR: Failed to subscribe for JSON-RPC events
> ERROR: Is the event_jsonrpc.so OpenSIPS module loaded?
> "
>
> I hope you will find this useful. Otherwise, please provide a full
> traceback.
>
> On Thu, Nov 26, 2020 at 8:01 AM Sasmita Panda <spanda at 3clogic.com> wrote:
>
>> Hi ,
>>
>> opensips-cli -x  diagnose sql
>> ERROR: Failed to subscribe for JSON-RPC events
>> ERROR: Is the event_stream.so OpenSIPS module loaded?
>>
>> event_stream.so module is loaded by default . What else I should do to
>> get this output . Nothing I am getting from opensips-cli document .
>>
>>
>>
>> *Thanks & Regards*
>> *Sasmita Panda*
>> *Senior Network Testing and Software Engineer*
>> *3CLogic , ph:07827611765*
>>
>>
>> On Fri, Nov 20, 2020 at 5:42 PM Sasmita Panda <spanda at 3clogic.com> wrote:
>>
>>> Thanks a lot .
>>>
>>> That works .
>>>
>>>
>>> *Thanks & Regards*
>>> *Sasmita Panda*
>>> *Senior Network Testing and Software Engineer*
>>> *3CLogic , ph:07827611765*
>>>
>>>
>>> On Fri, Nov 20, 2020 at 4:55 PM Liviu Chircu <liviu at opensips.org> wrote:
>>>
>>>> On 20.11.2020 13:15, Sasmita Panda wrote:
>>>>
>>>>   File "/usr/lib/python3/dist-packages/MySQLdb/connections.py", line
>>>> 204, in __init__
>>>>     super(Connection, self).__init__(*args, **kwargs2)
>>>> _mysql_exceptions.OperationalError: (1049, "Unknown database
>>>> 'opensips'")
>>>>
>>>> I think the problem may be related to this setting:
>>>>
>>>> *    database_admin_url: mysql://root:cccl0g1c@localhost/opensips*
>>>>
>>>> Try to remove the trailing "/opensips" part of the URL, because the
>>>> database name is given by the "database_name" setting.
>>>>
>>>> If it fixes the issue, we should push a commit which does this
>>>> automatically.
>>>>
>>>> --
>>>> Liviu Chircuwww.twitter.com/liviuchircu | www.opensips-solutions.com
>>>>
>>>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>
>
> --
>
> Best regards,
> Donat Zenichev
>
>

-- 

Best regards,
Donat Zenichev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20201126/35e94a6b/attachment-0001.html>


More information about the Users mailing list