Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1422839

Summary: [3.3] Failed to upgrade 3.2 to 3.3 due to undefined variable openshift_master_default_subdomain
Product: OpenShift Container Platform Reporter: liujia <jiajliu>
Component: Cluster Version OperatorAssignee: ewolinet
Status: CLOSED ERRATA QA Contact: Anping Li <anli>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.3.1CC: abutcher, aos-bugs, bleanhar, ewolinet, jiajliu, jokerman, mmccomas
Target Milestone: ---   
Target Release: 3.3.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: The openshift_hosted_metrics role required the 'openshift_master_default_subdomain' fact to be set when evaluating the value for 'openshift_hosted_metrics_public_url' but it wasn't being set correctly. Consequence: The play would fail. Fix: We correctly set the fact 'openshift_master_default_subdomain' prior to setting 'openshift_hosted_metrics_public_url' Result: The play completes successfully without needing to set 'openshift_master_default_subdomain' in the inventory file.
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-04-05 08:53:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description liujia 2017-02-16 11:31:52 UTC
Description of problem:
Trigger upgrade from 3.2 to 3.2, upgrade failed and exit at task [openshift_master_facts : Set master facts]:

fatal: [openshift-149.x.x.x]: FAILED! => {
    "failed": true
}

MSG:

the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: {{ openshift_hosted_metrics_public_url | default('hawkular-metrics.' ~ (openshift.master.default_subdomain | default(openshift_master_default_subdomain ))) | oo_hostname_from_url }}: 'openshift_master_default_subdomain' is undefined

The error appears to have been in '/usr/share/ansible/openshift-ansible/roles/openshift_master_facts/tasks/main.yml': line 2, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

---
- name: Set master facts
  ^ here


Version-Release number of selected component (if applicable):
atomic-openshift-utils-3.3.64-1.git.0.43bfb06.el7.noarch

How reproducible:
always

Steps to Reproduce:
1.install latest ocp3.2
2.upgrade 3.2 to 3.2
# ansible-playbook -i /tmp/hosts /usr/share/ansible/openshift-ansible/playbooks/byo/openshift-cluster/upgrades/v3_3/upgrade.yml 
3.

Actual results:
Upgrade failed.

Expected results:
Upgrade successfully.

Additional info:

Comment 2 liujia 2017-02-16 11:34:26 UTC
workaround:

add "openshift_master_default_subdomain=None" in the hosts file.

Comment 3 Brenton Leanhardt 2017-02-22 20:23:53 UTC
Andrew, does the default for openshift_master_default_subdomain from https://github.com/openshift/openshift-ansible/pull/2450 need to be backported?

I know the description says upgrading from 3.2 to 3.2 bug I'm assuming it meant 3.2 to 3.3 since QE set the version to 3.3.1.

Comment 4 Andrew Butcher 2017-02-22 20:26:22 UTC
Brenton, that change would not impact upgrade but the fix may be similar.

Comment 5 ewolinet 2017-02-24 16:48:25 UTC
I'm unable to recreate this. Can you confirm that you're going from a 3.2 OCP installation to a 3.3 using the release specified above?

Is the host file you pasted accurate in that you aren't also trying to install openshift_hosted_metrics?

Comment 6 liujia 2017-02-27 05:13:52 UTC
@ewolinet
I meant to upgrade ocp3.2 to ocp3.3, just using above pasted inventory file in comment1. 

I can re-produce it again use above inventory file.

Rpm install OCP3.2.
Prepare 3.3 repo.
Run upgrade playbook.

atomic-openshift-utils-3.3.64-1.git.0.43bfb06.el7.noarch

Comment 7 Scott Dodson 2017-02-27 16:59:46 UTC
Can you please get me the contents of /etc/ansible/facts.d/openshift.fact after installing 3.2 and after the upgrade to 3.3 fails?

Also, you're 100% certain that openshift_hosted_metrics_deploy is not set to true in your inventories either pre-upgrade or during?

Comment 16 liujia 2017-03-06 06:28:33 UTC
Version:
atomic-openshift-utils-3.3.68-1.git.0.3792453.el7.noarch

Steps:
1. Install ocp3.2
2. Upgrade 3.2 to 3.3

Result:
Upgrade successfully.

Change bug status to verify.

Comment 18 errata-xmlrpc 2017-04-05 08:53:11 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-2017:0883