Bug 1561099 - Scaleup fails with Error sequence item 1 expected string or Unicode, int found
Summary: Scaleup fails with Error sequence item 1 expected string or Unicode, int found
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Installer
Version: 3.6.1
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: 3.6.z
Assignee: Vadim Rutkovsky
QA Contact: Gan Huang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-03-27 15:28 UTC by Steven Walter
Modified: 2018-06-28 07:55 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-06-28 07:54:52 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:2007 0 None None None 2018-06-28 07:55:17 UTC

Description Steven Walter 2018-03-27 15:28:21 UTC
Description of problem:
Node scaleup fails with variable parsing error on node label


Version-Release number of the following components:

atomic-openshift-clients-3.6.173.0.96-1.git.0.8f6ff22.el7.x86_64
openshift-ansible-docs-3.6.173.0.96-1.git.0.2954b4a.el7.noarch
atomic-openshift-sdn-ovs-3.6.173.0.96-1.git.0.8f6ff22.el7.x86_64
atomic-openshift-docker-excluder-3.6.173.0.96-1.git.0.8f6ff22.el7.noarch
atomic-openshift-excluder-3.6.173.0.96-1.git.0.8f6ff22.el7.noarch
tuned-profiles-atomic-openshift-node-3.6.173.0.96-1.git.0.8f6ff22.el7.x86_64
openshift-ansible-callback-plugins-3.6.173.0.96-1.git.0.2954b4a.el7.noarch
openshift-ansible-lookup-plugins-3.6.173.0.96-1.git.0.2954b4a.el7.noarch
atomic-openshift-node-3.6.173.0.96-1.git.0.8f6ff22.el7.x86_64
openshift-ansible-filter-plugins-3.6.173.0.96-1.git.0.2954b4a.el7.noarch
openshift-ansible-playbooks-3.6.173.0.96-1.git.0.2954b4a.el7.noarch
atomic-openshift-utils-3.6.173.0.96-1.git.0.2954b4a.el7.noarch
openshift-ansible-3.6.173.0.96-1.git.0.2954b4a.el7.noarch
atomic-openshift-3.6.173.0.96-1.git.0.8f6ff22.el7.x86_64
openshift-ansible-roles-3.6.173.0.96-1.git.0.2954b4a.el7.noarch
atomic-openshift-master-3.6.173.0.96-1.git.0.8f6ff22.el7.x86_64

Ansible tested with below:
ansible-2.4.2.0-2.el7.noarch
ansible-2.2.3.0-1.el7.noarch


How reproducible:
Repeatable by customer, unconfirmed by support team


Actual results:
TASK [openshift_facts : Gather Cluster facts and set is_containerized if needed] ***
fatal: [y44461.example.net]: FAILED! => {
    "changed": false,
    "failed": true,
    "module_stderr": "Shared connection to y44461.example.net closed.\r\n",
    "module_stdout": "Traceback (most recent call last):\r\n  File \"/tmp/ansible_aVAPjT/ansible_module_openshift_facts.py\", line 2560, in <module>\r\n    main()\r\n  File \"/tmp/ansible_aVAPjT/ansible_module_openshift_facts.py\", line 2547, in main\r\n    protected_facts_to_overwrite)\r\n  File \"/tmp/ansible_aVAPjT/ansible_module_openshift_facts.py\", line 1955, in __init__\r\n    protected_facts_to_overwrite)\r\n  File \"/tmp/ansible_aVAPjT/ansible_module_openshift_facts.py\", line 2013, in generate_facts\r\n    facts = build_kubelet_args(facts)\r\n  File \"/tmp/ansible_aVAPjT/ansible_module_openshift_facts.py\", line 1217, in build_kubelet_args\r\n    labels_str = list(map(lambda x: '='.join(x), facts['node']['labels'].items()))\r\n  File \"/tmp/ansible_aVAPjT/ansible_module_openshift_facts.py\", line 1217, in <lambda>\r\n    labels_str = list(map(lambda x: '='.join(x), facts['node']['labels'].items()))\r\nTypeError: sequence item 1: expected string or Unicode, int found\r\n"
}


Tried new node definition like:
[new_nodes]
y44461.example.net openshift_schedulable=false

and:
[new_nodes]
y44461.example.net openshift_schedulable=false openshift_node_labels="{'region': 'nonproduction', 'zone': 'DK2', 'logging-infra-fluentd': 'true'}"

Comment 3 Steven Walter 2018-03-27 15:30:30 UTC
Might be related? https://github.com/openshift/openshift-ansible/issues/6459

Comment 4 Vadim Rutkovsky 2018-03-28 12:00:30 UTC
Created https://github.com/openshift/openshift-ansible/pull/7687, but not entirely sure if that would resolve it.

Steven, could you attach facts (stored in "/etc/ansible/facts.d" on each node) to this bug so that I could verify the PR would fix it?

Comment 6 Vadim Rutkovsky 2018-04-03 11:55:38 UTC
Right, ' "logging-es-node": 4' on y44461 is breaking it. The PR would fix that

Comment 7 Vadim Rutkovsky 2018-04-12 09:38:18 UTC
Fix is available in openshift-ansible-3.6.173.0.113-1

Comment 8 Gan Huang 2018-04-12 10:48:38 UTC
Can't figure out how the int value "4" come out, looks like no label 'logging-es-node': 4" set in the attached inventory file.

Vadim, any hints to reproduce the bug?

Comment 9 Dmitry Zhukovski 2018-04-12 10:52:43 UTC
Gan - yes - set label 'logging-es-node': 4 in inventory and run once. It will make cached facts on the node.

Vadim - shall create new BZ that ansible should check and not accept such settings in inventory initially ?

Comment 10 Vadim Rutkovsky 2018-04-12 11:06:36 UTC
(In reply to Dmitry Zhukovski from comment #9)
> Gan - yes - set label 'logging-es-node': 4 in inventory and run once. It
> will make cached facts on the node.
> 
> Vadim - shall create new BZ that ansible should check and not accept such
> settings in inventory initially ?

I don't have a clear reproducer for this, unfortunately. One of the machines on customer installation had these facts set (the inventory didn't contain these)

It seems the instructions in https://github.com/openshift/openshift-ansible/issues/6459 would reproduce it

Comment 11 Vadim Rutkovsky 2018-04-12 11:24:23 UTC
(In reply to Dmitry Zhukovski from comment #9)
> Vadim - shall create new BZ that ansible should check and not accept such
> settings in inventory initially ?

There is no simple and generic way to resolve this. 4 might be a valid value for a var in ansible inventory.

This issue would be mitigated once YAML inventory is used instead of INI format. Ansible would complain about the value being invalid before the playbook is run. See https://trello.com/c/pCfMmOae/638-3-document-yaml-based-group-vars

Comment 12 Gan Huang 2018-04-13 05:51:51 UTC
Verified in openshift-ansible-3.6.173.0.113-1.git.0.8a42ef5.el7.noarch.rpm

Installation succeeded with int values set in openshift_node_labels.

openshift_node_labels="{'role': 'node',1: 2}"

Comment 14 errata-xmlrpc 2018-06-28 07:54:52 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-2018:2007


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