Bug 1764534 - TypeError: unicode argument expected, got 'str'
Summary: TypeError: unicode argument expected, got 'str'
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-node-ng
Version: 4.3.6
Hardware: x86_64
OS: Linux
high
medium
Target Milestone: ovirt-4.3.7
: 4.3.7
Assignee: Nir Levy
QA Contact: peyu
URL:
Whiteboard:
: 1766461 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-10-23 09:32 UTC by Juan Orti
Modified: 2020-03-19 02:54 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
When performing a rollback to the previous RHVH layer, the rollback failed, and the current layer remained. In this release, rollback to a previous layer succeeds.
Clone Of:
Environment:
Last Closed: 2019-12-12 10:37:09 UTC
oVirt Team: Node
Target Upstream Version:
Embargoed:
peyu: testing_plan_complete+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:4231 0 None None None 2019-12-12 10:37:14 UTC
oVirt gerrit 104311 0 'None' MERGED nodectl: change buf used for logging.StreamHandler from StringIO to BytesIO 2020-12-16 07:48:50 UTC
oVirt gerrit 104332 0 'None' MERGED nodectl: change buf used for logging.StreamHandler from io.StringIO to six.StringIO 2020-12-16 07:48:47 UTC

Description Juan Orti 2019-10-23 09:32:31 UTC
Description of problem:
When doing "nodectl rollback", an exception is printed.

Version-Release number of selected component (if applicable):
ovirt-node-ng-nodectl-4.3.6-0.20190820.0.el7ev.noarch

How reproducible:
Always

Steps to Reproduce:
1. Have an available layer to rollback to and do:
# nodectl rollback

Actual results:

# nodectl info
layers: 
  rhvh-4.3.6.2-0.20190924.0: 
    rhvh-4.3.6.2-0.20190924.0+1
  rhvh-4.3.5.4-0.20190920.0: 
    rhvh-4.3.5.4-0.20190920.0+1
bootloader: 
  default: rhvh-4.3.6.2-0.20190924.0 (3.10.0-1062.1.2.el7.x86_64)
  entries: 
    rhvh-4.3.5.4-0.20190920.0 (3.10.0-1062.1.2.el7.x86_64): 
      index: 1
      title: rhvh-4.3.5.4-0.20190920.0 (3.10.0-1062.1.2.el7.x86_64)
      kernel: /boot/rhvh-4.3.5.4-0.20190920.0+1/vmlinuz-3.10.0-1062.1.2.el7.x86_64
      args: "ro crashkernel=auto rd.lvm.lv=rhvh_rhvh43-01/swap rd.lvm.lv=rhvh_rhvh43-01/rhvh-4.3.5.4-0.20190920.0+1 rhgb quiet LANG=en_US.UTF-8 img.bootid=rhvh-4.3.5.4-0.20190920.0+1"
      initrd: /boot/rhvh-4.3.5.4-0.20190920.0+1/initramfs-3.10.0-1062.1.2.el7.x86_64.img
      root: /dev/rhvh_rhvh43-01/rhvh-4.3.5.4-0.20190920.0+1
    rhvh-4.3.6.2-0.20190924.0 (3.10.0-1062.1.2.el7.x86_64): 
      index: 0
      title: rhvh-4.3.6.2-0.20190924.0 (3.10.0-1062.1.2.el7.x86_64)
      kernel: /boot/rhvh-4.3.6.2-0.20190924.0+1/vmlinuz-3.10.0-1062.1.2.el7.x86_64
      args: "ro crashkernel=auto rd.lvm.lv=rhvh_rhvh43-01/swap rd.lvm.lv=rhvh_rhvh43-01/rhvh-4.3.6.2-0.20190924.0+1 rhgb quiet LANG=en_US.UTF-8 img.bootid=rhvh-4.3.6.2-0.20190924.0+1"
      initrd: /boot/rhvh-4.3.6.2-0.20190924.0+1/initramfs-3.10.0-1062.1.2.el7.x86_64.img
      root: /dev/rhvh_rhvh43-01/rhvh-4.3.6.2-0.20190924.0+1
current_layer: rhvh-4.3.6.2-0.20190924.0+1


# nodectl rollback
Traceback (most recent call last):
  File "/usr/lib64/python2.7/logging/__init__.py", line 872, in emit
    stream.write(fs % msg)
TypeError: unicode argument expected, got 'str'
Logged from file update.py, line 171
Traceback (most recent call last):
  File "/usr/lib64/python2.7/logging/__init__.py", line 872, in emit
    stream.write(fs % msg)
TypeError: unicode argument expected, got 'str'
Logged from file update.py, line 172
Traceback (most recent call last):
  File "/usr/lib64/python2.7/logging/__init__.py", line 872, in emit
    stream.write(fs % msg)
TypeError: unicode argument expected, got 'str'
Logged from file update.py, line 180
Traceback (most recent call last):
  File "/usr/lib64/python2.7/logging/__init__.py", line 872, in emit
    stream.write(fs % msg)
TypeError: unicode argument expected, got 'str'
Logged from file update.py, line 181
Status: Success
  New layer: rhvh-4.3.5.4-0.20190920.0+1

Expected results:
No exceptions printed

Additional info:
The rollback is done correctly, and the host can boot into the new layer correctly.

Comment 1 peyu 2019-10-24 10:46:12 UTC
I reproduced this bug.

Test steps:
1. Install RHVH-4.3-20190920.3-RHVH-x86_64-dvd1.iso and reboot
2. Login to RHVH and point the local upgrade repository to redhat-virtualization-host-image-update-4.3.6-20190924.0.el7_7.noarch.rpm
3. Upgrade RHVH
   # yum update
4. Reboot and log in to the new build rhvh-4.3.6.2-0.20190924.0+
5. Check available layers
   # nodectl info
6. Rollback to old layer
   # nodectl rollback



Test results:
1. The result of step 5 is correct:
layers: 
  rhvh-4.3.6.2-0.20190924.0: 
    rhvh-4.3.6.2-0.20190924.0+1
  rhvh-4.3.5.4-0.20190920.0: 
    rhvh-4.3.5.4-0.20190920.0+1
bootloader: 
  default: rhvh-4.3.5.4-0.20190920.0 (3.10.0-1062.1.2.el7.x86_64)
  entries: 
    rhvh-4.3.5.4-0.20190920.0 (3.10.0-1062.1.2.el7.x86_64): 
      index: 1
      title: rhvh-4.3.5.4-0.20190920.0 (3.10.0-1062.1.2.el7.x86_64)
      kernel: /boot/rhvh-4.3.5.4-0.20190920.0+1/vmlinuz-3.10.0-1062.1.2.el7.x86_64
      args: "ro crashkernel=auto spectre_v2=retpoline rd.lvm.lv=rhvh/rhvh-4.3.5.4-0.20190920.0+1 rd.lvm.lv=rhvh/swap rhgb quiet LANG=en_US.UTF-8 img.bootid=rhvh-4.3.5.4-0.20190920.0+1"
      initrd: /boot/rhvh-4.3.5.4-0.20190920.0+1/initramfs-3.10.0-1062.1.2.el7.x86_64.img
      root: /dev/rhvh/rhvh-4.3.5.4-0.20190920.0+1
    rhvh-4.3.6.2-0.20190924.0 (3.10.0-1062.1.2.el7.x86_64): 
      index: 0
      title: rhvh-4.3.6.2-0.20190924.0 (3.10.0-1062.1.2.el7.x86_64)
      kernel: /boot/rhvh-4.3.6.2-0.20190924.0+1/vmlinuz-3.10.0-1062.1.2.el7.x86_64
      args: "ro crashkernel=auto spectre_v2=retpoline rd.lvm.lv=rhvh/rhvh-4.3.6.2-0.20190924.0+1 rd.lvm.lv=rhvh/swap rhgb quiet LANG=en_US.UTF-8 img.bootid=rhvh-4.3.6.2-0.20190924.0+1"
      initrd: /boot/rhvh-4.3.6.2-0.20190924.0+1/initramfs-3.10.0-1062.1.2.el7.x86_64.img
      root: /dev/rhvh/rhvh-4.3.6.2-0.20190924.0+1
current_layer: rhvh-4.3.6.2-0.20190924.0+1

2. The result of step 6 is wrong:
Traceback (most recent call last):
  File "/usr/lib64/python2.7/logging/__init__.py", line 872, in emit
    stream.write(fs % msg)
TypeError: unicode argument expected, got 'str'
Logged from file update.py, line 171
Traceback (most recent call last):
  File "/usr/lib64/python2.7/logging/__init__.py", line 872, in emit
    stream.write(fs % msg)
TypeError: unicode argument expected, got 'str'
Logged from file update.py, line 172
Traceback (most recent call last):
  File "/usr/lib64/python2.7/logging/__init__.py", line 872, in emit
    stream.write(fs % msg)
TypeError: unicode argument expected, got 'str'
Logged from file update.py, line 180
Traceback (most recent call last):
  File "/usr/lib64/python2.7/logging/__init__.py", line 872, in emit
    stream.write(fs % msg)
TypeError: unicode argument expected, got 'str'
Logged from file update.py, line 181
Status: Success
  New layer: rhvh-4.3.5.4-0.20190920.0+1

Comment 3 Nir Levy 2019-11-04 06:55:13 UTC
*** Bug 1766461 has been marked as a duplicate of this bug. ***

Comment 5 peyu 2019-11-15 04:19:34 UTC
This bug has been resolved.

Test steps:
1. Install RHVH-4.1-20170425.3-RHVH-x86_64-dvd1.iso and reboot
2. Login to RHVH and download redhat-virtualization-host-image-update-4.2-20191107.0.el7_6.noarch.rpm
3. Upgrade RHVH
   # yum install redhat-virtualization-host-image-update-4.2-20191107.0.el7_6.noarch.rpm
4. Reboot and log in to the new build rhvh-4.2.16.1-0.20191107.0
5. Point the local upgrade repository to redhat-virtualization-host-image-update-4.3.7-20191113.0.el7_7.noarch.rpm
6. Upgrad RHVH
   # yum update
7. Check available layers
   # nodectl info
8. Rollback to old layer
   # nodectl rollback
   or
   # imgbase rollback
9. Reboot and focus on boot entry and check:
   #imgbase layout
10. Repeat steps 8 and 9 again.



Test results:
Rollback to previous layer successful.


So change the bug status to VERIFIED.

Comment 9 errata-xmlrpc 2019-12-12 10:37:09 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:4231


Note You need to log in before you can comment on or make changes to this bug.