Closed voztovoice closed 3 years ago
I can't solve. CentOS 8.4 Python 3.6 Thank you
Same problem with Ubuntu 20, opensips 3.2, mariadb 10.3 and the newest opensipscli master branch
$ cat /etc/os-release NAME="Ubuntu" VERSION="20.04.2 LTS (Focal Fossa)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 20.04.2 LTS" VERSION_ID="20.04"
$ opensips -V version: opensips 3.2.0-rc1 (x86_64/linux) flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, HP_MALLOC, DBG_MALLOC, CC_O0, FAST_LOCK-ADAPTIVE_WAIT ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535 poll method support: poll, epoll, sigio_rt, select. git revision: 3c84aae84 main.c compiled on 08:38:02 Jul 21 2021 with gcc 9
$ mysql -V mysql Ver 15.1 Distrib 10.3.29-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
cd /usr/local/src/ git clone https://github.com/OpenSIPS/opensips-cli.git cd opensips-cli/ aptitude install python3 python3-pip python3-dev pip3 install mysqlclient sqlalchemy sqlalchemy-utils pyOpenSSL python3 setup.py install clean
$ cat opensips-cli.cfg [default] log_level: WARNING prompt_name: opensips-cli prompt_intro: Welcome to OpenSIPS Command Line Interface! prompt_emptyline_repeat_cmd: False history_file: /var/log/opensips-cli.history history_file_size: 1000 output_type: pretty-print communication_type: fifo fifo_file: /tmp/opensips_fifo database_admin_url: mysql://root@localhost database_url: mysql://opensips:opensipsrw@localhost database_schema_path: /usr/local/src/opensips-3.2/scripts/ database_modules: ALL
Welcome to OpenSIPS Command Line Interface! (opensips-cli): database create Password for admin MySQL user (root): Traceback (most recent call last): File "/usr/lib/python3.8/cmd.py", line 214, in onecmd func = getattr(self, 'do_' + cmd) AttributeError: 'OpenSIPSCLIShell' object has no attribute 'do_database'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "bin/opensips-cli", line 9, in
Thank you for the reports, @voztovoice and @thuroc, I managed to reproduce on CentOS 8. Working on pushing a fix ASAP!
PS: my apologies for the delay in coming back to you!
It seems that the SQLAlchemy 1.4
software is backwards-incompatible with the previous 1.3.x
release line, due to this change. Of course, this breaks the opensips-cli
database
command on all distros: Debian, CentOS, etc.
The good news is that the package-based installs are fine, since 1.4
has not yet made it into mainline packages. However, I will update the source-code install instructions, in order to always force a pre-1.4
version. Expect a further update from my side once this is done.
Thank you Liviu
I just pushed a different fix for this problem, which should make opensips-cli
compatible with both 1.3.x
and 1.4.x
SQLAlchemy. So if you could pull the latest CLI sources or tonight's packages and let me know if you ran into any more trouble, that would be great! Cheers!
The patch works fine. Thank you for the fast help.
I'm using opensips-cli on CentOS8 using these installation steps:
pip3 install mysqlclient sqlalchemy sqlalchemy-utils pyOpenSSL
cd /usr/src
git clone https://github.com/opensips/opensips-cli opensips-cli
cd opensips-cli
python3 setup.py install clean
nano /etc/opensips-cli.cfg
[default] history_file_size=10000 database_schema_path=/share/opensips database_url=mysql://opensips:password@localhost database_modules=ALL
opensips-cli -x database create Password for admin MySQL user (root):
Traceback (most recent call last): File "/usr/local/bin/opensips-cli", line 4, in
import('pkg_resources').run_script('opensipscli==0.1.0', 'opensips-cli')
File "/usr/lib/python3.6/site-packages/pkg_resources/init.py", line 654, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python3.6/site-packages/pkg_resources/init.py", line 1434, in run_script
exec(code, namespace, namespace)
File "/usr/local/lib/python3.6/site-packages/opensipscli-0.1.0-py3.6.egg/EGG-INFO/scripts/opensips-cli", line 9, in
run_console()
File "/usr/local/lib/python3.6/site-packages/opensipscli-0.1.0-py3.6.egg/EGG-INFO/scripts/opensips-cli", line 6, in run_console
main.main()
File "/usr/local/lib/python3.6/site-packages/opensipscli-0.1.0-py3.6.egg/opensipscli/main.py", line 78, in main
sys.exit(shell.cmdloop())
File "/usr/local/lib/python3.6/site-packages/opensipscli-0.1.0-py3.6.egg/opensipscli/cli.py", line 248, in cmdloop
ret = self.run_command(self.command[0], command, params)
File "/usr/local/lib/python3.6/site-packages/opensipscli-0.1.0-py3.6.egg/opensipscli/cli.py", line 363, in run_command
return mod[0].invoke(cmd, params)
File "/usr/local/lib/python3.6/site-packages/opensipscli-0.1.0-py3.6.egg/opensipscli/module.py", line 36, in invoke
return f(params)
File "/usr/local/lib/python3.6/site-packages/opensipscli-0.1.0-py3.6.egg/opensipscli/modules/database.py", line 367, in do_create
admin_url = self.get_admin_db_url(db_name)
File "/usr/local/lib/python3.6/site-packages/opensipscli-0.1.0-py3.6.egg/opensipscli/modules/database.py", line 316, in get_admin_db_url
admin_url = osdb.set_url_password(admin_url, pswd)
File "/usr/local/lib/python3.6/site-packages/opensipscli-0.1.0-py3.6.egg/opensipscli/db.py", line 874, in set_url_password
url.password = password
AttributeError: can't set attribute
ls /share/opensips
dbtext menuconfig_templates mysql
Thank you