Bug #5225

onedb upgrade errors (migrator scripts)

Added by Stefan Kooman almost 4 years ago. Updated almost 4 years ago.

Status:ClosedStart date:07/11/2017
Priority:HighDue date:
Assignee:Javi Fontan% Done:

0%

Category:Core & System
Target version:Release 5.4
Resolution:fixed Pull request:
Affected Versions:Development

Description

Trying to upgrade OpenNebula 5.2 to 5.4-RC1 I get the following errors:

Running migrators for shared tables

Database migrated from 5.2.0 to 5.3.80 (OpenNebula 5.3.80) by onedb command.

Running migrators for local tables

Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql MEDIUMTEXT, timestamp INTEGER)' at line 1
/var/lib/gems/2.3.0/gems/mysql2-0.4.6/lib/mysql2/client.rb:120:in `_query'
/var/lib/gems/2.3.0/gems/mysql2-0.4.6/lib/mysql2/client.rb:120:in `block in query'
/var/lib/gems/2.3.0/gems/mysql2-0.4.6/lib/mysql2/client.rb:119:in `handle_interrupt'
/var/lib/gems/2.3.0/gems/mysql2-0.4.6/lib/mysql2/client.rb:119:in `query'
/usr/lib/ruby/vendor_ruby/sequel/adapters/mysql2.rb:80:in `block in _execute'
/usr/lib/ruby/vendor_ruby/sequel/database/logging.rb:35:in `log_yield'
/usr/lib/ruby/vendor_ruby/sequel/adapters/mysql2.rb:80:in `_execute'
/usr/lib/ruby/vendor_ruby/sequel/adapters/shared/mysql_prepared_statements.rb:36:in `block in execute'
/usr/lib/ruby/vendor_ruby/sequel/database/connecting.rb:251:in `block in synchronize'
/usr/lib/ruby/vendor_ruby/sequel/connection_pool/threaded.rb:105:in `hold'
/usr/lib/ruby/vendor_ruby/sequel/database/connecting.rb:251:in `synchronize'
/usr/lib/ruby/vendor_ruby/sequel/adapters/shared/mysql_prepared_statements.rb:36:in `execute'
/usr/lib/ruby/vendor_ruby/sequel/adapters/mysql2.rb:59:in `execute_dui'
/usr/lib/ruby/vendor_ruby/sequel/database/query.rb:45:in `execute_ddl'
/usr/lib/ruby/vendor_ruby/sequel/database/query.rb:78:in `run'
/usr/lib/one/ruby/onedb/database_schema.rb:98:in `create_table'
/usr/lib/one/ruby/onedb/local/4.90.0_to_5.3.80.rb:185:in `feature_4809'
/usr/lib/one/ruby/onedb/local/4.90.0_to_5.3.80.rb:49: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:323:in `block (2 levels) in <main>'
/usr/lib/one/ruby/cli/command_parser.rb:449:in `run'
/usr/lib/one/ruby/cli/command_parser.rb:76:in `initialize'
/usr/bin/onedb:228:in `new'
/usr/bin/onedb:228:in `<main>'

This seems to be related to "sql-mode" in MySQL server. Disabling scrict:
#sql-mode = STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_AUTO_VALUE_ON_ZERO,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ONLY_FULL_GROUP_BY

Gives the following eror message:

Running migrators for shared tables

Database migrated from 5.2.0 to 5.3.80 (OpenNebula 5.3.80) by onedb command.

Running migrators for local tables

Mysql2::Error: Table 'vmgroup_pool' already exists
/var/lib/gems/2.3.0/gems/mysql2-0.4.6/lib/mysql2/client.rb:120:in `_query'
/var/lib/gems/2.3.0/gems/mysql2-0.4.6/lib/mysql2/client.rb:120:in `block in query'
/var/lib/gems/2.3.0/gems/mysql2-0.4.6/lib/mysql2/client.rb:119:in `handle_interrupt'
/var/lib/gems/2.3.0/gems/mysql2-0.4.6/lib/mysql2/client.rb:119:in `query'
/usr/lib/ruby/vendor_ruby/sequel/adapters/mysql2.rb:80:in `block in _execute'
/usr/lib/ruby/vendor_ruby/sequel/database/logging.rb:35:in `log_yield'
/usr/lib/ruby/vendor_ruby/sequel/adapters/mysql2.rb:80:in `_execute'
/usr/lib/ruby/vendor_ruby/sequel/adapters/shared/mysql_prepared_statements.rb:36:in `block in execute'
/usr/lib/ruby/vendor_ruby/sequel/database/connecting.rb:251:in `block in synchronize'
/usr/lib/ruby/vendor_ruby/sequel/connection_pool/threaded.rb:105:in `hold'
/usr/lib/ruby/vendor_ruby/sequel/database/connecting.rb:251:in `synchronize'
/usr/lib/ruby/vendor_ruby/sequel/adapters/shared/mysql_prepared_statements.rb:36:in `execute'
/usr/lib/ruby/vendor_ruby/sequel/adapters/mysql2.rb:59:in `execute_dui'
/usr/lib/ruby/vendor_ruby/sequel/database/query.rb:45:in `execute_ddl'
/usr/lib/ruby/vendor_ruby/sequel/database/query.rb:78:in `run'
/usr/lib/one/ruby/onedb/database_schema.rb:98:in `create_table'
/usr/lib/one/ruby/onedb/local/4.90.0_to_5.3.80.rb:142:in `feature_2347'
/usr/lib/one/ruby/onedb/local/4.90.0_to_5.3.80.rb:45: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:323:in `block (2 levels) in <main>'
/usr/lib/one/ruby/cli/command_parser.rb:449:in `run'
/usr/lib/one/ruby/cli/command_parser.rb:76:in `initialize'
/usr/bin/onedb:228:in `new'
/usr/bin/onedb:228:in `<main>'

The database will be restored

ruby_list - Ubuntu installed ruby related packages (5.6 KB) Stefan Kooman, 07/11/2017 08:12 AM

ruby_gem_list - ruby gems installed (1.05 KB) Stefan Kooman, 07/11/2017 08:12 AM


Related issues

Related to Bug #4904: "onedb upgrade" and "onedb restore" do not correctly rest... Closed 11/07/2016

Associated revisions

Revision c4662c0b
Added by Javi Fontan almost 4 years ago

B #5225: bug in fsck cluster_vnc_bitmap

Revision 1448e1df
Added by Javi Fontan almost 4 years ago

B #5225: schema for logdb was not updated

Revision 8257b5b8
Added by Javi Fontan almost 4 years ago

B #5225: delete tables before creating them

History

#1 Updated by Stefan Kooman almost 4 years ago

Environment: Ubuntu 16.04.2 LTS, MySQL server 5.7.18-0ubuntu0.16.04.1, see for ruby related packages / gem list the attached files.

#2 Updated by Ruben S. Montero almost 4 years ago

  • Category set to Core & System
  • Status changed from Pending to New
  • Assignee set to Javi Fontan
  • Target version set to Release 5.4

#3 Updated by Javi Fontan almost 4 years ago

I am not able to replicate the first error. Have you enable strict mode manually?

We are already looking at the second error, it should be this one #4904.

#4 Updated by Stefan Kooman almost 4 years ago

@Javi: Yes, the first one is related to SQL scrict mode:

This seems to be related to "sql-mode" in MySQL server. Disabling scrict:
#sql-mode = STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_AUTO_VALUE_ON_ZERO,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ONLY_FULL_GROUP_BY

If I drop tables "vmgroup_pool" and "logdb" after a "restore" I can succesfully upgrade. However, onedb fsck gives:

Cluster 100 has not the proper reserved VNC ports

Mysql2::Error: Unknown column 'oid' in 'where clause'
/var/lib/gems/2.3.0/gems/mysql2-0.4.8/lib/mysql2/client.rb:120:in `_query'
/var/lib/gems/2.3.0/gems/mysql2-0.4.8/lib/mysql2/client.rb:120:in `block in query'
/var/lib/gems/2.3.0/gems/mysql2-0.4.8/lib/mysql2/client.rb:119:in `handle_interrupt'
/var/lib/gems/2.3.0/gems/mysql2-0.4.8/lib/mysql2/client.rb:119:in `query'
/usr/lib/ruby/vendor_ruby/sequel/adapters/mysql2.rb:80:in `block in _execute'
/usr/lib/ruby/vendor_ruby/sequel/database/logging.rb:35:in `log_yield'
/usr/lib/ruby/vendor_ruby/sequel/adapters/mysql2.rb:80:in `_execute'
/usr/lib/ruby/vendor_ruby/sequel/adapters/shared/mysql_prepared_statements.rb:36:in `block in execute'
/usr/lib/ruby/vendor_ruby/sequel/database/connecting.rb:251:in `block in synchronize'
/usr/lib/ruby/vendor_ruby/sequel/connection_pool/threaded.rb:101:in `hold'
/usr/lib/ruby/vendor_ruby/sequel/database/connecting.rb:251:in `synchronize'
/usr/lib/ruby/vendor_ruby/sequel/adapters/shared/mysql_prepared_statements.rb:36:in `execute'
/usr/lib/ruby/vendor_ruby/sequel/adapters/mysql2.rb:59:in `execute_dui'
/usr/lib/ruby/vendor_ruby/sequel/dataset/actions.rb:963:in `execute_dui'
/usr/lib/ruby/vendor_ruby/sequel/dataset/actions.rb:809:in `update'
/usr/lib/one/ruby/onedb/fsck/cluster_vnc_bitmap.rb:35:in `block (2 levels) in fix_cluster_vnc_bitmap'
/usr/lib/one/ruby/onedb/fsck/cluster_vnc_bitmap.rb:34:in `each'
/usr/lib/one/ruby/onedb/fsck/cluster_vnc_bitmap.rb:34:in `block in fix_cluster_vnc_bitmap'
/usr/lib/ruby/vendor_ruby/sequel/database/transactions.rb:136:in `_transaction'
/usr/lib/ruby/vendor_ruby/sequel/database/transactions.rb:110:in `block in transaction'
/usr/lib/ruby/vendor_ruby/sequel/database/connecting.rb:251:in `block in synchronize'
/usr/lib/ruby/vendor_ruby/sequel/connection_pool/threaded.rb:105:in `hold'
/usr/lib/ruby/vendor_ruby/sequel/database/connecting.rb:251:in `synchronize'
/usr/lib/ruby/vendor_ruby/sequel/database/transactions.rb:99:in `transaction'
/usr/lib/one/ruby/onedb/fsck/cluster_vnc_bitmap.rb:33:in `fix_cluster_vnc_bitmap'
/usr/lib/one/ruby/onedb/fsck.rb:365:in `fsck'
/usr/lib/one/ruby/onedb/onedb.rb:280:in `fsck'
/usr/bin/onedb:397:in `block (2 levels) in <main>'
/usr/lib/one/ruby/cli/command_parser.rb:449:in `run'
/usr/lib/one/ruby/cli/command_parser.rb:76:in `initialize'
/usr/bin/onedb:286:in `new'
/usr/bin/onedb:286:in `<main>'

Error running fsck version 5.3.80

#5 Updated by Javi Fontan almost 4 years ago

  • Related to Bug #4904: "onedb upgrade" and "onedb restore" do not correctly restore database added

#6 Updated by Javi Fontan almost 4 years ago

  • Status changed from New to Closed
  • Resolution set to fixed

Also available in: Atom PDF