Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1430708

Summary: atomic pull pulls the same image over and over again
Product: Red Hat Enterprise Linux 7 Reporter: Marko Myllynen <myllynen>
Component: atomicAssignee: Brent Baude <bbaude>
Status: CLOSED ERRATA QA Contact: atomic-bugs <atomic-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.3CC: ajia, amurdaca, bbaude, ddarrah, dwalsh, fkluknav, miabbott
Target Milestone: rcKeywords: Extras
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-05-26 14:29:02 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 Marko Myllynen 2017-03-09 11:38:43 UTC
Description of problem:
The following should download the needed images only once, not three times:

for i in 1 2 3 ; do atomic pull rhel7/etcd ; done

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

Comment 2 Alex Jia 2017-03-10 06:22:48 UTC
(In reply to Marko Myllynen from comment #0)
> Description of problem:
> The following should download the needed images only once, not three times:
> 
> for i in 1 2 3 ; do atomic pull rhel7/etcd ; done
> 
> Version-Release number of selected component (if applicable):
> 7.3.2

This has been fixed in 7.3.3.

[root@atomic-host-test-986 cloud-user]# atomic host status
State: idle
Deployments:
● Atomic-7.3-20170221.0:rhel-atomic-host/7/x86_64/standard
       Version: 7.3.3 (2017-02-21 19:19:03)
        Commit: 1113d4385d7edf7b13e48cc5c09c73ba03d293f1f73b948784a63a6beee95b46
        OSName: rhel-atomic-host

  rhel-atomic-host-ostree:rhel-atomic-host/7/x86_64/standard
       Version: 7.3.2 (2017-01-13 22:00:41)
        Commit: 96826a0d917d7ff10f9fd0289581649f2ffbddd76f3b80efd3d95cc11915cacb
        OSName: rhel-atomic-host

[root@atomic-host-test-986 cloud-user]# for i in 1 2 3 ; do atomic pull rhel7/etcd ; done
Pulling registry.access.redhat.com/rhel7/etcd:latest ...
Copying blob sha256:154dc369ca0dfabd18ddeca63a8bced0dfaefaa0b2cd7cb6ec9513423d863652
 68.80 MB / ? [-------------------------------------=-------------------------] 
Copying blob sha256:e6b5b6e3c1421d338b32d3c2f9fac2ab424f35857e8c89d6133b8d54f5cdad49
 0 B / ? [--------------------------------------------------------------------=]
Copying blob sha256:5319107e42d50b0870eaabfd20d95e2ddbf4a06fe6f2b462d1b0f2d83ef4cf5f
 11.97 MB / ? [---------------------------------------------------------------=]
Copying config sha256:77edbd3745c704b3c658939f3ece96b1a496535ce3b58060e3a42eb79370a7e6
 0 B / 5.89 KB [---------------------------------------------------------------]
Writing manifest to image destination
Storing signatures
 5.89 KB / 5.89 KB [===========================================================]Failed: Latest version of rhel7/etcd already present.
Failed: Latest version of rhel7/etcd already present.

Comment 3 Marko Myllynen 2017-03-10 06:32:07 UTC
(In reply to Alex Jia from comment #2)
> 
> This has been fixed in 7.3.3.

This is good news.

> [===========================================================]Failed: Latest
> version of rhel7/etcd already present.
> Failed: Latest version of rhel7/etcd already present.

I don't think this is ideal, what was the exit status? The pull operation end result was exactly what was wanted as the image is now available locally, at least exit status should be 0.

Thanks.

Comment 4 Alex Jia 2017-03-10 07:24:29 UTC
(In reply to Marko Myllynen from comment #3)
> (In reply to Alex Jia from comment #2)
> > 
> > This has been fixed in 7.3.3.
> 
> This is good news.
> 
> > [===========================================================]Failed: Latest
> > version of rhel7/etcd already present.
> > Failed: Latest version of rhel7/etcd already present.
> 
> I don't think this is ideal, what was the exit status? The pull operation
> end result was exactly what was wanted as the image is now available
> locally, at least exit status should be 0.
> 
> Thanks.

Yes, you're right, we can deal w/ the result as a info rather than error message, and then the exit code should be 0.

Comment 5 Brent Baude 2017-05-03 13:56:38 UTC
This is skopeo; adding in Antonio.

Comment 6 Micah Abbott 2017-05-03 14:39:46 UTC
I don't think this is actually 'skopeo' causing the exit 1.

If I use the example 'for' loop and enable debugging on the 'atomic' command, we can see the exception from 'atomic':


# for i in 1 2 3; do atomic --debug pull registry.access.redhat.com/rhel7/etcd; done                                                                                                  
Namespace(_class=<class 'Atomic.pull.Pull'>, assumeyes=False, debug=True, func='pull_image', image='registry.access.redhat.com/rhel7/etcd', reg_type=None, storage=None)
Pulling registry.access.redhat.com/rhel7/etcd:latest ...
Executing: /usr/bin/skopeo --policy=/etc/containers/policy.json --debug copy --remove-signatures docker://registry.access.redhat.com/rhel7/etcd:latest docker-daemon:registry.access.redhat.com/rhel7/etcd:latest
DEBU[0000] Using registries.d directory /etc/containers/registries.d for sigstore configuration 
DEBU[0000]  Using "default-docker" configuration        
DEBU[0000]  No signature storage configuration found for registry.access.redhat.com/rhel7/etcd:latest 
DEBU[0000] IsRunningImageAllowed for image docker:registry.access.redhat.com/rhel7/etcd:latest 
DEBU[0000]  Using default policy section                
DEBU[0000]  Requirement 0: allowed                      
DEBU[0000] Overall: allowed                             
DEBU[0000] GET https://registry.access.redhat.com/v2/   
DEBU[0000] Ping https://registry.access.redhat.com/v2/ err <nil> 
DEBU[0000] Ping https://registry.access.redhat.com/v2/ status 200 
DEBU[0000] GET https://registry.access.redhat.com/v2/rhel7/etcd/manifests/latest 
DEBU[0001] Will convert manifest from MIME type text/plain to application/vnd.docker.distribution.manifest.v2+json 
Copying blob sha256:8642dd241e54ecb57f49345f135e9bcedb0546e7e61c1ca4d0008a9925f50444
DEBU[0001] Downloading rhel7/etcd/blobs/sha256:8642dd241e54ecb57f49345f135e9bcedb0546e7e61c1ca4d0008a9925f50444 
DEBU[0001] GET https://registry.access.redhat.com/v2/rhel7/etcd/blobs/sha256:8642dd241e54ecb57f49345f135e9bcedb0546e7e61c1ca4d0008a9925f50444 
DEBU[0003] Detected compression format gzip             
 0 B / ? [--------------------------------------------------------------------=]DEBU[0003] Using original blob without modification     
DEBU[0003] docker-daemon: input with unknown size, streaming to disk first… 
 68.50 MB / ? [---------------------------------------------------------------=]DEBU[0037] … streaming done                             
DEBU[0037] Sending as tar file sha256:8642dd241e54ecb57f49345f135e9bcedb0546e7e61c1ca4d0008a9925f50444 
 68.78 MB / ? [=--------------------------------------------------------------] DEBU[0038] Consuming rest of the original blob to satisfy getOriginalLayerCopyWriter 

DEBU[0038] Computed DiffID sha256:43818193b2cfcb8e206fc8fdf783205f2a85685726767b8e61444075bb306673 for layer sha256:8642dd241e54ecb57f49345f135e9bcedb0546e7e61c1ca4d0008a9925f50444 
Copying blob sha256:fdd633d880f736958e14a036256b2def325acf6b438b7c849139fe92d5cbe4ce
DEBU[0038] Downloading rhel7/etcd/blobs/sha256:fdd633d880f736958e14a036256b2def325acf6b438b7c849139fe92d5cbe4ce 
DEBU[0038] GET https://registry.access.redhat.com/v2/rhel7/etcd/blobs/sha256:fdd633d880f736958e14a036256b2def325acf6b438b7c849139fe92d5cbe4ce 
DEBU[0038] Detected compression format gzip             
 0 B / ? [--------------------------------------------------------------------=]DEBU[0038] Using original blob without modification     
DEBU[0038] docker-daemon: input with unknown size, streaming to disk first… 
DEBU[0038] … streaming done                             
DEBU[0038] Sending as tar file sha256:fdd633d880f736958e14a036256b2def325acf6b438b7c849139fe92d5cbe4ce 
DEBU[0038] Consuming rest of the original blob to satisfy getOriginalLayerCopyWriter 

DEBU[0038] Computed DiffID sha256:1bc67546e0dbcf7156ffee1e70f03f04772d2974d35b7d2465fadd8c397c885e for layer sha256:fdd633d880f736958e14a036256b2def325acf6b438b7c849139fe92d5cbe4ce 
Copying blob sha256:db73ed6ba9b5c57d5e9aff06af00088df5137119e6f004be6936dab16301c222
DEBU[0038] Downloading rhel7/etcd/blobs/sha256:db73ed6ba9b5c57d5e9aff06af00088df5137119e6f004be6936dab16301c222 
DEBU[0038] GET https://registry.access.redhat.com/v2/rhel7/etcd/blobs/sha256:db73ed6ba9b5c57d5e9aff06af00088df5137119e6f004be6936dab16301c222 
 1.16 KB / ? [---------------------------------------------=------------------] DEBU[0038] Detected compression format gzip             
 0 B / ? [--------------------------------------------------------------------=]DEBU[0038] Using original blob without modification     
DEBU[0038] docker-daemon: input with unknown size, streaming to disk first… 
 10.53 MB / ? [---------------------------------------------------------------=]DEBU[0040] … streaming done                             
DEBU[0040] Sending as tar file sha256:db73ed6ba9b5c57d5e9aff06af00088df5137119e6f004be6936dab16301c222 
 12.05 MB / ? [-------------------------------------------=-------------------] DEBU[0040] Consuming rest of the original blob to satisfy getOriginalLayerCopyWriter 

DEBU[0040] Computed DiffID sha256:fc21c9d0c25e1588d9270dadc089a449743ecaf40e13833d38421842c03775a8 for layer sha256:db73ed6ba9b5c57d5e9aff06af00088df5137119e6f004be6936dab16301c222 
Copying config sha256:a58e48861e7400237e9ef7215f4ba99a3c39e8027a63f3788970d0b1949e929f
DEBU[0040] No compression detected                      
 0 B / 5.74 KB [---------------------------------------------------------------]DEBU[0040] Using original blob without modification     
DEBU[0040] Sending as tar file sha256:a58e48861e7400237e9ef7215f4ba99a3c39e8027a63f3788970d0b1949e929f 

Writing manifest to image destination
DEBU[0040] Sending as tar file manifest.json            
Storing signatures
DEBU[0040] docker-daemon: Closing tar stream            
DEBU[0040] docker-daemon: Waiting for status            
 5.74 KB / 5.74 KB [===========================================================]DEBU[0046] docker-daemon: sending done, status <nil>    
Namespace(_class=<class 'Atomic.pull.Pull'>, assumeyes=False, debug=True, func='pull_image', image='registry.access.redhat.com/rhel7/etcd', reg_type=None, storage=None)
Failed: Latest version of registry.access.redhat.com/rhel7/etcd already present.
Traceback (most recent call last):
  File "/bin/atomic", line 189, in <module>
    sys.exit(_func())
  File "/usr/lib/python2.7/site-packages/Atomic/pull.py", line 55, in pull_image
    raise ValueError("Failed: {}".format(e))
ValueError: Failed: Latest version of registry.access.redhat.com/rhel7/etcd already present.
Namespace(_class=<class 'Atomic.pull.Pull'>, assumeyes=False, debug=True, func='pull_image', image='registry.access.redhat.com/rhel7/etcd', reg_type=None, storage=None)
Failed: Latest version of registry.access.redhat.com/rhel7/etcd already present.
Traceback (most recent call last):
  File "/bin/atomic", line 189, in <module>
    sys.exit(_func())
  File "/usr/lib/python2.7/site-packages/Atomic/pull.py", line 55, in pull_image
    raise ValueError("Failed: {}".format(e))
ValueError: Failed: Latest version of registry.access.redhat.com/rhel7/etcd already present.
# echo $?
1


Additionally, if I use 'skopeo' to pull the already present image, it will happily do so and exit 0.


# atomic images list
   REPOSITORY                              TAG      IMAGE ID       CREATED            VIRTUAL SIZE   TYPE      
   registry.access.redhat.com/rhel7/etcd   latest   a58e48861e74   2017-04-24 13:35   233.32 MB      docker    

# /usr/bin/skopeo --policy=/etc/containers/policy.json --debug copy --remove-signatures docker://registry.access.redhat.com/rhel7/etcd:latest docker-daemon:registry.access.redhat.com
/rhel7/etcd:latest
DEBU[0000] Using registries.d directory /etc/containers/registries.d for sigstore configuration 
DEBU[0000]  Using "default-docker" configuration        
DEBU[0000]  No signature storage configuration found for registry.access.redhat.com/rhel7/etcd:latest 
DEBU[0000] IsRunningImageAllowed for image docker:registry.access.redhat.com/rhel7/etcd:latest 
DEBU[0000]  Using default policy section                
DEBU[0000]  Requirement 0: allowed                      
DEBU[0000] Overall: allowed                             
DEBU[0000] GET https://registry.access.redhat.com/v2/   
DEBU[0000] Ping https://registry.access.redhat.com/v2/ err <nil> 
DEBU[0000] Ping https://registry.access.redhat.com/v2/ status 200 
DEBU[0000] GET https://registry.access.redhat.com/v2/rhel7/etcd/manifests/latest 
DEBU[0001] Will convert manifest from MIME type text/plain to application/vnd.docker.distribution.manifest.v2+json 
Copying blob sha256:8642dd241e54ecb57f49345f135e9bcedb0546e7e61c1ca4d0008a9925f50444
DEBU[0001] Downloading rhel7/etcd/blobs/sha256:8642dd241e54ecb57f49345f135e9bcedb0546e7e61c1ca4d0008a9925f50444 
DEBU[0001] GET https://registry.access.redhat.com/v2/rhel7/etcd/blobs/sha256:8642dd241e54ecb57f49345f135e9bcedb0546e7e61c1ca4d0008a9925f50444 
DEBU[0001] Detected compression format gzip             
 0 B / ? [--------------------------------------------------------------------=]DEBU[0001] Using original blob without modification     
DEBU[0001] docker-daemon: input with unknown size, streaming to disk first… 
 67.75 MB / ? [---------------------------------------------------------------=]DEBU[0016] … streaming done                             
DEBU[0016] Sending as tar file sha256:8642dd241e54ecb57f49345f135e9bcedb0546e7e61c1ca4d0008a9925f50444 
 68.78 MB / ? [=--------------------------------------------------------------] DEBU[0016] Consuming rest of the original blob to satisfy getOriginalLayerCopyWriter 

DEBU[0016] Computed DiffID sha256:43818193b2cfcb8e206fc8fdf783205f2a85685726767b8e61444075bb306673 for layer sha256:8642dd241e54ecb57f49345f135e9bcedb0546e7e61c1ca4d0008a9925f50444 
Copying blob sha256:fdd633d880f736958e14a036256b2def325acf6b438b7c849139fe92d5cbe4ce
DEBU[0016] Downloading rhel7/etcd/blobs/sha256:fdd633d880f736958e14a036256b2def325acf6b438b7c849139fe92d5cbe4ce 
DEBU[0016] GET https://registry.access.redhat.com/v2/rhel7/etcd/blobs/sha256:fdd633d880f736958e14a036256b2def325acf6b438b7c849139fe92d5cbe4ce 
DEBU[0017] Detected compression format gzip             
 0 B / ? [--------------------------------------------------------------------=]DEBU[0017] Using original blob without modification     
DEBU[0017] docker-daemon: input with unknown size, streaming to disk first… 
DEBU[0017] … streaming done                             
DEBU[0017] Sending as tar file sha256:fdd633d880f736958e14a036256b2def325acf6b438b7c849139fe92d5cbe4ce 
DEBU[0017] Consuming rest of the original blob to satisfy getOriginalLayerCopyWriter 

DEBU[0017] Computed DiffID sha256:1bc67546e0dbcf7156ffee1e70f03f04772d2974d35b7d2465fadd8c397c885e for layer sha256:fdd633d880f736958e14a036256b2def325acf6b438b7c849139fe92d5cbe4ce 
Copying blob sha256:db73ed6ba9b5c57d5e9aff06af00088df5137119e6f004be6936dab16301c222
DEBU[0017] Downloading rhel7/etcd/blobs/sha256:db73ed6ba9b5c57d5e9aff06af00088df5137119e6f004be6936dab16301c222 
DEBU[0017] GET https://registry.access.redhat.com/v2/rhel7/etcd/blobs/sha256:db73ed6ba9b5c57d5e9aff06af00088df5137119e6f004be6936dab16301c222 
 1.16 KB / ? [---------------------------------------------=------------------] DEBU[0018] Detected compression format gzip             
 0 B / ? [--------------------------------------------------------------------=]DEBU[0018] Using original blob without modification     
DEBU[0018] docker-daemon: input with unknown size, streaming to disk first… 
 10.78 MB / ? [---------------------------------------------------------------=]DEBU[0021] … streaming done                             
DEBU[0021] Sending as tar file sha256:db73ed6ba9b5c57d5e9aff06af00088df5137119e6f004be6936dab16301c222 
 12.05 MB / ? [-------------------------------------------=-------------------] DEBU[0021] Consuming rest of the original blob to satisfy getOriginalLayerCopyWriter 


DEBU[0021] Computed DiffID sha256:fc21c9d0c25e1588d9270dadc089a449743ecaf40e13833d38421842c03775a8 for layer sha256:db73ed6ba9b5c57d5e9aff06af00088df5137119e6f004be6936dab16301c222 
Copying config sha256:a58e48861e7400237e9ef7215f4ba99a3c39e8027a63f3788970d0b1949e929f
DEBU[0021] No compression detected                      
 0 B / 5.74 KB [---------------------------------------------------------------]DEBU[0021] Using original blob without modification     
DEBU[0021] Sending as tar file sha256:a58e48861e7400237e9ef7215f4ba99a3c39e8027a63f3788970d0b1949e929f 

Writing manifest to image destination
DEBU[0021] Sending as tar file manifest.json            
Storing signatures
DEBU[0021] docker-daemon: Closing tar stream            
DEBU[0021] docker-daemon: Waiting for status            
DEBU[0021] docker-daemon: sending done, status <nil>    
# echo $?
0
# atomic images list
   REPOSITORY                              TAG      IMAGE ID       CREATED            VIRTUAL SIZE   TYPE      
   registry.access.redhat.com/rhel7/etcd   latest   a58e48861e74   2017-04-24 13:35   233.32 MB      docker

Comment 7 Brent Baude 2017-05-08 19:57:02 UTC
Added to PR -> https://github.com/projectatomic/atomic/pull/997

Comment 9 Alex Jia 2017-05-17 11:40:10 UTC
The exit code is 0 and got expected error "The latest version of image registry.access.redhat.com/rhel7/etcd already exists." in atomic-1.17.2-2.git2760e30.el7.x86_64.

Comment 11 errata-xmlrpc 2017-05-26 14:29:02 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:1323