Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onedb fsck fails with "utf-8" database encoding #4329

Closed
7 tasks
vholer opened this issue Mar 10, 2020 · 1 comment
Closed
7 tasks

onedb fsck fails with "utf-8" database encoding #4329

vholer opened this issue Mar 10, 2020 · 1 comment

Comments

@vholer
Copy link
Contributor

vholer commented Mar 10, 2020

Description

Related to this translation table:
https://github.com/OpenNebula/one/blob/master/src/onedb/onedb_backend.rb#L353

If database is in utf8 encoding, the onedb fsck fails as it doesn't match exact encoding, but "utf8 is an alias for utf8mb3; the character limit is implicit, rather than explicit in the name."

> show create database opennebula;
+------------+---------------------------------------------------------------------+
| Database   | Create Database                                                     |
+------------+---------------------------------------------------------------------+
| opennebula | CREATE DATABASE `opennebula` /*!40100 DEFAULT CHARACTER SET utf8 */ |
+------------+---------------------------------------------------------------------+

Also, catch-all encoding NONE is expected to fail. Probably it should fail more nicely in advance, or maybe always default to ASCII (???).

$ onedb fsck -v -f  -u 'oneadmin'  -p 'XXXXX'  -d 'opennebula'
Version read:
Shared tables 5.10.0 : OpenNebula 5.10.1 (45f6d6df) daemon bootstrap
Local tables  5.10.0 : OpenNebula 5.10.1 (45f6d6df) daemon bootstrap

MySQL dump stored in /var/lib/one/mysql_localhost_opennebula_2020-3-10_8:50:10.sql
Use 'onedb restore' or restore the DB using the mysql command:
mysql -u user -h server -P port db_name < backup_file

  > Running fsck


unknown encoding name - NONE
/usr/share/one/gems-dist/gems/nokogiri-1.10.5/lib/nokogiri/xml/node.rb:697:in `find'
/usr/share/one/gems-dist/gems/nokogiri-1.10.5/lib/nokogiri/xml/node.rb:697:in `serialize'
/usr/share/one/gems-dist/gems/nokogiri-1.10.5/lib/nokogiri/xml/node.rb:722:in `to_xml'
/usr/share/one/gems-dist/gems/nokogiri-1.10.5/lib/nokogiri/xml/node.rb:583:in `to_s'

Because,

$ irb
irb(main):001:0> Encoding.find('NONE')
Traceback (most recent call last):
        3: from /usr/bin/irb:11:in `<main>'
        2: from (irb):1
        1: from (irb):1:in `find'
ArgumentError (unknown encoding name - NONE)

Details

  • Affected Component: onedb
  • Version: 5.10.3

Progress Status

  • Branch created
  • Code committed to development branch
  • Testing - QA
  • Documentation
  • Release notes - resolved issues, compatibility, known issues
  • Code committed to upstream release/hotfix branches
  • Documentation committed to upstream release/hotfix branches
@al3xhh
Copy link
Contributor

al3xhh commented Mar 10, 2020

rsmontero pushed a commit that referenced this issue Mar 10, 2020
rsmontero pushed a commit to OpenNebula/docs that referenced this issue Mar 10, 2020
atodorov-storpool pushed a commit to storpool/one that referenced this issue Mar 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants