[OpenSIPS-Users] problem with git branch for opensips 3.0
johan de clercq
johan at democon.be
Wed Jun 12 16:17:03 EDT 2019
This I found : you need to drop the last / in the connection string (mysql://opensips3_x:xxxxxxx@10.0.0.0 instead of mysql://opensips3_x:xxxxxxx@10.0.0.0/)
It creates the tables, but the import fails :
The 'test' database has been successfully created!
Migrating all matching OpenSIPS tables...
Traceback (most recent call last):
File "/usr/lib/python3.5/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.5/dist-packages/sqlalchemy/engine/base.py", line 1244, in _execute_context
cursor, statement, parameters, context
File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/engine/default.py", line 552, in do_execute
cursor.execute(statement, parameters)
File "/usr/local/lib/python3.5/dist-packages/MySQLdb/cursors.py", line 206, in execute
res = self._query(query)
File "/usr/local/lib/python3.5/dist-packages/MySQLdb/cursors.py", line 312, in _query
db.query(q)
File "/usr/local/lib/python3.5/dist-packages/MySQLdb/connections.py", line 224, in query
_mysql.connection.query(self, query)
MySQLdb._exceptions.OperationalError: (1136, "Column count doesn't match value count at row 1")
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', 'opensips-cli')
File "/usr/local/lib/python3.5/dist-packages/pkg_resources/__init__.py", line 666, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/local/lib/python3.5/dist-packages/pkg_resources/__init__.py", line 1453, in run_script
exec(code, namespace, namespace)
File "/usr/local/lib/python3.5/dist-packages/opensipscli-0.1-py3.5.egg/EGG-INFO/scripts/opensips-cli", line 9, in <module>
run_console()
File "/usr/local/lib/python3.5/dist-packages/opensipscli-0.1-py3.5.egg/EGG-INFO/scripts/opensips-cli", line 6, in run_console
main.main()
File "/usr/local/lib/python3.5/dist-packages/opensipscli-0.1-py3.5.egg/opensipscli/main.py", line 78, in main
sys.exit(shell.cmdloop())
File "/usr/local/lib/python3.5/dist-packages/opensipscli-0.1-py3.5.egg/opensipscli/cli.py", line 206, in cmdloop
super(OpenSIPSCLIShell, self).cmdloop(intro='')
File "/usr/lib/python3.5/cmd.py", line 138, in cmdloop
stop = self.onecmd(line)
File "/usr/lib/python3.5/cmd.py", line 216, in onecmd
return self.default(line)
File "/usr/local/lib/python3.5/dist-packages/opensipscli-0.1-py3.5.egg/opensipscli/cli.py", line 304, in default
self.run_command(module, cmd, params)
File "/usr/local/lib/python3.5/dist-packages/opensipscli-0.1-py3.5.egg/opensipscli/cli.py", line 293, in run_command
return mod[0].__invoke__(cmd, params)
File "/usr/local/lib/python3.5/dist-packages/opensipscli-0.1-py3.5.egg/opensipscli/module.py", line 30, in __invoke__
return f(params)
File "/usr/local/lib/python3.5/dist-packages/opensipscli-0.1-py3.5.egg/opensipscli/modules/database.py", line 344, in do_migrate
db.migrate(migrate_scripts, old_db, new_db)
File "/usr/local/lib/python3.5/dist-packages/opensipscli-0.1-py3.5.egg/opensipscli/db.py", line 174, in migrate
old_db, old_db, new_db)).execution_options(autocommit=True))
File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/engine/base.py", line 988, in execute
return meth(self, multiparams, params)
File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/sql/elements.py", line 287, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/engine/base.py", line 1107, in _execute_clauseelement
distilled_params,
File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/engine/base.py", line 1248, in _execute_context
e, statement, parameters, cursor, context
File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/engine/base.py", line 1466, in _handle_dbapi_exception
util.raise_from_cause(sqlalchemy_exception, exc_info)
File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/util/compat.py", line 383, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/util/compat.py", line 128, in reraise
raise value.with_traceback(tb)
File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/engine/base.py", line 1244, in _execute_context
cursor, statement, parameters, context
File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/engine/default.py", line 552, in do_execute
cursor.execute(statement, parameters)
File "/usr/local/lib/python3.5/dist-packages/MySQLdb/cursors.py", line 206, in execute
res = self._query(query)
File "/usr/local/lib/python3.5/dist-packages/MySQLdb/cursors.py", line 312, in _query
db.query(q)
File "/usr/local/lib/python3.5/dist-packages/MySQLdb/connections.py", line 224, in query
_mysql.connection.query(self, query)
sqlalchemy.exc.OperationalError: (MySQLdb._exceptions.OperationalError) (1136, "Column count doesn't match value count at row 1")
From: johan de clercq <johan at democon.be>
Sent: Wednesday, June 12, 2019 9:56 PM
To: 'Bogdan-Andrei Iancu' <bogdan at opensips.org>
Cc: 'OpenSIPS users mailling list' <users at lists.opensips.org>; 'Liviu Chircu' <liviu at opensips.org>
Subject: RE: [OpenSIPS-Users] problem with git branch for opensips 3.0
It seems that database migrate x y has a problem when x has special characters.
mysql -h 10.0.0.0 -u opensips3_x -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 34042687
Server version: 5.6.36-82.0-56 Percona XtraDB Cluster (GPL), Release rel82.0, Revision de7a681, WSREP version 26.20, wsrep_26.20
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MySQL [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| opensips3_x |
+--------------------+
2 rows in set (0.01 sec)
When I do this in opensips-cli :
(opensips-cli): database migrate "opensips3_x" "opensips_x_3_0"
Please provide the URL of the database: mysql://opensips3_x:xxxxxxx@10.0.0.0/
ERROR: the source database (opensips3_dust) does not exist!
Can you please correct ?
From: Bogdan-Andrei Iancu <bogdan at opensips.org <mailto:bogdan at opensips.org> >
Sent: Wednesday, June 12, 2019 11:06 AM
To: Johan De Clercq <Johan at democon.be <mailto:Johan at democon.be> >
Cc: OpenSIPS users mailling list <users at lists.opensips.org <mailto:users at lists.opensips.org> >; Liviu Chircu <liviu at opensips.org <mailto:liviu at opensips.org> >
Subject: Re: [OpenSIPS-Users] problem with git branch for opensips 3.0
You are right, the doc is missing the "migrate" part. Liviu will update the docs there.
Thanks for the note !
Regards,
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
https://www.opensips-solutions.com
OpenSIPS Summit 2019
https://www.opensips.org/events/Summit-2019Amsterdam/
On 06/12/2019 11:29 AM, Johan De Clercq wrote:
Looking here https://github.com/OpenSIPS/opensips-cli/blob/master/docs/modules/database.md,
I can't find back how to migrate a 24 db to 30. Can you have a look ?
Thanks.
Op wo 12 jun. 2019 om 10:26 schreef Bogdan-Andrei Iancu <bogdan at opensips.org <mailto:bogdan at opensips.org> >:
Hi Johan,
The git contains good docs for the cli tool - if there is something you find as uncovered, please let us know.
Regards,
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
https://www.opensips-solutions.com
OpenSIPS Summit 2019
https://www.opensips.org/events/Summit-2019Amsterdam/
On 06/12/2019 10:31 AM, Johan De Clercq wrote:
Okay.
So is there somewhere good documentation on this? In exact, how do I configure this, and how do I migrate 24 dB to opensips 30?
On Wed, 12 Jun 2019, 09:25 vasilevalex, <alexei.vasilyev at gmail.com <mailto:alexei.vasilyev at gmail.com> > wrote:
Hi, Johan.
Everything ok with git.
Just check this commit: 8a7abc05195fb4a29d5439871d7691c090c60d32
(https://github.com/OpenSIPS/opensips/commit/8a7abc05195fb4a29d5439871d7691c090c60d32)
-----
---
Alexey Vasilyev
--
Sent from: http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html
_______________________________________________
Users mailing list
Users at lists.opensips.org <mailto:Users at lists.opensips.org>
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
_______________________________________________
Users mailing list
Users at lists.opensips.org <mailto:Users at lists.opensips.org>
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20190612/b722df6c/attachment-0001.html>
More information about the Users
mailing list