[OpenSIPS-Users] Migrate OpenSIPs database 3_1 to 3_2 Python Error

Social Boh social at bohboh.info
Fri Feb 10 21:45:57 UTC 2023


Hello

I'm trying to migrate OpenSIPs 3_1 database to OpenSIPs 3_2 esquema

OpenSIPs version: 3.1.13

Linux: Almalinux 8

Python 3

opensips-cli -x database migrate 3.1_to_3.2 opensips_3_1 opensips_3_2

where opensip_3_1 is the database name of 3.1 Esquema y opensips_3_2 the name of the new opensips 3.2 Esquema

Error:

/usr/local/lib/python3.6/site-packages/SQLAlchemy-1.3.3-py3.6-linux-x86_64.egg/sqlalchemy/engine/default.py:552: 
Warning: (1305, 'PROCEDURE opensips_3_1.OSIPS_DB_MIGRATE_3_1_TO_3_2 does 
not exist')
   cursor.execute(statement, parameters)
/usr/local/lib/python3.6/site-packages/SQLAlchemy-1.3.3-py3.6-linux-x86_64.egg/sqlalchemy/engine/default.py:552: 
Warning: (1305, 'PROCEDURE opensips_3_1.OSIPS_TB_COPY_3_1_TO_3_2 does 
not exist')
   cursor.execute(statement, parameters)
Traceback (most recent call last):
   File 
"/usr/local/lib/python3.6/site-packages/SQLAlchemy-1.3.3-py3.6-linux-x86_64.egg/sqlalchemy/engine/base.py", 
line 1244, in _execute_context
     cursor, statement, parameters, context
   File 
"/usr/local/lib/python3.6/site-packages/SQLAlchemy-1.3.3-py3.6-linux-x86_64.egg/sqlalchemy/engine/default.py", 
line 552, in do_execute
     cursor.execute(statement, parameters)
   File 
"/usr/local/lib/python3.6/site-packages/mysqlclient-1.3.14-py3.6-linux-x86_64.egg/MySQLdb/cursors.py", 
line 255, in execute
     self.errorhandler(self, exc, value)
   File 
"/usr/local/lib/python3.6/site-packages/mysqlclient-1.3.14-py3.6-linux-x86_64.egg/MySQLdb/connections.py", 
line 50, in defaulterrorhandler
     raise errorvalue
   File 
"/usr/local/lib/python3.6/site-packages/mysqlclient-1.3.14-py3.6-linux-x86_64.egg/MySQLdb/cursors.py", 
line 252, in execute
     res = self._query(query)
   File 
"/usr/local/lib/python3.6/site-packages/mysqlclient-1.3.14-py3.6-linux-x86_64.egg/MySQLdb/cursors.py", 
line 378, in _query
     db.query(q)
   File 
"/usr/local/lib/python3.6/site-packages/mysqlclient-1.3.14-py3.6-linux-x86_64.egg/MySQLdb/connections.py", 
line 280, in query
     _mysql.connection.query(self, query)
_mysql_exceptions.OperationalError: (1304, 'PROCEDURE 
OSIPS_TB_COPY_3_0_TO_3_1 already exists')

The above exception was the direct cause of the following exception:

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.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 <module>
     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 242, in cmdloop
     ret = self.run_command(module, command, modifiers, params)
   File 
"/usr/local/lib/python3.6/site-packages/opensipscli-0.1.0-py3.6.egg/opensipscli/cli.py", 
line 404, in run_command
     return mod[0].__invoke__(cmd, params, modifiers)
   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, modifiers)
   File 
"/usr/local/lib/python3.6/site-packages/opensipscli-0.1.0-py3.6.egg/opensipscli/modules/database.py", 
line 789, in do_migrate
     migrate_scripts, old_db, new_db, DB_MIGRATIONS[flavour])
   File 
"/usr/local/lib/python3.6/site-packages/opensipscli-0.1.0-py3.6.egg/opensipscli/db.py", 
line 827, in migrate
     self.exec_sql_file(ms)
   File 
"/usr/local/lib/python3.6/site-packages/opensipscli-0.1.0-py3.6.egg/opensipscli/db.py", 
line 569, in exec_sql_file
     self.__conn.execute(sql)
   File 
"/usr/local/lib/python3.6/site-packages/SQLAlchemy-1.3.3-py3.6-linux-x86_64.egg/sqlalchemy/engine/base.py", 
line 982, in execute
     return self._execute_text(object_, multiparams, params)
   File 
"/usr/local/lib/python3.6/site-packages/SQLAlchemy-1.3.3-py3.6-linux-x86_64.egg/sqlalchemy/engine/base.py", 
line 1155, in _execute_text
     parameters,
   File 
"/usr/local/lib/python3.6/site-packages/SQLAlchemy-1.3.3-py3.6-linux-x86_64.egg/sqlalchemy/engine/base.py", 
line 1248, in _execute_context
     e, statement, parameters, cursor, context
   File 
"/usr/local/lib/python3.6/site-packages/SQLAlchemy-1.3.3-py3.6-linux-x86_64.egg/sqlalchemy/engine/base.py", 
line 1466, in _handle_dbapi_exception
     util.raise_from_cause(sqlalchemy_exception, exc_info)
   File 
"/usr/local/lib/python3.6/site-packages/SQLAlchemy-1.3.3-py3.6-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.6/site-packages/SQLAlchemy-1.3.3-py3.6-linux-x86_64.egg/sqlalchemy/util/compat.py", 
line 128, in reraise
     raise value.with_traceback(tb)
   File 
"/usr/local/lib/python3.6/site-packages/SQLAlchemy-1.3.3-py3.6-linux-x86_64.egg/sqlalchemy/engine/base.py", 
line 1244, in _execute_context
     cursor, statement, parameters, context
   File 
"/usr/local/lib/python3.6/site-packages/SQLAlchemy-1.3.3-py3.6-linux-x86_64.egg/sqlalchemy/engine/default.py", 
line 552, in do_execute
     cursor.execute(statement, parameters)
   File 
"/usr/local/lib/python3.6/site-packages/mysqlclient-1.3.14-py3.6-linux-x86_64.egg/MySQLdb/cursors.py", 
line 255, in execute
     self.errorhandler(self, exc, value)
   File 
"/usr/local/lib/python3.6/site-packages/mysqlclient-1.3.14-py3.6-linux-x86_64.egg/MySQLdb/connections.py", 
line 50, in defaulterrorhandler
     raise errorvalue
   File 
"/usr/local/lib/python3.6/site-packages/mysqlclient-1.3.14-py3.6-linux-x86_64.egg/MySQLdb/cursors.py", 
line 252, in execute
     res = self._query(query)
   File 
"/usr/local/lib/python3.6/site-packages/mysqlclient-1.3.14-py3.6-linux-x86_64.egg/MySQLdb/cursors.py", 
line 378, in _query
     db.query(q)
   File 
"/usr/local/lib/python3.6/site-packages/mysqlclient-1.3.14-py3.6-linux-x86_64.egg/MySQLdb/connections.py", 
line 280, in query
     _mysql.connection.query(self, query)
sqlalchemy.exc.OperationalError: (_mysql_exceptions.OperationalError) 
(1304, 'PROCEDURE OSIPS_TB_COPY_3_0_TO_3_1 already exists')

-- 
---
I'm SoCIaL, MayBe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20230210/d41b1cd3/attachment-0001.html>


More information about the Users mailing list