Bug #4953

Attempting to import an OpenNebula 5.2.0 slave into an OpenNebula 5.2.0 master fails

Added by Roy Keene almost 4 years ago. Updated about 3 years ago.

Status:ClosedStart date:12/19/2016
Priority:NormalDue date:
Assignee:Jaime Melis% Done:

0%

Category:Core & System
Target version:-
Resolution:wontfix Pull request:
Affected Versions:OpenNebula 5.2

Description

Attempting to import an OpenNebula 5.2.0 slave into an OpenNebula 5.2.0 master fails with error:

Mysql::Error: Unknown column 'cid' in 'field list'

Removing line 1342 of "import_slave.rb" resolve this error and the imported system appears to work. But I have not looked into the DB to see if this is appropriate.

1333             db[:network_pool].insert(
1334                 :oid        => row[:oid],
1335                 :name       => row[:name],
1336                 :body       => doc.root.to_s,
1337                 :uid        => new_user[:oid],
1338                 :gid        => new_group[:oid],
1339                 :owner_u    => row[:owner_u],
1340                 :group_u    => row[:group_u],
1341                 :other_u    => row[:other_u],
1342                 :cid        => row[:cid],
1343                 :pid        => row[:pid])

Complete log of failure:

Master database information:
Version read:
Shared tables 5.2.0 : OpenNebula 5.2.0 daemon bootstrap
Local tables  4.90.0 : OpenNebula 5.2.0 daemon bootstrap

Slave database information:
Version read:
Shared tables 5.2.0 : OpenNebula 5.2.0 daemon bootstrap
Local tables  4.90.0 : OpenNebula 5.2.0 daemon bootstrap

Before running this tool, it is required to create a new Zone in the
Master OpenNebula.
Please enter the Zone ID that you created to represent the new Slave OpenNebula:
Zone ID: 100

The import process will move the users from the slave OpeNenbula to the master
OpenNebula. In case of conflict, it can merge users with the same name.
For example:
+----------+-------------++------------+---------------+
| Master   | Slave       || With merge | Without merge |
+----------+-------------++------------+---------------+
| 5, alice | 2, alice    || 5, alice   | 5, alice      |
| 6, bob   | 5, bob      || 6, bob     | 6, bob        |
|          |             ||            | 7, alice-1    |
|          |             ||            | 8, bob-1      |
+----------+-------------++------------+---------------+

In any case, the ownership of existing resources and group membership
is preserved.

Do you want to merge USERS (Y/N): y

Do you want to merge GROUPS (Y/N): y

Do you want to merge VDCS (Y/N): y
MySQL dump stored in /tmp/tmp.aUvn39WT9o.master
Use 'onedb restore' or restore the DB using the mysql command:
mysql -u user -h server -P port db_name < backup_file

MySQL dump stored in /tmp/tmp.aUvn39WT9o.slave
Use 'onedb restore' or restore the DB using the mysql command:
mysql -u user -h server -P port db_name < backup_file

  > Running slave import
The Slave OpenNebula will be imported to the Master OpenNebula as Zone #100, aurae-dev.
Users will be moved from the slave DB to the master DB. They will need
a new ID and name.
Old Slave ID name  =>  New Master ID name

   0 admin             =>     0 admin
   1 serveradmin       =>     1 serveradmin

Groups will be moved from the slave DB to the master DB. They will need
a new ID and name.
Old Slave ID name  =>  New Master ID name

   0 oneadmin          =>     0 oneadmin
   1 users             =>     1 users

VDCs will be moved from the slave DB to the master DB. They will need
a new ID and name.
Old Slave ID name  =>  New Master ID name

   0 default           =>     0 default

MarketPlaces will be moved from the slave DB to the master DB. They will need
a new ID and name.
Old Slave ID name  =>  New Master ID name

   0 OpenNebula Public  =>   100 OpenNebula Public - aurae-dev

MarketPlaceApps will be moved from the slave DB to the master DB. They will need
a new ID and name.
Old Slave ID name  =>  New Master ID name

  34 alpine-vrouter (KVM)  =>    47 alpine-vrouter (KVM) - aurae-dev
  36 alpine-vrouter (vcenter)  =>    48 alpine-vrouter (vcenter) - aurae-dev
  23 Arch Linux        =>    49 Arch Linux - aurae-dev
  33 Blank Template - vdc  =>    50 Blank Template - vdc - aurae-dev
  39 boot2docker       =>    51 boot2docker - aurae-dev
   0 Carina Environment Manager  =>    52 Carina Environment Manager - aurae-dev
  29 CentOS 5.11 - KVM  =>    53 CentOS 5.11 - KVM - aurae-dev
  20 CentOS 6.5 - KVM  =>    54 CentOS 6.5 - KVM - aurae-dev
   6 CentOS 6.5 - VMware  =>    55 CentOS 6.5 - VMware - aurae-dev
  11 CentOS 6.5 - Xen  =>    56 CentOS 6.5 - Xen - aurae-dev
   8 CentOS 7.2 - KVM  =>    57 CentOS 7.2 - KVM - aurae-dev
  30 CoreOS alpha      =>    58 CoreOS alpha - aurae-dev
  26 DCI Bridge Direct Cloud Slave Appliance  =>    59 DCI Bridge Direct Cloud Slave Appliance - aurae-dev
  21 Debian 7 - KVM    =>    60 Debian 7 - KVM - aurae-dev
  35 Debian 8.4 - KVM  =>    61 Debian 8.4 - KVM - aurae-dev
   5 Debian Wheezy Bio Imaging  =>    62 Debian Wheezy Bio Imaging - aurae-dev
   2 Debian Wheezy Galaxy NGS  =>    63 Debian Wheezy Galaxy NGS - aurae-dev
   4 Debian Wheezy NGS  =>    64 Debian Wheezy NGS - aurae-dev
   3 Debian Wheezy Proteomics  =>    65 Debian Wheezy Proteomics - aurae-dev
   1 Debian Wheezy XGrid  =>    66 Debian Wheezy XGrid - aurae-dev
  22 debian-7.1-amd64-kvm  =>    67 debian-7.1-amd64-kvm - aurae-dev
  38 Devuan            =>    68 Devuan - aurae-dev
  24 gUSE CloudBroker Wrapper  =>    69 gUSE CloudBroker Wrapper - aurae-dev
  27 gUse v3.5.2       =>    70 gUse v3.5.2 - aurae-dev
  17 Hadoop 1.2 Master  =>    71 Hadoop 1.2 Master - aurae-dev
  16 Hadoop 1.2 Slave  =>    72 Hadoop 1.2 Slave - aurae-dev
  18 OpenNebula 4.10 ESX Sandbox  =>    73 OpenNebula 4.10 ESX Sandbox - aurae-dev
  19 OpenNebula 4.10 KVM Sandbox  =>    74 OpenNebula 4.10 KVM Sandbox - aurae-dev
  13 OpenNebula 4.10 VirtualBox Sandbox  =>    75 OpenNebula 4.10 VirtualBox Sandbox - aurae-dev
   9 OpenNebula 4.12 VirtualBox Sandbox  =>    76 OpenNebula 4.12 VirtualBox Sandbox - aurae-dev
   7 OpenNebula 4.14.2 VirtualBox Sandbox  =>    77 OpenNebula 4.14.2 VirtualBox Sandbox - aurae-dev
  40 OpenNebula Virtual Router  =>    78 OpenNebula Virtual Router - aurae-dev
  31 Peppermint 4 Desktop - vdc  =>    79 Peppermint 4 Desktop - vdc - aurae-dev
  25 Testing gUSE installations (on SL5)  =>    80 Testing gUSE installations (on SL5) - aurae-dev
  43 ttylinux - kvm    =>    81 ttylinux - kvm - aurae-dev
  14 ttylinux - VMware  =>    82 ttylinux - VMware - aurae-dev
  42 ttylinux virtio   =>    83 ttylinux virtio - aurae-dev
  15 Ubuntu 14.04 - KVM  =>    84 Ubuntu 14.04 - KVM - aurae-dev
  12 Ubuntu 14.04 - VMware  =>    85 Ubuntu 14.04 - VMware - aurae-dev
  37 Ubuntu 15.04 - KVM  =>    86 Ubuntu 15.04 - KVM - aurae-dev
  10 Ubuntu 16.04 - KVM  =>    87 Ubuntu 16.04 - KVM - aurae-dev
  41 Ubuntu for Docker Machine  =>    88 Ubuntu for Docker Machine - aurae-dev
  32 Ubuntu Server 13.10 v2 - vdc  =>    89 Ubuntu Server 13.10 v2 - vdc - aurae-dev
  28 Vyatta Core 6.5R1 - kvm  =>    90 Vyatta Core 6.5R1 - kvm - aurae-dev
  46 Vyatta Core 6.5R1 KVM HDD  =>    91 Vyatta Core 6.5R1 KVM HDD - aurae-dev
  44 VyOS 1.0.5 64 bits  =>    92 VyOS 1.0.5 64 bits - aurae-dev
  45 VyOS 1.1.5 Helium 64 bits  =>    93 VyOS 1.1.5 Helium 64 bits - aurae-dev

Mysql::Error: Unknown column 'cid' in 'field list'
/lib/ruby/gems/2.3.0/gems/sequel-4.19.0/lib/sequel/adapters/mysql.rb:175:in `query'
/lib/ruby/gems/2.3.0/gems/sequel-4.19.0/lib/sequel/adapters/mysql.rb:175:in `block in _execute'
/lib/ruby/gems/2.3.0/gems/sequel-4.19.0/lib/sequel/database/logging.rb:33:in `log_yield'
/lib/ruby/gems/2.3.0/gems/sequel-4.19.0/lib/sequel/adapters/mysql.rb:175:in `_execute'
/lib/ruby/gems/2.3.0/gems/sequel-4.19.0/lib/sequel/adapters/shared/mysql_prepared_statements.rb:34:in `block in execute'
/lib/ruby/gems/2.3.0/gems/sequel-4.19.0/lib/sequel/database/connecting.rb:250:in `block in synchronize'
/lib/ruby/gems/2.3.0/gems/sequel-4.19.0/lib/sequel/connection_pool/threaded.rb:85:in `hold'
/lib/ruby/gems/2.3.0/gems/sequel-4.19.0/lib/sequel/database/connecting.rb:250:in `synchronize'
/lib/ruby/gems/2.3.0/gems/sequel-4.19.0/lib/sequel/adapters/shared/mysql_prepared_statements.rb:34:in `execute'
/lib/ruby/gems/2.3.0/gems/sequel-4.19.0/lib/sequel/adapters/mysql.rb:160:in `execute_insert'
/lib/ruby/gems/2.3.0/gems/sequel-4.19.0/lib/sequel/dataset/actions.rb:924:in `execute_insert'
/lib/ruby/gems/2.3.0/gems/sequel-4.19.0/lib/sequel/dataset/actions.rb:336:in `insert'
/usr/lib/one/ruby/onedb/import_slave.rb:1333:in `block in process_new_ownership'
/lib/ruby/gems/2.3.0/gems/sequel-4.19.0/lib/sequel/dataset/actions.rb:139:in `block in each'
/lib/ruby/gems/2.3.0/gems/sequel-4.19.0/lib/sequel/adapters/mysql.rb:312:in `block (2 levels) in fetch_rows'
/lib/ruby/gems/2.3.0/gems/sequel-4.19.0/lib/sequel/adapters/mysql.rb:367:in `yield_rows'
/lib/ruby/gems/2.3.0/gems/sequel-4.19.0/lib/sequel/adapters/mysql.rb:312:in `block in fetch_rows'
/lib/ruby/gems/2.3.0/gems/sequel-4.19.0/lib/sequel/adapters/mysql.rb:177:in `_execute'
/lib/ruby/gems/2.3.0/gems/sequel-4.19.0/lib/sequel/adapters/shared/mysql_prepared_statements.rb:34:in `block in execute'
/lib/ruby/gems/2.3.0/gems/sequel-4.19.0/lib/sequel/database/connecting.rb:250:in `block in synchronize'
/lib/ruby/gems/2.3.0/gems/sequel-4.19.0/lib/sequel/connection_pool/threaded.rb:85:in `hold'
/lib/ruby/gems/2.3.0/gems/sequel-4.19.0/lib/sequel/database/connecting.rb:250:in `synchronize'
/lib/ruby/gems/2.3.0/gems/sequel-4.19.0/lib/sequel/adapters/shared/mysql_prepared_statements.rb:34:in `execute'
/lib/ruby/gems/2.3.0/gems/sequel-4.19.0/lib/sequel/dataset/actions.rb:908:in `execute'
/lib/ruby/gems/2.3.0/gems/sequel-4.19.0/lib/sequel/adapters/mysql.rb:351:in `execute'
/lib/ruby/gems/2.3.0/gems/sequel-4.19.0/lib/sequel/adapters/mysql.rb:296:in `fetch_rows'
/lib/ruby/gems/2.3.0/gems/sequel-4.19.0/lib/sequel/dataset/actions.rb:139:in `each'
/lib/ruby/gems/2.3.0/gems/sequel-4.19.0/lib/sequel/database/dataset.rb:46:in `fetch'
/usr/lib/one/ruby/onedb/import_slave.rb:1311:in `process_new_ownership'
/usr/lib/one/ruby/onedb/import_slave.rb:458:in `block in import_slave'
/lib/ruby/gems/2.3.0/gems/sequel-4.19.0/lib/sequel/database/transactions.rb:126:in `_transaction'
/lib/ruby/gems/2.3.0/gems/sequel-4.19.0/lib/sequel/database/transactions.rb:100:in `block in transaction'
/lib/ruby/gems/2.3.0/gems/sequel-4.19.0/lib/sequel/database/connecting.rb:250:in `block in synchronize'
/lib/ruby/gems/2.3.0/gems/sequel-4.19.0/lib/sequel/connection_pool/threaded.rb:98:in `hold'
/lib/ruby/gems/2.3.0/gems/sequel-4.19.0/lib/sequel/database/connecting.rb:250:in `synchronize'
/lib/ruby/gems/2.3.0/gems/sequel-4.19.0/lib/sequel/database/transactions.rb:89:in `transaction'
/usr/lib/one/ruby/onedb/import_slave.rb:457:in `import_slave'
/usr/lib/one/ruby/onedb/onedb.rb:426:in `import_slave'
/bin/onedb:349: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'
/bin/onedb:222:in `new'
/bin/onedb:222:in `<main>'

Error running slave import

History

#1 Updated by Roy Keene almost 4 years ago

Using the "cid" column seems like an error since it is not part of the table:

src/vnm/VirtualNetwork.cc:

  95 const char * VirtualNetwork::db_bootstrap = "CREATE TABLE IF NOT EXISTS" 
  96     " network_pool (oid INTEGER PRIMARY KEY, name VARCHAR(128)," 
  97     " body MEDIUMTEXT, uid INTEGER, gid INTEGER," 
  98     " owner_u INTEGER, group_u INTEGER, other_u INTEGER," 
  99     " pid INTEGER, UNIQUE(name,uid))";

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

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

THANKS for reporting, planing this issue for 5.4

#3 Updated by Gerben Meijer over 3 years ago

Ran into the same issue here.

#4 Updated by Ruben S. Montero over 3 years ago

  • Assignee set to Jaime Melis

#5 Updated by Javi Fontan over 3 years ago

  • Target version deleted (Release 5.4)

This mechanism does not apply anymore to 5.4. We are taking out the target of 5.4. The fix should be done in 5.2 branch.

#6 Updated by Ruben S. Montero about 3 years ago

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

Also available in: Atom PDF