Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mi ul_rm_contact crashes opensips-cli #107

Open
andycol opened this issue Aug 9, 2023 · 2 comments
Open

mi ul_rm_contact crashes opensips-cli #107

andycol opened this issue Aug 9, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@andycol
Copy link

andycol commented Aug 9, 2023

Version: opensips-cli-0.1.20230512.161b5ea-1.noarch
OS: centos7

When i run a command example
mi ul_rm_contact "sip:[email protected]

opensips-cli crashes with

  File "/usr/lib64/python3.6/cmd.py", line 214, in onecmd
    func = getattr(self, 'do_' + cmd)
AttributeError: 'OpenSIPSCLI' object has no attribute 'do_mi'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/opensipscli/cli.py", line 413, in default
    aux = shlex.split(line)
  File "/usr/lib64/python3.6/shlex.py", line 305, in split
    return list(lex)
  File "/usr/lib64/python3.6/shlex.py", line 295, in __next__
    token = self.get_token()
  File "/usr/lib64/python3.6/shlex.py", line 105, in get_token
    raw = self.read_token()
  File "/usr/lib64/python3.6/shlex.py", line 187, in read_token
    raise ValueError("No closing quotation")
ValueError: No closing quotation

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/opensips-cli", line 9, in <module>
    run_console()
  File "/usr/bin/opensips-cli", line 6, in run_console
    main.main()
  File "/usr/lib/python3.6/site-packages/opensipscli/main.py", line 78, in main
    sys.exit(shell.cmdloop())
  File "/usr/lib/python3.6/site-packages/opensipscli/cli.py", line 258, in cmdloop
    super(OpenSIPSCLI, self).cmdloop(intro='')
  File "/usr/lib64/python3.6/cmd.py", line 138, in cmdloop
    stop = self.onecmd(line)
  File "/usr/lib64/python3.6/cmd.py", line 216, in onecmd
    return self.default(line)
  File "/usr/lib/python3.6/site-packages/opensipscli/cli.py", line 417, in default
    aux = shlex.split(line)
  File "/usr/lib64/python3.6/shlex.py", line 305, in split
    return list(lex)
  File "/usr/lib64/python3.6/shlex.py", line 295, in __next__
    token = self.get_token()
  File "/usr/lib64/python3.6/shlex.py", line 105, in get_token
    raw = self.read_token()
  File "/usr/lib64/python3.6/shlex.py", line 187, in read_token
    raise ValueError("No closing quotation")
ValueError: No closing quotation
@liviuchircu liviuchircu self-assigned this Oct 17, 2023
@liviuchircu liviuchircu added the bug Something isn't working label Oct 17, 2023
@liviuchircu
Copy link
Member

Hey @andycol! Brilliant!

Initially, I had a hard time wrapping my head around this, as it was apparently working for me:

opensips-cli (master) 19:45:11$ opensips-cli -x mi ul_rm_contact \"sip:[email protected]
ERROR: command 'ul_rm_contact' returned: -32602: Invalid params (Too few or too many parameters)
opensips-cli (master) 19:45:15$ opensips-cli -x mi ul_rm_contact x y \"sip:[email protected]
ERROR: command 'ul_rm_contact' returned: 404: Table not found
opensips-cli (master) 19:45:18$ opensips-cli -x mi ul_rm_contact location y \"sip:[email protected]
ERROR: command 'ul_rm_contact' returned: 404: AOR not found
opensips-cli (master) 19:45:20$ opensips-cli -x mi ul_rm_contact location liviu \"sip:[email protected]
ERROR: command 'ul_rm_contact' returned: 404: Contact not found

However, I then realized to enter CLI mode first! Needless to say, it was an instant reproduce:

opensips-cli (master) 19:46:26$ opensips-cli 
Welcome to OpenSIPS Command Line Interface!
(opensips-cli): mi ul_rm_contact "sip:[email protected]
Traceback (most recent call last):
  File "/usr/lib/python3.8/cmd.py", line 214, in onecmd
    func = getattr(self, 'do_' + cmd)
AttributeError: 'OpenSIPSCLI' object has no attribute 'do_mi'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/liviu/src/opensips-cli/opensipscli/cli.py", line 413, in default
    aux = shlex.split(line)
  File "/usr/lib/python3.8/shlex.py", line 311, in split
    return list(lex)
  File "/usr/lib/python3.8/shlex.py", line 300, in __next__
    token = self.get_token()
  File "/usr/lib/python3.8/shlex.py", line 109, in get_token
    raw = self.read_token()
  File "/usr/lib/python3.8/shlex.py", line 191, in read_token
    raise ValueError("No closing quotation")
ValueError: No closing quotation

@andycol
Copy link
Author

andycol commented Oct 18, 2023

Glad you could reproduce it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants