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

Unable to create Database #96

Open
iliesh opened this issue Jun 20, 2022 · 3 comments
Open

Unable to create Database #96

iliesh opened this issue Jun 20, 2022 · 3 comments

Comments

@iliesh
Copy link

iliesh commented Jun 20, 2022

Managed to install this application from the source code - but is failing when I'm trying to create the DB:

opensips-cli -x database create

/usr/lib/python3/dist-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: 1.1build1 is an invalid version and will not be supported in a future release
  warnings.warn(
/usr/lib/python3/dist-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: 0.1.43ubuntu1 is an invalid version and will not be supported in a future release
  warnings.warn(
Password for admin MySQL user (root):
Traceback (most recent call last):
  File "/usr/local/bin/opensips-cli", line 4, in <module>
    __import__('pkg_resources').run_script('opensipscli==0.1.0', 'opensips-cli')
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 656, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1453, in run_script
    exec(code, namespace, namespace)
  File "/usr/local/lib/python3.10/dist-packages/opensipscli-0.1.0-py3.10.egg/EGG-INFO/scripts/opensips-cli", line 9, in <module>
    run_console()
  File "/usr/local/lib/python3.10/dist-packages/opensipscli-0.1.0-py3.10.egg/EGG-INFO/scripts/opensips-cli", line 6, in run_console
    main.main()
  File "/usr/local/lib/python3.10/dist-packages/opensipscli-0.1.0-py3.10.egg/opensipscli/main.py", line 78, in main
    sys.exit(shell.cmdloop())
  File "/usr/local/lib/python3.10/dist-packages/opensipscli-0.1.0-py3.10.egg/opensipscli/cli.py", line 242, in cmdloop
    ret = self.run_command(module, command, modifiers, params)
  File "/usr/local/lib/python3.10/dist-packages/opensipscli-0.1.0-py3.10.egg/opensipscli/cli.py", line 404, in run_command
    return mod[0].__invoke__(cmd, params, modifiers)
  File "/usr/local/lib/python3.10/dist-packages/opensipscli-0.1.0-py3.10.egg/opensipscli/module.py", line 36, in __invoke__
    return f(params, modifiers)
  File "/usr/local/lib/python3.10/dist-packages/opensipscli-0.1.0-py3.10.egg/opensipscli/modules/database.py", line 527, in do_create
    db = self.get_db(admin_url if engine != 'sqlite' else db_url, db_name)
  File "/usr/local/lib/python3.10/dist-packages/opensipscli-0.1.0-py3.10.egg/opensipscli/modules/database.py", line 800, in get_db
    return osdb(db_url, db_name)
  File "/usr/local/lib/python3.10/dist-packages/opensipscli-0.1.0-py3.10.egg/opensipscli/db.py", line 208, in __init__
    self.__conn = self.__engine.connect().\
  File "/usr/local/lib/python3.10/dist-packages/SQLAlchemy-1.3.3-py3.10-linux-x86_64.egg/sqlalchemy/engine/base.py", line 2193, in connect
    return self._connection_cls(self, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/SQLAlchemy-1.3.3-py3.10-linux-x86_64.egg/sqlalchemy/engine/base.py", line 103, in __init__
    else engine.raw_connection()
  File "/usr/local/lib/python3.10/dist-packages/SQLAlchemy-1.3.3-py3.10-linux-x86_64.egg/sqlalchemy/engine/base.py", line 2292, in raw_connection
    return self._wrap_pool_connect(
  File "/usr/local/lib/python3.10/dist-packages/SQLAlchemy-1.3.3-py3.10-linux-x86_64.egg/sqlalchemy/engine/base.py", line 2262, in _wrap_pool_connect
    return fn()
  File "/usr/local/lib/python3.10/dist-packages/SQLAlchemy-1.3.3-py3.10-linux-x86_64.egg/sqlalchemy/pool/base.py", line 303, in unique_connection
    return _ConnectionFairy._checkout(self)
  File "/usr/local/lib/python3.10/dist-packages/SQLAlchemy-1.3.3-py3.10-linux-x86_64.egg/sqlalchemy/pool/base.py", line 760, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "/usr/local/lib/python3.10/dist-packages/SQLAlchemy-1.3.3-py3.10-linux-x86_64.egg/sqlalchemy/pool/base.py", line 492, in checkout
    rec = pool._do_get()
  File "/usr/local/lib/python3.10/dist-packages/SQLAlchemy-1.3.3-py3.10-linux-x86_64.egg/sqlalchemy/pool/impl.py", line 138, in _do_get
    with util.safe_reraise():
  File "/usr/local/lib/python3.10/dist-packages/SQLAlchemy-1.3.3-py3.10-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.10/dist-packages/SQLAlchemy-1.3.3-py3.10-linux-x86_64.egg/sqlalchemy/util/compat.py", line 129, in reraise
    raise value
  File "/usr/local/lib/python3.10/dist-packages/SQLAlchemy-1.3.3-py3.10-linux-x86_64.egg/sqlalchemy/pool/impl.py", line 136, in _do_get
    return self._create_connection()
  File "/usr/local/lib/python3.10/dist-packages/SQLAlchemy-1.3.3-py3.10-linux-x86_64.egg/sqlalchemy/pool/base.py", line 308, in _create_connection
    return _ConnectionRecord(self)
  File "/usr/local/lib/python3.10/dist-packages/SQLAlchemy-1.3.3-py3.10-linux-x86_64.egg/sqlalchemy/pool/base.py", line 437, in __init__
    self.__connect(first_connect_check=True)
  File "/usr/local/lib/python3.10/dist-packages/SQLAlchemy-1.3.3-py3.10-linux-x86_64.egg/sqlalchemy/pool/base.py", line 649, in __connect
    ).exec_once(self.connection, self)
  File "/usr/local/lib/python3.10/dist-packages/SQLAlchemy-1.3.3-py3.10-linux-x86_64.egg/sqlalchemy/event/attr.py", line 287, in exec_once
    self(*args, **kw)
  File "/usr/local/lib/python3.10/dist-packages/SQLAlchemy-1.3.3-py3.10-linux-x86_64.egg/sqlalchemy/event/attr.py", line 297, in __call__
    fn(*args, **kw)
File "/usr/local/lib/python3.10/dist-packages/SQLAlchemy-1.3.3-py3.10-linux-x86_64.egg/sqlalchemy/event/attr.py", line 297, in __call__
    fn(*args, **kw)
  File "/usr/local/lib/python3.10/dist-packages/SQLAlchemy-1.3.3-py3.10-linux-x86_64.egg/sqlalchemy/util/langhelpers.py", line 1443, in go
    return once_fn(*arg, **kw)
  File "/usr/local/lib/python3.10/dist-packages/SQLAlchemy-1.3.3-py3.10-linux-x86_64.egg/sqlalchemy/engine/strategies.py", line 199, in first_connect
    dialect.initialize(c)
  File "/usr/local/lib/python3.10/dist-packages/SQLAlchemy-1.3.3-py3.10-linux-x86_64.egg/sqlalchemy/dialects/mysql/base.py", line 2349, in initialize
    self._detect_sql_mode(connection)
  File "/usr/local/lib/python3.10/dist-packages/SQLAlchemy-1.3.3-py3.10-linux-x86_64.egg/sqlalchemy/dialects/mysql/base.py", line 2796, in _detect_sql_mode
    connection.execute("SHOW VARIABLES LIKE 'sql_mode'"),
  File "/usr/local/lib/python3.10/dist-packages/SQLAlchemy-1.3.3-py3.10-linux-x86_64.egg/sqlalchemy/engine/base.py", line 982, in execute
    return self._execute_text(object_, multiparams, params)
  File "/usr/local/lib/python3.10/dist-packages/SQLAlchemy-1.3.3-py3.10-linux-x86_64.egg/sqlalchemy/engine/base.py", line 1149, in _execute_text
    ret = self._execute_context(
  File "/usr/local/lib/python3.10/dist-packages/SQLAlchemy-1.3.3-py3.10-linux-x86_64.egg/sqlalchemy/engine/base.py", line 1247, in _execute_context
    self._handle_dbapi_exception(
  File "/usr/local/lib/python3.10/dist-packages/SQLAlchemy-1.3.3-py3.10-linux-x86_64.egg/sqlalchemy/engine/base.py", line 1468, in _handle_dbapi_exception
    util.reraise(*exc_info)
  File "/usr/local/lib/python3.10/dist-packages/SQLAlchemy-1.3.3-py3.10-linux-x86_64.egg/sqlalchemy/util/compat.py", line 129, in reraise
    raise value
  File "/usr/local/lib/python3.10/dist-packages/SQLAlchemy-1.3.3-py3.10-linux-x86_64.egg/sqlalchemy/engine/base.py", line 1243, in _execute_context
    self.dialect.do_execute(
  File "/usr/local/lib/python3.10/dist-packages/SQLAlchemy-1.3.3-py3.10-linux-x86_64.egg/sqlalchemy/engine/default.py", line 552, in do_execute
    cursor.execute(statement, parameters)
  File "/usr/local/lib/python3.10/dist-packages/mysqlclient-1.3.14-py3.10-linux-x86_64.egg/MySQLdb/cursors.py", line 255, in execute
    self.errorhandler(self, exc, value)
  File "/usr/local/lib/python3.10/dist-packages/mysqlclient-1.3.14-py3.10-linux-x86_64.egg/MySQLdb/connections.py", line 50, in defaulterrorhandler
    raise errorvalue
  File "/usr/local/lib/python3.10/dist-packages/mysqlclient-1.3.14-py3.10-linux-x86_64.egg/MySQLdb/cursors.py", line 252, in execute
    res = self._query(query)
  File "/usr/local/lib/python3.10/dist-packages/mysqlclient-1.3.14-py3.10-linux-x86_64.egg/MySQLdb/cursors.py", line 378, in _query
    db.query(q)
  File "/usr/local/lib/python3.10/dist-packages/mysqlclient-1.3.14-py3.10-linux-x86_64.egg/MySQLdb/connections.py", line 280, in query
    _mysql.connection.query(self, query)
SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats

OS: Ubuntu 22.04 LTS
Kernel: 5.15.0-1013-aws

@Oysed
Copy link

Oysed commented Aug 29, 2023

Same problem on
OS: Ubuntu 22.04 LTS

@gao114882
Copy link

gao114882 commented Sep 19, 2023

python version is too high , python3.9.18 is ok

@michaelm-devel
Copy link

Is there a work-around or fix for this issue? How do you create database if opensips-cli is falling using python3.10 and above?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants