OpenSIPS / opensips-cli

OpenSIPS CLI tool - an interactive command line tool that can be used to control and monitor OpenSIPS servers.
GNU General Public License v3.0
88 stars 48 forks source link

user add fails #16

Closed IgnatiusCheng closed 5 years ago

IgnatiusCheng commented 5 years ago

File "/usr/local/lib/python3.6/dist-packages/opensipscli-0.1-py3.6.egg/opensipscli/modules/user.py", line 55, in user_db_connect db.use() AttributeError: 'osdb' object has no attribute 'use'

osdb.use() is not longer available.

liviuchircu commented 5 years ago

Managed to reproduce instantly, looks like another regression from the Postgres support:

(opensips-cli): user add liviu
Please provide the domain of the user: test.com
Traceback (most recent call last):
  File "/usr/lib/python3.6/cmd.py", line 214, in onecmd
    func = getattr(self, 'do_' + cmd)
AttributeError: 'OpenSIPSCLIShell' object has no attribute 'do_user'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/opensips-cli", line 4, in <module>
    __import__('pkg_resources').run_script('opensipscli==0.1', 'opensips-cli')
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 658, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1438, in run_script
    exec(code, namespace, namespace)
  File "/usr/local/lib/python3.6/dist-packages/opensipscli-0.1-py3.6.egg/EGG-INFO/scripts/opensips-cli", line 9, in <module>
    run_console()
  File "/usr/local/lib/python3.6/dist-packages/opensipscli-0.1-py3.6.egg/EGG-INFO/scripts/opensips-cli", line 6, in run_console
    main.main()
  File "/home/liviu/src/opensips-cli/opensipscli/main.py", line 78, in main
    sys.exit(shell.cmdloop())
  File "/home/liviu/src/opensips-cli/opensipscli/cli.py", line 232, in cmdloop
    super(OpenSIPSCLIShell, self).cmdloop(intro='')
  File "/usr/lib/python3.6/cmd.py", line 138, in cmdloop
    stop = self.onecmd(line)
  File "/usr/lib/python3.6/cmd.py", line 216, in onecmd
    return self.default(line)
  File "/home/liviu/src/opensips-cli/opensipscli/cli.py", line 342, in default
    self.run_command(module, cmd, params)
  File "/home/liviu/src/opensips-cli/opensipscli/cli.py", line 331, in run_command
    return mod[0].__invoke__(cmd, params)
  File "/home/liviu/src/opensips-cli/opensipscli/module.py", line 36, in __invoke__
    return f(params)
  File "/home/liviu/src/opensips-cli/opensipscli/modules/user.py", line 103, in do_add
    db = self.user_db_connect()
  File "/home/liviu/src/opensips-cli/opensipscli/modules/user.py", line 55, in user_db_connect
    db.use()
AttributeError: 'osdb' object has no attribute 'use'
liviuchircu commented 5 years ago

@IgnatiusCheng please pull latest code and try again. Cheers!

IgnatiusCheng commented 5 years ago

I still have issue, with user add. The opensips-cli did not populate the password column in the database. It did populate the ha1 and ha1b columns.

I have to manually update/set the password column in mysql subscriber table before the client will register.


From: Liviu Chircu notifications@github.com Sent: June 25, 2019 4:59 PM To: OpenSIPS/opensips-cli Cc: IgnatiusCheng; Mention Subject: Re: [OpenSIPS/opensips-cli] user add fails (#16)

@IgnatiusChenghttps://github.com/IgnatiusCheng please pull latest code and try again. Cheers!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/OpenSIPS/opensips-cli/issues/16?email_source=notifications&email_token=AMMRBTC2F3MOJ6TVHJDRMDTP4JFGLA5CNFSM4HZEIPGKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYQ5A6A#issuecomment-505532536, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMMRBTDGJIYM2G4BUFWUJNTP4JFGLANCNFSM4HZEIPGA.

liviuchircu commented 5 years ago

Please open a separate issue for this. It seems user add is only meant to work with the default password mode: "hashed", and has no support for the alternate (and unsafe) "plaintext password" storage mode.