Bug 1613979 - oc replace imagestream causes errors with syncing with the imagestream_controller.
Summary: oc replace imagestream causes errors with syncing with the imagestream_contro...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Image
Version: 3.9.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 3.11.0
Assignee: Ben Parees
QA Contact: XiuJuan Wang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-08-08 17:02 UTC by Ryan Howe
Modified: 2019-02-15 16:28 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Improper handling of empty imagestream updates. Consequence: Previously updates to an imagestream that did not result in a change in tags resulted in a request to the image import api that included no content to be imported, which is invalid and lead to errors in the controller. Fix: Updates to the imagestream that result in no new/updated tags that need to be imported will not result in an import api call. Result: No invalid request is sent to the import api and no errors occur in the controller.
Clone Of:
Environment:
Last Closed: 2018-10-11 07:24:08 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:2652 None None None 2018-10-11 07:24:26 UTC

Description Ryan Howe 2018-08-08 17:02:11 UTC
Description of problem:

When running `oc replace` on imagestreams we get error: 
  

magestream_controller.go:127] Error syncing image stream "openshift/jenkins": ImageStreamImport "jenkins" is invalid: spec.images: Invalid value: "null": you must specify at least one image or a repository import

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

How reproducible:
100%

Steps to Reproduce:
1. Installer will create the imagestreams, or it can be done manually. 
oc create -f  /usr/share/ansible/openshift-ansible/roles/openshift_examples/files/examples/v3.9/image-streams/image-streams-rhel7.json -n openshift


2. oc replace -f  /usr/share/ansible/openshift-ansible/roles/openshift_examples/files/examples/v3.9/image-streams/image-streams-rhel7.json -n openshift



Actual results:

# journalctl -u atomic-openshift-master-controllers | grep imagestream_controller

Error logs on all replaced imagestreams:

 imagestream_controller.go:127] Error syncing image stream "openshift/jenkins": ImageStreamImport "jenkins" is invalid: spec.images: Invalid value: "null": you must specify at least one image or a repository import


Expected results:

For the replace to work and the controller to not error trying to import these. 


Additional info:

Error message is generated here:
https://github.com/openshift/origin/blob/master/pkg/image/controller/imagestream_controller.go#L133


Workaround to replace these involves deleting and adding back to update based on the latest examples. 

# oc create -f  /usr/share/ansible/openshift-ansible/roles/openshift_examples/files/examples/v3.9/image-streams/image-streams-rhel7.json -n openshift

# oc delete -f  /usr/share/ansible/openshift-ansible/roles/openshift_examples/files/examples/v3.9/image-streams/image-streams-rhel7.json -n openshift


The automated installer only runs `oc create` so we never hit this issue unless one run `oc replace`

Comment 1 Scott Worthington 2018-08-08 20:00:19 UTC
> Workaround to replace these involves deleting and adding back to update
> based on the latest examples. 
> 
> # oc create -f 
> /usr/share/ansible/openshift-ansible/roles/openshift_examples/files/examples/
> v3.9/image-streams/image-streams-rhel7.json -n openshift
> 
> # oc delete -f 
> /usr/share/ansible/openshift-ansible/roles/openshift_examples/files/examples/
> v3.9/image-streams/image-streams-rhel7.json -n openshift

> 
> The automated installer only runs `oc create` so we never hit this issue
> unless one run `oc replace`

Exchanging the order:

# oc delete -f 
/usr/share/ansible/openshift-ansible/roles/openshift_examples/files/examples/v3.9/image-streams/image-streams-rhel7.json -n openshift

# oc create -f 
/usr/share/ansible/openshift-ansible/roles/openshift_examples/files/examples/v3.9/image-streams/image-streams-rhel7.json -n openshift

Comment 2 Maciej Szulik 2018-08-13 10:08:25 UTC
I've checked the `oc replace` part, and this is not causing any problems. The images before and after `oc replace` are identical, so it's definitely a problem in the controller logic, which creates empty ImageStreamImports, which are then consumed by the controller which complains. I think we can safely ignore empty ISI.

Comment 3 Ben Parees 2018-08-13 17:45:22 UTC
https://github.com/openshift/origin/pull/20623

Comment 5 XiuJuan Wang 2018-08-23 08:55:35 UTC
Can't reproduce this bug with ocp v3.11.0-0.20.0

Comment 7 errata-xmlrpc 2018-10-11 07:24: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/RHBA-2018:2652


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