Bug 1264765

Summary: Upgrade failed if some imagesteam/template doesn't exist
Product: OpenShift Container Platform Reporter: Anping Li <anli>
Component: Cluster Version OperatorAssignee: Scott Dodson <sdodson>
Status: CLOSED ERRATA QA Contact: Anping Li <anli>
Severity: medium Docs Contact:
Priority: high    
Version: 3.0.0CC: aos-bugs, bleanhar, jokerman, mmccomas, sdodson
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-19 23:29:08 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 Anping Li 2015-09-21 07:19:18 UTC
Description of problem:

The upgrade failed if some imagestream/template doesn't exist.  Message like 'Error from server: imageStream "jenkins" not found'  was reported.

some imagestream/template may not be installed in v3.0.1. for example jenkins imagestream isn't provided by default.  Custom may also drop some imagestreams or templates. It is better to print warning message rather than abort here.

The upgrade also shouldn't use the DEPRECATED 'oc update'.

Version-Release number of selected component (if applicable):
v3.0.1.0 to v3.0.2.0

How reproducible:
Always

Steps to Reproduce:
1. install openshift v3.0.1
2. run upgrade via ansible
   ansible-playbook openshift-ansible/playbooks/adhoc/upgrades/upgrade.yml

Actual Result:
1) Upgrade abort 'Error from server: imageStream "jenkins" not found'
2) Upgrade use DEPRECATED 'oc update.

TASK: [openshift_examples | Import RHEL streams] ****************************** 
failed: [192.168.1.101] => {"changed": false, "cmd": ["oc", "update", "-n", "openshift", "-f", "/usr/share/openshift/examples/image-streams/image-streams-rhel7.json"], "delta": "0:00:00.981375", "end": "2015-09-21 13:03:15.316542", "failed": true, "failed_when_result": true, "rc": 1, "start": "2015-09-21 13:03:14.335167", "stdout_lines": ["imagestreams/ruby", "imagestreams/nodejs", "imagestreams/perl", "imagestreams/php", "imagestreams/python", "imagestreams/mysql", "imagestreams/postgresql", "imagestreams/mongodb"], "warnings": []}
stderr: W0921 13:03:14.386785    7877 cmd.go:149] update is DEPRECATED and will be removed in a future version. Use replace instead.
Error from server: imageStream "jenkins" not found
stdout: imagestreams/ruby
imagestreams/nodejs
imagestreams/perl
imagestreams/php
imagestreams/python
imagestreams/mysql
imagestreams/postgresql
imagestreams/mongodb

FATAL: all hosts have already failed -- aborting

Expected Result:

1) Upgrade doesn't abort for 'non-block' issue.
2) Upgrade install the 'non-existing imagestreams/template' or skip it.
3) Upgrade use 'oc replace **' instead of 'oc update'

Comment 1 Scott Dodson 2015-09-21 16:51:12 UTC
I've switched to oc replace, please pull the latest code and re-test, thanks.

Comment 2 Anping Li 2015-09-22 03:32:59 UTC
I can saw the 'oc replace' after pull the latest code.

How about the template/imagestream replace issue.
There are no jenkins imagestream in a prior /usr/share/openshift/examples/image-streams/image-streams-rhel7.json. so there is the strong possibility that the customer hit "Error from server: imageStream "jenkins" not found". 

Could we fix it?

Comment 3 Anping Li 2015-09-22 06:50:19 UTC
I think the sequence for 'replace imagestream/template' is illogical. it is better to replace them after package was upgraded. How do you think about that?

Comment 4 Scott Dodson 2015-09-22 15:34:30 UTC
Thanks, I've changed it such that it runs the normal install to create them later runs the update command. This should avoid the issue you're seeing while ensuring that newly created image streams are installed. Please pull the latest and give it another test.

Thanks

Comment 5 Anping Li 2015-09-23 02:45:51 UTC
The 'update is/template' work fine, no error was reported now.

Comment 7 errata-xmlrpc 2015-11-19 23:29:08 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/RHEA-2015:2492