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

Bug 1947164

Summary: Print "Successfully pushed" even if the build push fails.
Product: OpenShift Container Platform Reporter: Vinu K <vkochuku>
Component: BuildAssignee: Adam Kaplan <adam.kaplan>
Status: CLOSED ERRATA QA Contact: XiuJuan Wang <xiuwang>
Severity: low Docs Contact: Srivaralakshmi Ramani <srr>
Priority: unspecified    
Version: 4.7CC: adam.kaplan, aos-bugs
Target Milestone: ---   
Target Release: 4.8.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Previously, builds did not perform an error check to see if an image push had failed. As a result, builds always logged the `Successfully pushed` message. Now, builds check if an error has occurred, and only log the `Successfully pushed` message after an image push has succeeded.
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-07-27 22:57:59 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 Vinu K 2021-04-07 19:50:01 UTC
Description of problem:
The build push prints a "Successfully pushed" message even if the actual image push fails.

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

How reproducible:
Easy

Steps to Reproduce:

---
$ oc patch configs.imageregistry.operator.openshift.io/cluster --patch '{"spec":{"managementState":"Managed"}}' --type=merge

$ oc new-project foo

$ cat < EOF | oc create -f -
apiVersion: image.openshift.io/v1
kind: ImageStream
metadata:
  name: busybox
---
apiVersion: v1
kind: BuildConfig
metadata:
  name: busybox
spec:
  output:
    to:
      kind: ImageStreamTag
      name: busybox:latest
  source:
    type: Dockerfile
    dockerfile: |-
      FROM k8s.gcr.io/busybox
      ENTRYPOINT ["sleep", "6000"]
  strategy:
    dockerStrategy:
      from:
        kind: DockerImage
        name: k8s.gcr.io/busybox
    type: Docker
  triggers:
  - imageChange: {}
    type: ImageChange
EOF

$ oc start-build busybox --wait=true --follow=true
---

Actual results:
The output print a "Successfully pushed" message even if the image push fails.

---
Pushing image image-registry.openshift-image-registry.svc:5000/foo/busybox:latest ...
Getting image source signatures
Successfully pushed image-registry.openshift-image-registry.svc:5000/foo/busybox:latest
Warning: Push failed, retrying in 5s ...
Getting image source signatures
Successfully pushed image-registry.openshift-image-registry.svc:5000/foo/busybox:latest
Warning: Push failed, retrying in 5s ...
Getting image source signatures
Successfully pushed image-registry.openshift-image-registry.svc:5000/foo/busybox:latest
Warning: Push failed, retrying in 5s ...
error: build error: Failed to push image: error copying layers and metadata from "containers-storage:[overlay@/var/lib/containers/storage+/var/run/containers/storage:overlay.imagestore=/var/lib/shared]image-registry.openshift-image-registry.svc:5000/foo/busybox:latest" to "docker://image-registry.openshift-image-registry.svc:5000/foo/busybox:latest": Error trying to reuse blob sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4 at destination: error pinging docker registry image-registry.openshift-image-registry.svc:5000: Get "https://image-registry.openshift-image-registry.svc:5000/v2/": dial tcp: lookup image-registry.openshift-image-registry.svc on 172.30.0.10:53: no such host
---

Expected results:
It should not print a "Successfully pushed" message.

Additional info:

Comment 2 XiuJuan Wang 2021-04-12 03:34:47 UTC
No 'Successfully pushed' message shown when image push failed.

Writing manifest to image destination
Storing signatures
--> d5b6e2ad097
d5b6e2ad097090fe73fe25e5b6d8e427331e3c3021fddc6911d6bb3fa7332ff5

Pushing image image-registry.openshift-image-registry.svc:5000/xiuwang/ruby-hello-world:latest ...
Getting image source signatures
Warning: Push failed, retrying in 5s ...
Getting image source signatures
Warning: Push failed, retrying in 5s ...
Getting image source signatures
Warning: Push failed, retrying in 5s ...
Registry server Address: 
Registry server User Name: serviceaccount
Registry server Email: serviceaccount
Registry server Password: <<non-empty>>
error: build error: Failed to push image: error copying layers and metadata from "containers-storage:[overlay@/var/lib/containers/storage+/var/run/containers/storage:overlay.imagestore=/var/lib/shared]image-registry.openshift-image-registry.svc:5000/xiuwang/ruby-hello-world:latest" to "docker://image-registry.openshift-image-registry.svc:5000/xiuwang/ruby-hello-world:latest": Error trying to reuse blob sha256:b77f42d650dc7d0d6fa21f8661f03957cfe70fcf92e48245d2a7cad7d795eb56 at destination: error pinging docker registry image-registry.openshift-image-registry.svc:5000: Get "https://image-registry.openshift-image-registry.svc:5000/v2/": dial tcp 172.30.60.102:5000: connect: connection refused

Comment 10 errata-xmlrpc 2021-07-27 22:57:59 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 (Moderate: OpenShift Container Platform 4.8.2 bug fix and security update), 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-2021:2438