Bug 1102877

Summary: docker repo upload fails for an image ancestry with a parent having multiple children
Product: [Retired] Pulp Reporter: Sayli Karmarkar <skarmark>
Component: docker-supportAssignee: Sayli Karmarkar <skarmark>
Status: CLOSED UPSTREAM QA Contact: pulp-qe-list
Severity: medium Docs Contact:
Priority: medium    
Version: MasterCC: cperry
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-02-28 22:09:19 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 Sayli Karmarkar 2014-05-29 18:18:54 UTC
Description of problem:
When trying to upload to a docker repository, if the image ancestry we are trying to upload has parents having multiple children, upload fails. 

Steps to reproduce - 

$ sudo docker pull busybox
$ sudo docker save busybox > busybox.tar
$ pulp-admin docker repo create --repo-id=busybox

$ pulp-admin docker repo uploads upload --repo-id=busybox -f /home/skarmark/git/pulp1/pulp/busybox.tar 
+----------------------------------------------------------------------+
                              Unit Upload
+----------------------------------------------------------------------+

Extracting necessary metadata for each request...
[==================================================] 100%
Analyzing: busybox.tar
An unexpected error has occurred. More information can be found in the client
log file ~/.pulp/admin.log.


admin.log -

2014-05-29 11:15:32,984 - ERROR - Client-side exception occurred
Traceback (most recent call last):
  File "/home/skarmark/git/pulp1/pulp/client_lib/pulp/client/extensions/core.py", line 478, in run
    exit_code = Cli.run(self, args)
  File "/usr/lib/python2.7/site-packages/okaara/cli.py", line 974, in run
    exit_code = command_or_section.execute(self.prompt, remaining_args)
  File "/home/skarmark/git/pulp1/pulp/client_lib/pulp/client/extensions/extensions.py", line 224, in execute
    return self.method(*arg_list, **clean_kwargs)
  File "/home/skarmark/git/pulp1/pulp/client_lib/pulp/client/commands/repo/upload.py", line 252, in run
    **user_input)
  File "/home/skarmark/git/pulp_docker/extensions_admin/pulp_docker/extensions/admin/upload.py", line 31, in generate_unit_key_and_metadata
    unit_key = {'image_id': tarutils.get_youngest_child(filename)}
  File "/home/skarmark/git/pulp_docker/common/pulp_docker/common/tarutils.py", line 103, in get_youngest_child
    image_ids.remove(parent)
KeyError: u'6c991eb934609424f761d3d0a7c79f4f72b76db286aa02e617659ac116aa7758'

Comment 1 Sayli Karmarkar 2014-05-30 18:33:50 UTC
https://github.com/pulp/pulp_docker/pull/21

Comment 2 Brian Bouterse 2015-02-28 22:09:19 UTC
Moved to https://pulp.plan.io/issues/441