Bug 1377922

Summary: AttributeError: 'tuple' object has no attribute 'out_content_checksum'
Product: Red Hat Enterprise Linux 7 Reporter: Alex Jia <ajia>
Component: atomicAssignee: Brent Baude <bbaude>
Status: CLOSED ERRATA QA Contact: atomic-bugs <atomic-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 7.4CC: ajia, dwalsh, walters
Target Milestone: rcKeywords: Extras
Target Release: ---   
Hardware: x86_64   
OS: Linux   
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:28:17 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:

Description Alex Jia 2016-09-21 03:27:46 UTC
Description of problem:
I got an error like "AttributeError 'tuple' object has no attribute 'out_content_checksum'" when I used atomic verify command w/ -v/--verbose options in debug mode.

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

# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 7.2 (Maipo)

# rpm -q atomic docker skopeo
atomic-1.12.3-2.el7.x86_64
docker-1.10.3-55.el7.x86_64
skopeo-0.1.14-0.6.el7.x86_64


How reproducible:
always

Steps to Reproduce:
1. docker pull busybox
2. atomic --debug verify -v busybox


Actual results:

# atomic --debug verify -v busybox
/usr/bin/atomic --debug verify -v busybox: too few arguments
Try '/usr/bin/atomic --debug verify -v busybox --help' for more information.
Traceback (most recent call last):
  File "/usr/bin/atomic", line 186, in <module>
    sys.exit(_func())
  File "/usr/lib/python2.7/site-packages/Atomic/verify.py", line 104, in verify
    return self.verify_system_image()
  File "/usr/lib/python2.7/site-packages/Atomic/verify.py", line 42, in verify_system_image
    self.validate_system_image_manifests(layers)
  File "/usr/lib/python2.7/site-packages/Atomic/verify.py", line 384, in validate_system_image_manifests
    mismatches = self.syscontainers.validate_layer(layer)
  File "/usr/lib/python2.7/site-packages/Atomic/syscontainers.py", line 1079, in validate_layer
    traverse(it)
  File "/usr/lib/python2.7/site-packages/Atomic/syscontainers.py", line 1059, in traverse
    dir_checksum = it.get_dir().out_content_checksum
AttributeError: 'tuple' object has no attribute 'out_content_checksum'


Expected results:


Additional info:

it's okay to append --no-validate option to above CLI.

# atomic --debug verify -v --no-validate busybox

busybox contains the following images:

     Local Version                                                                       Latest Version                                                                       
     -------------                                                                       --------------                                                                       
     busybox (sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4)   busybox (sha256:8ddc19f16526912237dd8af81971d5e4dd0587907234be2b83e249518d5b673f)   *
     busybox (sha256:8ddc19f16526912237dd8af81971d5e4dd0587907234be2b83e249518d5b673f)   busybox (None)                                                                      *

     * = version difference

Comment 2 Brent Baude 2016-10-18 19:44:23 UTC
This should be fixed upstream with https://github.com/projectatomic/atomic/pull/714 when I can get it to pass tests.

Comment 3 Alex Jia 2016-10-19 07:22:15 UTC
(In reply to Brent Baude from comment #2)
> This should be fixed upstream with
> https://github.com/projectatomic/atomic/pull/714 when I can get it to pass
> tests.

It doesn't work for me, it seems we need to build a new ostree RPM pacakge.

# rpm -q atomic skopeo docker
atomic-1.13.1-1.el7.x86_64
skopeo-0.1.17-0.4.git550a480.el7.x86_64
docker-1.12.2-5.el7.x86_64

# atomic --debug verify -v busybox
/usr/bin/python2: symbol lookup error: /lib64/libostree-1.so.1: undefined symbol: g_file_enumerator_iterate

# rpm -qf /lib64/libostree-1.so.1
ostree-2016.10-1.atomic.el7.x86_64

Comment 4 Alex Jia 2016-10-19 07:23:28 UTC
(In reply to Alex Jia from comment #3)
> (In reply to Brent Baude from comment #2)
> > This should be fixed upstream with
> > https://github.com/projectatomic/atomic/pull/714 when I can get it to pass
> > tests.
> 
> It doesn't work for me, it seems we need to build a new ostree RPM pacakge.
> 

Well, it's a new issue, need I file a separate bug to track it?

Comment 5 Alex Jia 2016-10-19 07:42:13 UTC
(In reply to Alex Jia from comment #4)
> Well, it's a new issue, need I file a separate bug to track it?

bug 386519

Comment 6 Brent Baude 2016-10-19 13:37:37 UTC
Is the right BZ number? It doesnt resolve for me

Comment 7 Colin Walters 2016-10-19 13:52:39 UTC
https://bugzilla.redhat.com/show_bug.cgi?id=1386519

Comment 8 Alex Jia 2016-10-19 15:28:39 UTC
Brent, it seems we don't need to assign value to latest_nvr and local_nvr if nvr is unavailable.


[root@atomic-host-001 cloud-user]# rpm -q atomic skopeo docker
atomic-1.13.1-3.el7.x86_64
skopeo-0.1.17-0.4.git550a480.el7.x86_64
docker-1.10.3-55.el7.x86_64

[root@atomic-host-001 cloud-user]# atomic --debug verify -v busybox
{
    "index": 0,
    "Version": "",
    "Name": "docker.io/busybox:latest",
    "Parent": "",
    "Tag": "docker.io/busybox:latest",
    "Id": "e02e811dd08fd49e7f6032625495118e63f597eb150403d02e3238af1df240ba"
}
{
    "iid": "e02e811dd08fd49e7f6032625495118e63f597eb150403d02e3238af1df240ba",
    "tag": "docker.io/busybox:latest",
    "remote": false,
    "name": "docker.io/busybox:latest",
    "index": 0,
    "latest_nvr": "docker.io/busybox:latest-Version unavailable",
    "local_nvr": "docker.io/busybox:latest-Version unavailable",
    "no_version": false
}

docker.io/busybox:latest contains the following images:

     Local Version                                Latest Version                                
     -------------                                --------------                                
     docker.io/busybox:latest-Version unavailable docker.io/busybox:latest-Version unavailable  

     * = version difference

Comment 9 Brent Baude 2016-10-19 18:02:56 UTC
The code in my PR works completely different. I need to make a suggested change to it today and then it should be mergable.

Comment 10 Brent Baude 2017-02-04 17:13:10 UTC
I believe this error is now fixed.  Agree?

Comment 11 Daniel Walsh 2017-02-06 23:07:31 UTC
Fixed in atomic-1.4

Comment 12 Alex Jia 2017-02-07 02:57:45 UTC
(In reply to Brent Baude from comment #10)
> I believe this error is now fixed.  Agree?

Yes, this issue has been fixed in upstream.

Comment 14 Alex Jia 2017-04-28 00:29:09 UTC
It also works in latest atomic-1.17.1-1.gitf304570.el7.x86_64 w/ skopeo-0.1.18-1.el7.x86_64



[root@hp-dl360g9-04 ~]# atomic --debug verify -v busybox
Namespace(_class=<class 'Atomic.verify.Verify'>, assumeyes=False, debug=True, func='verify', ignore=False, image='busybox', no_validate=False, profile=False, storage=None, verbose=True)

busybox contains the following images:

NAME                           LOCAL VERSION        REMOTE VERSION       DIFFERS
busybox                        00f017a8c2a6e1fe2ffd 00f017a8c2a6e1fe2ffd NO

Comment 15 Alex Jia 2017-05-17 02:13:23 UTC
it also works in atomic-1.17.2-2.git2760e30.el7.x86_64

Comment 17 errata-xmlrpc 2017-05-26 14:28:17 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