<div dir="ltr">Ok . <div><br></div><div>DEBUG: using config file /root/.opensips-cli.cfg<br>DEBUG: Loaded module 'instance'<br>DEBUG: Loaded module 'trace'<br>DEBUG: Loaded module 'tls'<br>DEBUG: Loaded module 'mi'<br>DEBUG: sent command ':opensips_fifo_reply_20633:{"params": [], "jsonrpc": "2.0", "method": "which", "id": "11598"}'<br>DEBUG: Loaded module 'diagnose'<br>DEBUG: Loaded module 'database'<br>DEBUG: Loaded module 'user'<br>DEBUG: Loaded module 'trap'<br>DEBUG: running in non-interactive mode '['database', 'create', 'opensips']'<br>DEBUG: running command 'create' '['opensips']'<br>DEBUG: db_name: 'opensips'<br>DEBUG: admin DB URL: 'mysql://root:cccl0g1c@localhost/opensips'<br>DEBUG: connecting to mysql://root:cccl0g1c@localhost/opensips<br>Traceback (most recent call last):<br> File "/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.3.3-py3.5-linux-x86_64.egg/sqlalchemy/engine/base.py", line 2262, in _wrap_pool_connect<br> return fn()<br> File "/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.3.3-py3.5-linux-x86_64.egg/sqlalchemy/pool/base.py", line 303, in unique_connection<br> return _ConnectionFairy._checkout(self)<br> File "/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.3.3-py3.5-linux-x86_64.egg/sqlalchemy/pool/base.py", line 760, in _checkout<br> fairy = _ConnectionRecord.checkout(pool)<br> File "/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.3.3-py3.5-linux-x86_64.egg/sqlalchemy/pool/base.py", line 492, in checkout<br> rec = pool._do_get()<br> File "/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.3.3-py3.5-linux-x86_64.egg/sqlalchemy/pool/impl.py", line 139, in _do_get<br> self._dec_overflow()<br> File "/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.3.3-py3.5-linux-x86_64.egg/sqlalchemy/util/langhelpers.py", line 68, in __exit__<br> compat.reraise(exc_type, exc_value, exc_tb)<br> File "/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.3.3-py3.5-linux-x86_64.egg/sqlalchemy/util/compat.py", line 129, in reraise<br> raise value<br> File "/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.3.3-py3.5-linux-x86_64.egg/sqlalchemy/pool/impl.py", line 136, in _do_get<br> return self._create_connection()<br> File "/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.3.3-py3.5-linux-x86_64.egg/sqlalchemy/pool/base.py", line 308, in _create_connection<br> return _ConnectionRecord(self)<br> File "/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.3.3-py3.5-linux-x86_64.egg/sqlalchemy/pool/base.py", line 437, in __init__<br> self.__connect(first_connect_check=True)<br> File "/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.3.3-py3.5-linux-x86_64.egg/sqlalchemy/pool/base.py", line 639, in __connect<br> connection = pool._invoke_creator(self)<br> File "/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.3.3-py3.5-linux-x86_64.egg/sqlalchemy/engine/strategies.py", line 114, in connect<br> return dialect.connect(*cargs, **cparams)<br> File "/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.3.3-py3.5-linux-x86_64.egg/sqlalchemy/engine/default.py", line 453, in connect<br> return self.dbapi.connect(*cargs, **cparams)<br> File "/usr/lib/python3/dist-packages/MySQLdb/__init__.py", line 81, in Connect<br> return Connection(*args, **kwargs)<br> File "/usr/lib/python3/dist-packages/MySQLdb/connections.py", line 204, in __init__<br> super(Connection, self).__init__(*args, **kwargs2)<br>_mysql_exceptions.OperationalError: (1049, "Unknown database 'opensips'")<br><br>The above exception was the direct cause of the following exception:<br><br>Traceback (most recent call last):<br> File "/usr/local/lib/python3.5/dist-packages/opensipscli-0.1.0-py3.5.egg/opensipscli/db.py", line 136, in __init__<br> self.__conn = self.__engine.connect().\<br> File "/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.3.3-py3.5-linux-x86_64.egg/sqlalchemy/engine/base.py", line 2193, in connect<br> return self._connection_cls(self, **kwargs)<br> File "/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.3.3-py3.5-linux-x86_64.egg/sqlalchemy/engine/base.py", line 103, in __init__<br> else engine.raw_connection()<br> File "/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.3.3-py3.5-linux-x86_64.egg/sqlalchemy/engine/base.py", line 2293, in raw_connection<br> self.pool.unique_connection, _connection<br> File "/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.3.3-py3.5-linux-x86_64.egg/sqlalchemy/engine/base.py", line 2266, in _wrap_pool_connect<br> e, dialect, self<br> File "/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.3.3-py3.5-linux-x86_64.egg/sqlalchemy/engine/base.py", line 1536, in _handle_dbapi_exception_noconnection<br> util.raise_from_cause(sqlalchemy_exception, exc_info)<br> File "/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.3.3-py3.5-linux-x86_64.egg/sqlalchemy/util/compat.py", line 383, in raise_from_cause<br> reraise(type(exception), exception, tb=exc_tb, cause=cause)<br> File "/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.3.3-py3.5-linux-x86_64.egg/sqlalchemy/util/compat.py", line 128, in reraise<br> raise value.with_traceback(tb)<br> File "/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.3.3-py3.5-linux-x86_64.egg/sqlalchemy/engine/base.py", line 2262, in _wrap_pool_connect<br> return fn()<br> File "/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.3.3-py3.5-linux-x86_64.egg/sqlalchemy/pool/base.py", line 303, in unique_connection<br> return _ConnectionFairy._checkout(self)<br> File "/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.3.3-py3.5-linux-x86_64.egg/sqlalchemy/pool/base.py", line 760, in _checkout<br> fairy = _ConnectionRecord.checkout(pool)<br> File "/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.3.3-py3.5-linux-x86_64.egg/sqlalchemy/pool/base.py", line 492, in checkout<br> rec = pool._do_get()<br> File "/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.3.3-py3.5-linux-x86_64.egg/sqlalchemy/pool/impl.py", line 139, in _do_get<br> self._dec_overflow()<br> File "/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.3.3-py3.5-linux-x86_64.egg/sqlalchemy/util/langhelpers.py", line 68, in __exit__<br> compat.reraise(exc_type, exc_value, exc_tb)<br> File "/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.3.3-py3.5-linux-x86_64.egg/sqlalchemy/util/compat.py", line 129, in reraise<br> raise value<br> File "/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.3.3-py3.5-linux-x86_64.egg/sqlalchemy/pool/impl.py", line 136, in _do_get<br> return self._create_connection()<br> File "/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.3.3-py3.5-linux-x86_64.egg/sqlalchemy/pool/base.py", line 308, in _create_connection<br> return _ConnectionRecord(self)<br> File "/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.3.3-py3.5-linux-x86_64.egg/sqlalchemy/pool/base.py", line 437, in __init__<br> self.__connect(first_connect_check=True)<br> File "/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.3.3-py3.5-linux-x86_64.egg/sqlalchemy/pool/base.py", line 639, in __connect<br> connection = pool._invoke_creator(self)<br> File "/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.3.3-py3.5-linux-x86_64.egg/sqlalchemy/engine/strategies.py", line 114, in connect<br> return dialect.connect(*cargs, **cparams)<br> File "/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.3.3-py3.5-linux-x86_64.egg/sqlalchemy/engine/default.py", line 453, in connect<br> return self.dbapi.connect(*cargs, **cparams)<br> File "/usr/lib/python3/dist-packages/MySQLdb/__init__.py", line 81, in Connect<br> return Connection(*args, **kwargs)<br> File "/usr/lib/python3/dist-packages/MySQLdb/connections.py", line 204, in __init__<br> super(Connection, self).__init__(*args, **kwargs2)<br>sqlalchemy.exc.OperationalError: (_mysql_exceptions.OperationalError) (1049, "Unknown database 'opensips'")<br>(Background on this error at: <a href="http://sqlalche.me/e/e3q8">http://sqlalche.me/e/e3q8</a>)<br><br>During handling of the above exception, another exception occurred:<br><br>Traceback (most recent call last):<br> File "/usr/local/bin/opensips-cli", line 4, in <module><br> __import__('pkg_resources').run_script('opensipscli==0.1.0', 'opensips-cli')<br> File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 719, in run_script<br> self.require(requires)[0].run_script(script_name, ns)<br> File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1504, in run_script<br> exec(code, namespace, namespace)<br> File "/usr/local/lib/python3.5/dist-packages/opensipscli-0.1.0-py3.5.egg/EGG-INFO/scripts/opensips-cli", line 9, in <module><br> run_console()<br> File "/usr/local/lib/python3.5/dist-packages/opensipscli-0.1.0-py3.5.egg/EGG-INFO/scripts/opensips-cli", line 6, in run_console<br> main.main()<br> File "/usr/local/lib/python3.5/dist-packages/opensipscli-0.1.0-py3.5.egg/opensipscli/main.py", line 78, in main<br> sys.exit(shell.cmdloop())<br> File "/usr/local/lib/python3.5/dist-packages/opensipscli-0.1.0-py3.5.egg/opensipscli/cli.py", line 242, in cmdloop<br> ret = self.run_command(self.command[0], command, params)<br> File "/usr/local/lib/python3.5/dist-packages/opensipscli-0.1.0-py3.5.egg/opensipscli/cli.py", line 357, in run_command<br> return mod[0].__invoke__(cmd, params)<br> File "/usr/local/lib/python3.5/dist-packages/opensipscli-0.1.0-py3.5.egg/opensipscli/module.py", line 36, in __invoke__<br> return f(params)<br> File "/usr/local/lib/python3.5/dist-packages/opensipscli-0.1.0-py3.5.egg/opensipscli/modules/database.py", line 369, in do_create<br> admin_db = self.get_db(admin_url, db_name)<br> File "/usr/local/lib/python3.5/dist-packages/opensipscli-0.1.0-py3.5.egg/opensipscli/modules/database.py", line 630, in get_db<br> return osdb(db_url, db_name)<br> File "/usr/local/lib/python3.5/dist-packages/opensipscli-0.1.0-py3.5.egg/opensipscli/db.py", line 160, in __init__<br> raise osdbError("unable to connect to the database")<br>opensipscli.db.osdbError: unable to connect to the database</div><div><br></div><div>This happens when I am giving a file path . </div><div><br></div><div><br><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><b><i>Thanks & Regards</i></b><div><i>Sasmita Panda</i></div><div><i>Senior Network Testing and Software Engineer</i></div><div><i>3CLogic , ph:07827611765</i></div></div></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Nov 20, 2020 at 4:17 PM Liviu Chircu <<a href="mailto:liviu@opensips.org">liviu@opensips.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 20.11.2020 12:43, Sasmita Panda wrote:<br>
> DEBUG: DB 'opensips' exists<br>
> DEBUG: Creating standard tables<br>
> DEBUG: checking tables: acc alias_db auth_db avpops clusterer dialog <br>
> dialplan dispatcher domain drouting group load_balancer msilo <br>
> permissions rtpproxy rtpengine speeddial tls_mgm usrloc<br>
<br>
OK, it seems your "default.cfg" file is not picked up, so the CLI uses <br>
its built-in paths:<br>
<br>
* "database_schema_path = /usr/share/opensips", which probably points to <br>
some 2.4 scripts ("uri" table?!)<br>
* "database_modules" is missing, so it's using the "standard" list of tables<br>
<br>
Please move that "default.cfg" file to the proper path, or specify it as <br>
an argument. It is the 1st thing mentioned in the documentation [1]<br>
<br>
Happy hacking,<br>
<br>
[1]: <a href="https://github.com/opensips/opensips-cli#configuration" rel="noreferrer" target="_blank">https://github.com/opensips/opensips-cli#configuration</a><br>
<br>
-- <br>
Liviu Chircu<br>
<a href="http://www.twitter.com/liviuchircu" rel="noreferrer" target="_blank">www.twitter.com/liviuchircu</a> | <a href="http://www.opensips-solutions.com" rel="noreferrer" target="_blank">www.opensips-solutions.com</a><br>
<br>
</blockquote></div>