Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1444806 - [3.5] Unable to run upgrade playbook
[3.5] Unable to run upgrade playbook
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Upgrade (Show other bugs)
3.5.0
Unspecified Unspecified
unspecified Severity unspecified
: ---
: 3.5.z
Assigned To: Russell Teague
liujia
:
: 1446471 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-04-24 07:09 EDT by Jonas Nordell
Modified: 2017-05-17 13:40 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Previously, the playbooks would abort if a namespace had non ASCII characters in their descriptions. The playbooks have been updated to to properly decode unicode characters ensuring that upgrades to 3.5 work as expected.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-05-17 13:40:17 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
inventory file (884 bytes, text/plain)
2017-04-24 09:23 EDT, Jonas Nordell
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2017:1244 normal SHIPPED_LIVE Important: ansible and openshift-ansible security and bug fix update 2017-05-25 17:43:49 EDT

  None (edit)
Description Jonas Nordell 2017-04-24 07:09:36 EDT
Description of problem:

When trying to run /usr/share/ansible/openshift-ansible/playbooks/byo/openshift-cluster/upgrades/v3_5/upgrade.yml it fail with the following error message

TASK [Check for invalid namespaces and SDN errors] *****************************
fatal: [osemaster1.somedomain.org]: FAILED! => {
    "changed": false,
    "failed": true,
    "module_stderr": "Shared connection to osemaster1.somedomain.org closed.\r\n",
    "module_stdout": "Traceback (most recent call last):\r\n  File \"/tmp/ansible_7h8xiP/ansible_module_oc_objectvalidator.py\", line 1420, in <module>\r\n    main()\r\n  File \"/tmp/ansible_7h8xiP/ansible_module_oc_objectvalidator.py\", line 1413, in main\r\n    rval = OCObjectValidator.run_ansible(module.params)\r\n  File \"/tmp/ansible_7h8xiP/ansible_module_oc_objectvalidator.py\", line 1375, in run_ansible\r\n    success, rval, invalid = objectvalidator.get_invalid(resource, invalid_filter)\r\n  File \"/tmp/ansible_7h8xiP/ansible_module_oc_objectvalidator.py\", line 1324, in get_invalid\r\n    rval = self._get(kind)\r\n  File \"/tmp/ansible_7h8xiP/ansible_module_oc_objectvalidator.py\", line 853, in _get\r\n    rval = self.openshift_cmd(cmd, output=True)\r\n  File \"/tmp/ansible_7h8xiP/ansible_module_oc_objectvalidator.py\", line 979, in openshift_cmd\r\n    returncode, stdout, stderr = self._run(cmds, input_data)\r\n  File \"/tmp/ansible_7h8xiP/ansible_module_oc_objectvalidator.py\", line 954, in _run\r\n    return proc.returncode, stdout.decode(), stderr.decode()\r\nUnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 13263: ordinal not in range(128)\r\n"
}


Version-Release number of selected component (if applicable):

atomic-openshift-utils-3.5.53-1.git.0.8ade9f2.el7.noarch
ansible-2.2.1.0-2.el7.noarch

How reproducible:

If I run "ansible-playbook -i /etc/ansible/hosts /usr/share/ansible/openshift-ansible/playbooks/byo/openshift-cluster/upgrades/v3_5/upgrade.yml" it fails every time.

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:
Comment 1 Russell Teague 2017-04-24 09:06:54 EDT
Do you have unicode characters in your inventory file?  This can be caused by unicode characters and in some cases the unicode characters are unintentionally added while using some editors.

An example for checking for unicode characters:
$ grep --color='auto' -P -n "[\x80-\xFF]" <inventory_file>
Comment 2 Russell Teague 2017-04-24 09:14:03 EDT
If unicode characters are required, we can backport this fix in master:
https://github.com/openshift/openshift-ansible/pull/3808
Comment 3 Jonas Nordell 2017-04-24 09:23:04 EDT
No there are no unicode characters that I can find. Attached is a copy of my inventory file
Comment 4 Jonas Nordell 2017-04-24 09:23 EDT
Created attachment 1273614 [details]
inventory file
Comment 5 Mo 2017-04-24 09:36:16 EDT
From:

Traceback (most recent call last):
  File \"/tmp/ansible_7h8xiP/ansible_module_oc_objectvalidator.py\", line 1420, in <module>
    main()
  File \"/tmp/ansible_7h8xiP/ansible_module_oc_objectvalidator.py\", line 1413, in main
    rval = OCObjectValidator.run_ansible(module.params)
  File \"/tmp/ansible_7h8xiP/ansible_module_oc_objectvalidator.py\", line 1375, in run_ansible
    success, rval, invalid = objectvalidator.get_invalid(resource, invalid_filter)
  File \"/tmp/ansible_7h8xiP/ansible_module_oc_objectvalidator.py\", line 1324, in get_invalid
    rval = self._get(kind)
  File \"/tmp/ansible_7h8xiP/ansible_module_oc_objectvalidator.py\", line 853, in _get
    rval = self.openshift_cmd(cmd, output=True)
  File \"/tmp/ansible_7h8xiP/ansible_module_oc_objectvalidator.py\", line 979, in openshift_cmd
    returncode, stdout, stderr = self._run(cmds, input_data)
  File \"/tmp/ansible_7h8xiP/ansible_module_oc_objectvalidator.py\", line 954, in _run
    return proc.returncode, stdout.decode(), stderr.decode()
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 13263: ordinal not in range(128)


The `decode` calls in `return proc.returncode, stdout.decode(), stderr.decode()` need to be updated to either work correctly with unicode or (worst case) throw away the data.
Comment 7 Russell Teague 2017-05-04 14:50:11 EDT
Proposed: https://github.com/openshift/openshift-ansible/pull/4098
Comment 10 liujia 2017-05-10 02:09:01 EDT
Version:
atomic-openshift-utils-3.5.68-1.git.0.1d3158b.el7.noarch

Steps:
1. install ocp3.4
# openshift version
openshift v3.4.1.18
kubernetes v1.4.0+776c994
etcd 3.1.0-rc.0
2. new-project test with non ascii character in description
# oc describe project test 
Name:			test
Namespace:		<none>
Created:		About an hour ago
Labels:			<none>
Annotations:		openshift.io/description=中文
			openshift.io/display-name=
			openshift.io/requester=system:admin
			openshift.io/sa.scc.mcs=s0:c8,c7
			openshift.io/sa.scc.supplemental-groups=1000070000/10000
			openshift.io/sa.scc.uid-range=1000070000/10000
Display Name:		<none>
Description:		中文
Status:			Active
Node Selector:		<none>
Quota:			<none>
Resource limits:	<none>

3. run upgrade playbook
Result:
Upgrade succeed.
# openshift version
openshift v3.5.5.8
kubernetes v1.5.2+43a9be4
etcd 3.1.0

Change bug's status to verify.
Comment 11 Russell Teague 2017-05-10 08:47:44 EDT
*** Bug 1446471 has been marked as a duplicate of this bug. ***
Comment 13 errata-xmlrpc 2017-05-17 13:40:17 EDT
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/RHSA-2017:1244

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