Closed sstef93 closed 4 years ago
Does this happen every time you try to create the tables?
When i execute the cmd "database create" on opensips-cli . I managed to set it up by importing the .sql files manually tho.
I've just committed a fix for this - could you please test again and let us know if it works this time?
I've just committed a fix for this - could you please test again and let us know if it works this time?
I got the same issue on 3.0 latest nightly version
@bibace @sstef93 , I'm having a hard time reproducing this. Find below my environment:
[root@localhost opensips-cli]# cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
[root@localhost opensips-cli]# cat ~/.opensips-cli.cfg
[default]
log_level: INFO
prompt_name: opensips-cli
prompt_intro: Welcome to OpenSIPS Command Line Interface!
prompt_emptyline_repeat_cmd: False
history_file: ~/.opensips-cli.history
history_file_size: 1000
output_type: pretty-print
communication_type: fifo
fifo_file: /tmp/opensips_fifo
template_url: mysql://root:@localhost
database_user_url: mysql://root:@localhost
database_path: /root/src/opensips-3.0/scripts
[root@localhost opensips-cli]# opensips-cli -x database create
Create [a]ll tables or just the [c]urrently configured ones? (Default value is a): a
Creating all tables ...
Running standard-create.sql...
Running tracer-create.sql...
Running emergency-create.sql...
Running b2b-create.sql...
Running closeddial-create.sql...
Running imc-create.sql...
Running usrloc-create.sql...
Running registrant-create.sql...
Running alias_db-create.sql...
Running rls-create.sql...
Running drouting-create.sql...
Running msilo-create.sql...
Running dialog-create.sql...
Running avpops-create.sql...
Running presence-create.sql...
Running carrierroute-create.sql...
Running userblacklist-create.sql...
Running rtpengine-create.sql...
Running freeswitch_scripting-create.sql...
Running cachedb_sql-create.sql...
Running clusterer-create.sql...
Running acc-create.sql...
Running group-create.sql...
Running b2b_sca-create.sql...
Running permissions-create.sql...
Running domainpolicy-create.sql...
Running dispatcher-create.sql...
Running speeddial-create.sql...
Running domain-create.sql...
Running tls_mgm-create.sql...
Running smpp-create.sql...
Running fraud_detection-create.sql...
Running dialplan-create.sql...
Running cpl-create.sql...
Running load_balancer-create.sql...
Running auth_db-create.sql...
Running rtpproxy-create.sql...
Running call_center-create.sql...
INFO: database tables have been successfully created.
My opensips-cli
was installed according to the Install Guide. Any hints are appreciated until I understand more about this exception. Thanks!
@bibace @sstef93 , I'm having a hard time reproducing this. Find below my environment:
[root@localhost opensips-cli]# cat /etc/os-release NAME="CentOS Linux" VERSION="7 (Core)" ID="centos" ID_LIKE="rhel fedora" VERSION_ID="7" PRETTY_NAME="CentOS Linux 7 (Core)" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:centos:centos:7" HOME_URL="https://www.centos.org/" BUG_REPORT_URL="https://bugs.centos.org/" CENTOS_MANTISBT_PROJECT="CentOS-7" CENTOS_MANTISBT_PROJECT_VERSION="7" REDHAT_SUPPORT_PRODUCT="centos" REDHAT_SUPPORT_PRODUCT_VERSION="7" [root@localhost opensips-cli]# cat ~/.opensips-cli.cfg [default] log_level: INFO prompt_name: opensips-cli prompt_intro: Welcome to OpenSIPS Command Line Interface! prompt_emptyline_repeat_cmd: False history_file: ~/.opensips-cli.history history_file_size: 1000 output_type: pretty-print communication_type: fifo fifo_file: /tmp/opensips_fifo template_url: mysql://root:@localhost database_user_url: mysql://root:@localhost database_path: /root/src/opensips-3.0/scripts [root@localhost opensips-cli]# opensips-cli -x database create Create [a]ll tables or just the [c]urrently configured ones? (Default value is a): a Creating all tables ... Running standard-create.sql... Running tracer-create.sql... Running emergency-create.sql... Running b2b-create.sql... Running closeddial-create.sql... Running imc-create.sql... Running usrloc-create.sql... Running registrant-create.sql... Running alias_db-create.sql... Running rls-create.sql... Running drouting-create.sql... Running msilo-create.sql... Running dialog-create.sql... Running avpops-create.sql... Running presence-create.sql... Running carrierroute-create.sql... Running userblacklist-create.sql... Running rtpengine-create.sql... Running freeswitch_scripting-create.sql... Running cachedb_sql-create.sql... Running clusterer-create.sql... Running acc-create.sql... Running group-create.sql... Running b2b_sca-create.sql... Running permissions-create.sql... Running domainpolicy-create.sql... Running dispatcher-create.sql... Running speeddial-create.sql... Running domain-create.sql... Running tls_mgm-create.sql... Running smpp-create.sql... Running fraud_detection-create.sql... Running dialplan-create.sql... Running cpl-create.sql... Running load_balancer-create.sql... Running auth_db-create.sql... Running rtpproxy-create.sql... Running call_center-create.sql... INFO: database tables have been successfully created.
My
opensips-cli
was installed according to the Install Guide. Any hints are appreciated until I understand more about this exception. Thanks!
The issue may due to some of python libs/code that opensips-cli using are not compatible with mysql 8.
I am experiencing the same issue with trying database create
with postgres this is my traceback
Please provide the URL of the SQL database: postgres://opensips:password@127.0.0.1
ERROR: cannot connect to DB server: (psycopg2.OperationalError) FATAL: database "opensips" does not exist
(Background on this error at: http://sqlalche.me/e/e3q8)!
Traceback (most recent call last):
File "/usr/lib/python3.7/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 "/usr/local/lib/python3.7/dist-packages/SQLAlchemy-1.3.3-py3.7-linux-x86_64.egg/sqlalchemy/engine/base.py", line 2262, in _wrap_pool_connect
return fn()
File "/usr/local/lib/python3.7/dist-packages/SQLAlchemy-1.3.3-py3.7-linux-x86_64.egg/sqlalchemy/pool/base.py", line 303, in unique_connection
return _ConnectionFairy._checkout(self)
File "/usr/local/lib/python3.7/dist-packages/SQLAlchemy-1.3.3-py3.7-linux-x86_64.egg/sqlalchemy/pool/base.py", line 760, in _checkout
fairy = _ConnectionRecord.checkout(pool)
File "/usr/local/lib/python3.7/dist-packages/SQLAlchemy-1.3.3-py3.7-linux-x86_64.egg/sqlalchemy/pool/base.py", line 492, in checkout
rec = pool._do_get()
File "/usr/local/lib/python3.7/dist-packages/SQLAlchemy-1.3.3-py3.7-linux-x86_64.egg/sqlalchemy/pool/impl.py", line 139, in _do_get
self._dec_overflow()
File "/usr/local/lib/python3.7/dist-packages/SQLAlchemy-1.3.3-py3.7-linux-x86_64.egg/sqlalchemy/util/langhelpers.py", line 68, in __exit__
compat.reraise(exc_type, exc_value, exc_tb)
File "/usr/local/lib/python3.7/dist-packages/SQLAlchemy-1.3.3-py3.7-linux-x86_64.egg/sqlalchemy/util/compat.py", line 129, in reraise
raise value
File "/usr/local/lib/python3.7/dist-packages/SQLAlchemy-1.3.3-py3.7-linux-x86_64.egg/sqlalchemy/pool/impl.py", line 136, in _do_get
return self._create_connection()
File "/usr/local/lib/python3.7/dist-packages/SQLAlchemy-1.3.3-py3.7-linux-x86_64.egg/sqlalchemy/pool/base.py", line 308, in _create_connection
return _ConnectionRecord(self)
File "/usr/local/lib/python3.7/dist-packages/SQLAlchemy-1.3.3-py3.7-linux-x86_64.egg/sqlalchemy/pool/base.py", line 437, in __init__
self.__connect(first_connect_check=True)
File "/usr/local/lib/python3.7/dist-packages/SQLAlchemy-1.3.3-py3.7-linux-x86_64.egg/sqlalchemy/pool/base.py", line 639, in __connect
connection = pool._invoke_creator(self)
File "/usr/local/lib/python3.7/dist-packages/SQLAlchemy-1.3.3-py3.7-linux-x86_64.egg/sqlalchemy/engine/strategies.py", line 114, in connect
return dialect.connect(*cargs, **cparams)
File "/usr/local/lib/python3.7/dist-packages/SQLAlchemy-1.3.3-py3.7-linux-x86_64.egg/sqlalchemy/engine/default.py", line 453, in connect
return self.dbapi.connect(*cargs, **cparams)
File "/usr/local/lib/python3.7/dist-packages/psycopg2/__init__.py", line 127, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: FATAL: database "opensips" does not exist
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/opensipscli/db.py", line 112, in __init__
self.__conn = self.__engine.connect().\
File "/usr/local/lib/python3.7/dist-packages/SQLAlchemy-1.3.3-py3.7-linux-x86_64.egg/sqlalchemy/engine/base.py", line 2193, in connect
return self._connection_cls(self, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/SQLAlchemy-1.3.3-py3.7-linux-x86_64.egg/sqlalchemy/engine/base.py", line 103, in __init__
else engine.raw_connection()
File "/usr/local/lib/python3.7/dist-packages/SQLAlchemy-1.3.3-py3.7-linux-x86_64.egg/sqlalchemy/engine/base.py", line 2293, in raw_connection
self.pool.unique_connection, _connection
File "/usr/local/lib/python3.7/dist-packages/SQLAlchemy-1.3.3-py3.7-linux-x86_64.egg/sqlalchemy/engine/base.py", line 2266, in _wrap_pool_connect
e, dialect, self
File "/usr/local/lib/python3.7/dist-packages/SQLAlchemy-1.3.3-py3.7-linux-x86_64.egg/sqlalchemy/engine/base.py", line 1536, in _handle_dbapi_exception_noconnection
util.raise_from_cause(sqlalchemy_exception, exc_info)
File "/usr/local/lib/python3.7/dist-packages/SQLAlchemy-1.3.3-py3.7-linux-x86_64.egg/sqlalchemy/util/compat.py", line 383, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File "/usr/local/lib/python3.7/dist-packages/SQLAlchemy-1.3.3-py3.7-linux-x86_64.egg/sqlalchemy/util/compat.py", line 128, in reraise
raise value.with_traceback(tb)
File "/usr/local/lib/python3.7/dist-packages/SQLAlchemy-1.3.3-py3.7-linux-x86_64.egg/sqlalchemy/engine/base.py", line 2262, in _wrap_pool_connect
return fn()
File "/usr/local/lib/python3.7/dist-packages/SQLAlchemy-1.3.3-py3.7-linux-x86_64.egg/sqlalchemy/pool/base.py", line 303, in unique_connection
return _ConnectionFairy._checkout(self)
File "/usr/local/lib/python3.7/dist-packages/SQLAlchemy-1.3.3-py3.7-linux-x86_64.egg/sqlalchemy/pool/base.py", line 760, in _checkout
fairy = _ConnectionRecord.checkout(pool)
File "/usr/local/lib/python3.7/dist-packages/SQLAlchemy-1.3.3-py3.7-linux-x86_64.egg/sqlalchemy/pool/base.py", line 492, in checkout
rec = pool._do_get()
File "/usr/local/lib/python3.7/dist-packages/SQLAlchemy-1.3.3-py3.7-linux-x86_64.egg/sqlalchemy/pool/impl.py", line 139, in _do_get
self._dec_overflow()
File "/usr/local/lib/python3.7/dist-packages/SQLAlchemy-1.3.3-py3.7-linux-x86_64.egg/sqlalchemy/util/langhelpers.py", line 68, in __exit__
compat.reraise(exc_type, exc_value, exc_tb)
File "/usr/local/lib/python3.7/dist-packages/SQLAlchemy-1.3.3-py3.7-linux-x86_64.egg/sqlalchemy/util/compat.py", line 129, in reraise
raise value
File "/usr/local/lib/python3.7/dist-packages/SQLAlchemy-1.3.3-py3.7-linux-x86_64.egg/sqlalchemy/pool/impl.py", line 136, in _do_get
return self._create_connection()
File "/usr/local/lib/python3.7/dist-packages/SQLAlchemy-1.3.3-py3.7-linux-x86_64.egg/sqlalchemy/pool/base.py", line 308, in _create_connection
return _ConnectionRecord(self)
File "/usr/local/lib/python3.7/dist-packages/SQLAlchemy-1.3.3-py3.7-linux-x86_64.egg/sqlalchemy/pool/base.py", line 437, in __init__
self.__connect(first_connect_check=True)
File "/usr/local/lib/python3.7/dist-packages/SQLAlchemy-1.3.3-py3.7-linux-x86_64.egg/sqlalchemy/pool/base.py", line 639, in __connect
connection = pool._invoke_creator(self)
File "/usr/local/lib/python3.7/dist-packages/SQLAlchemy-1.3.3-py3.7-linux-x86_64.egg/sqlalchemy/engine/strategies.py", line 114, in connect
return dialect.connect(*cargs, **cparams)
File "/usr/local/lib/python3.7/dist-packages/SQLAlchemy-1.3.3-py3.7-linux-x86_64.egg/sqlalchemy/engine/default.py", line 453, in connect
return self.dbapi.connect(*cargs, **cparams)
File "/usr/local/lib/python3.7/dist-packages/psycopg2/__init__.py", line 127, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) FATAL: database "opensips" does not exist
(Background on this error at: http://sqlalche.me/e/e3q8)
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/dist-packages/opensipscli/main.py", line 78, in main
sys.exit(shell.cmdloop())
File "/usr/lib/python3/dist-packages/opensipscli/cli.py", line 232, in cmdloop
super(OpenSIPSCLIShell, self).cmdloop(intro='')
File "/usr/lib/python3.7/cmd.py", line 138, in cmdloop
stop = self.onecmd(line)
File "/usr/lib/python3.7/cmd.py", line 216, in onecmd
return self.default(line)
File "/usr/lib/python3/dist-packages/opensipscli/cli.py", line 342, in default
self.run_command(module, cmd, params)
File "/usr/lib/python3/dist-packages/opensipscli/cli.py", line 331, in run_command
return mod[0].__invoke__(cmd, params)
File "/usr/lib/python3/dist-packages/opensipscli/module.py", line 36, in __invoke__
return f(params)
File "/usr/lib/python3/dist-packages/opensipscli/modules/database.py", line 374, in do_create
if self._do_create_db([db_name], db_url) < 0:
File "/usr/lib/python3/dist-packages/opensipscli/modules/database.py", line 406, in _do_create_db
db = self.get_db(db_url, db_name)
File "/usr/lib/python3/dist-packages/opensipscli/modules/database.py", line 834, in get_db
return osdb(db_url, db_name)
File "/usr/lib/python3/dist-packages/opensipscli/db.py", line 120, in __init__
raise osdbError("unable to connect to the database")
opensipscli.db.osdbError: unable to connect to the database```
Installing the latest master worked fine, but works only with a config file
Hello, i'm runnig centos 7 with python3.6.8 whenever i try to create the database using opensips-cli with database create cmd, i get the following error:
Creating all tables ... Running standard-create.sql... Running tracer-create.sql...