Please, describe the problem here and provide additional information below (if applicable) …
We are trying to test OpenNebula upgrade from v5.4.12 to v5.6 Release Candidate (5.5.90-1) on our testing environment, and all the upgrade proccess seems to run smoothly until we try to upgrade the database. We get this output:
MySQL dump stored in /var/lib/one/mysql_opennebula_opennebula_2018-7-3_16:10:59.sql Use ‘onedb restore’ or restore the DB using the mysql command: mysql -u user -h server -P port db_name < backup_file
>>> Running migrators for shared tables
_ > Running migrator /usr/lib/one/ruby/onedb/shared/5.4.1_to_5.5.80.rb_
_ > Done in 0.00s_
Database migrated from 5.4.1 to 5.5.80 (OpenNebula 5.5.80) by onedb command.
>>> Running migrators for local tables
_ > Running migrator /usr/lib/one/ruby/onedb/local/5.4.1_to_5.5.80.rb_
_ > Old Az file not found, skipping Az host migration_
The database will be restored MySQL DB opennebula at opennebula restored.
Versions of the related components and OS (frontend, hypervisors, VMs):
Opennebula 5.5.90-1 + mariadb-5.5.56-2.el7.x86_64 on same VMware VM on a CentOS 7.4 Steps to reproduce:
Migrate from a working OpenNebula v5.4.12 environment to OpenNebula v5.5.90-1 (release candidate) Current results:
Database update not working Expected results:
It looks like there are artifacts from previus (unsuccessful?) upgrade? You should try clean all old_* tables from the opennebula database and try again.
Same here!
First attempt:
[root@LXLI03-T11 opennebula-5.5.90-1]# onedb upgrade -v -S localhost -u oneadmin -p XXXXXXXX -d opennebula
Version read:
Shared tables 5.4.1 : OpenNebula 5.4.6 daemon bootstrap
Local tables 5.4.1 : OpenNebula 5.4.6 daemon bootstrap
MySQL dump stored in /var/lib/one/mysql_localhost_opennebula_2018-7-3_16:38:48.sql
Use 'onedb restore' or restore the DB using the mysql command:
mysql -u user -h server -P port db_name < backup_file
>>> Running migrators for shared tables
> Running migrator /usr/lib/one/ruby/onedb/shared/5.4.1_to_5.5.80.rb
> Done in 0.00s
Database migrated from 5.4.1 to 5.5.80 (OpenNebula 5.5.80) by onedb command.
>>> Running migrators for local tables
> Running migrator /usr/lib/one/ruby/onedb/local/5.4.1_to_5.5.80.rb
> Old Az file not found, skipping Az host migration
undefined method `add_child' for nil:NilClass
/usr/lib/one/ruby/onedb/local/5.4.1_to_5.5.80.rb:212:in `block (2 levels) in bug_2189'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/dataset/actions.rb:151:in `block in each'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/adapters/mysql2.rb:238:in `block (2 levels) in fetch_rows'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/adapters/mysql2.rb:238:in `each'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/adapters/mysql2.rb:238:in `block in fetch_rows'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/adapters/mysql2.rb:152:in `_execute'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/adapters/utils/mysql_mysql2.rb:38:in `block in execute'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/database/connecting.rb:264:in `block in synchronize'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/connection_pool/threaded.rb:87:in `hold'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/database/connecting.rb:264:in `synchronize'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/adapters/utils/mysql_mysql2.rb:38:in `execute'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/dataset/actions.rb:1082:in `execute'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/adapters/mysql2.rb:273:in `execute'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/adapters/mysql2.rb:236:in `fetch_rows'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/dataset/actions.rb:151:in `each'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/database/dataset.rb:51:in `fetch'
/usr/lib/one/ruby/onedb/local/5.4.1_to_5.5.80.rb:203:in `block in bug_2189'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/database/transactions.rb:204:in `_transaction'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/database/transactions.rb:179:in `block in transaction'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/database/connecting.rb:264:in `block in synchronize'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/connection_pool/threaded.rb:91:in `hold'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/database/connecting.rb:264:in `synchronize'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/database/transactions.rb:145:in `transaction'
/usr/lib/one/ruby/onedb/local/5.4.1_to_5.5.80.rb:202:in `bug_2189'
/usr/lib/one/ruby/onedb/local/5.4.1_to_5.5.80.rb:40:in `up'
/usr/lib/one/ruby/onedb/onedb.rb:232:in `apply_migrators'
/usr/lib/one/ruby/onedb/onedb.rb:179:in `upgrade'
/usr/bin/onedb:389:in `block (2 levels) in <main>'
/usr/lib/one/ruby/cli/command_parser.rb:457:in `call'
/usr/lib/one/ruby/cli/command_parser.rb:457:in `run'
/usr/lib/one/ruby/cli/command_parser.rb:84:in `initialize'
/usr/bin/onedb:294:in `new'
/usr/bin/onedb:294:in `<main>'
The database will be restored
MySQL DB opennebula at localhost restored.
MySQL dump stored in /var/lib/one/mysql_localhost_opennebula_2018-7-3_16:39:40.sql
Use 'onedb restore' or restore the DB using the mysql command:
mysql -u user -h server -P port db_name < backup_file
>>> Running migrators for shared tables
> Running migrator /usr/lib/one/ruby/onedb/shared/5.4.1_to_5.5.80.rb
> Done in 0.00s
Database migrated from 5.4.1 to 5.5.80 (OpenNebula 5.5.80) by onedb command.
>>> Running migrators for local tables
> Running migrator /usr/lib/one/ruby/onedb/local/5.4.1_to_5.5.80.rb
> Old Az file not found, skipping Az host migration
Mysql2::Error: Table 'old_vm_pool' already exists
/usr/local/share/gems/gems/mysql2-0.5.1/lib/mysql2/client.rb:131:in `_query'
/usr/local/share/gems/gems/mysql2-0.5.1/lib/mysql2/client.rb:131:in `block in query'
/usr/local/share/gems/gems/mysql2-0.5.1/lib/mysql2/client.rb:130:in `handle_interrupt'
/usr/local/share/gems/gems/mysql2-0.5.1/lib/mysql2/client.rb:130:in `query'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/adapters/mysql2.rb:137:in `block in _execute'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/database/logging.rb:38:in `log_connection_yield'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/adapters/mysql2.rb:132:in `_execute'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/adapters/utils/mysql_mysql2.rb:38:in `block in execute'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/database/connecting.rb:264:in `block in synchronize'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/connection_pool/threaded.rb:91:in `hold'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/database/connecting.rb:264:in `synchronize'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/adapters/utils/mysql_mysql2.rb:38:in `execute'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/adapters/mysql2.rb:68:in `execute_dui'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/database/query.rb:43:in `execute_ddl'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/database/query.rb:76:in `run'
/usr/lib/one/ruby/onedb/local/5.4.1_to_5.5.80.rb:199:in `bug_2189'
/usr/lib/one/ruby/onedb/local/5.4.1_to_5.5.80.rb:40:in `up'
/usr/lib/one/ruby/onedb/onedb.rb:232:in `apply_migrators'
/usr/lib/one/ruby/onedb/onedb.rb:179:in `upgrade'
/usr/bin/onedb:389:in `block (2 levels) in <main>'
/usr/lib/one/ruby/cli/command_parser.rb:457:in `call'
/usr/lib/one/ruby/cli/command_parser.rb:457:in `run'
/usr/lib/one/ruby/cli/command_parser.rb:84:in `initialize'
/usr/bin/onedb:294:in `new'
/usr/bin/onedb:294:in `<main>'
The database will be restored
MySQL DB opennebula at localhost restored.
[root@LXLI03-T11 opennebula-5.5.90-1]# onedb fsck -S localhost -u oneadmin -p XXXXXXX -d opennebula
Version mismatch: fsck file is for version
Shared: 5.5.80, Local: 5.5.80
Current database is version
Shared: 5.4.1, Local: 5.4.1
Hi!
Thanks for the reply - I changed the line and tried again:
[root@LXLI03-T11 ~]# onedb upgrade -v -S localhost -u root -p test1234 -d opennebula
Version read:
Shared tables 5.4.1 : OpenNebula 5.4.6 daemon bootstrap
Local tables 5.4.1 : OpenNebula 5.4.6 daemon bootstrap
MySQL dump stored in /var/lib/one/mysql_localhost_opennebula_2018-7-3_18:19:52.sql
Use 'onedb restore' or restore the DB using the mysql command:
mysql -u user -h server -P port db_name < backup_file
>>> Running migrators for shared tables
> Running migrator /usr/lib/one/ruby/onedb/shared/5.4.1_to_5.5.80.rb
> Done in 0.00s
Database migrated from 5.4.1 to 5.5.80 (OpenNebula 5.5.80) by onedb command.
>>> Running migrators for local tables
> Running migrator /usr/lib/one/ruby/onedb/local/5.4.1_to_5.5.80.rb
> Old Az file not found, skipping Az host migration
> Done in 0.16s
Database migrated from 5.4.1 to 5.5.80 (OpenNebula 5.5.80) by onedb command.
Total time: 0.17s
[root@LXLI03-T11 ~]# onedb fsck -S localhost -u root -d opennebula
MySQL Password:
MySQL dump stored in /var/lib/one/mysql_localhost_opennebula_2018-7-3_18:22:48.sql
Use 'onedb restore' or restore the DB using the mysql command:
mysql -u user -h server -P port db_name < backup_file
incompatible character encodings: UTF-8 and ISO-8859-1
/usr/lib/one/ruby/onedb/fsck/host.rb:51:in `block in check_host_cluster'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/dataset/actions.rb:151:in `block in each'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/adapters/mysql2.rb:238:in `block (2 levels) in fetch_rows'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/adapters/mysql2.rb:238:in `each'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/adapters/mysql2.rb:238:in `block in fetch_rows'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/adapters/mysql2.rb:152:in `_execute'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/adapters/utils/mysql_mysql2.rb:38:in `block in execute'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/database/connecting.rb:264:in `block in synchronize'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/connection_pool/threaded.rb:91:in `hold'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/database/connecting.rb:264:in `synchronize'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/adapters/utils/mysql_mysql2.rb:38:in `execute'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/dataset/actions.rb:1082:in `execute'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/adapters/mysql2.rb:273:in `execute'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/adapters/mysql2.rb:236:in `fetch_rows'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/dataset/actions.rb:151:in `each'
/usr/local/share/gems/gems/sequel-5.7.1/lib/sequel/database/dataset.rb:51:in `fetch'
/usr/lib/one/ruby/onedb/fsck/host.rb:19:in `check_host_cluster'
/usr/lib/one/ruby/onedb/fsck.rb:288:in `fsck'
/usr/lib/one/ruby/onedb/onedb.rb:280:in `fsck'
/usr/bin/onedb:405:in `block (2 levels) in <main>'
/usr/lib/one/ruby/cli/command_parser.rb:457:in `call'
/usr/lib/one/ruby/cli/command_parser.rb:457:in `run'
/usr/lib/one/ruby/cli/command_parser.rb:84:in `initialize'
/usr/bin/onedb:294:in `new'
/usr/bin/onedb:294:in `<main>'
Error running fsck version 5.5.80
The database will be restored
MySQL DB opennebula at localhost restored.