Project

Profile

Help

Issue #1406

Updated by bmbouter almost 9 years ago

This is problem for all content types, and this issue needs to fix them all. The goal is to make 2.8.0 behavior the same as the pre 2.8.0 behavior. I'm not sure if the second upload overwrites the first, or if it fails silently because the original is already. We need to check to make sure we do the same thing again. 

 Unfortunately, since the unit is saved in each plugin it likely needs to be fixed in each plugin because after the error occurs the unit still needs to be associated with the repository. Perhaps there is On a way to do this in platform? 

 To reproduce, on a fresh installation of Pulp 2.8.0, If you run: 

 <pre> 
 pulp-admin login -u admin -p admin 
 pulp-admin rpm repo create --repo-id zoo --feed http://repos.fedorapeople.org/repos/pulp/pulp/demo_repos/zoo/ 
 wget https://repos.fedorapeople.org/repos/pulp/pulp/demo_repos/zoo/mouse-0.1.12-1.noarch.rpm 
 pulp-admin rpm repo uploads rpm --file ./mouse-0.1.12-1.noarch.rpm --repo-id zoo 
 pulp-admin rpm repo uploads rpm --file ./mouse-0.1.12-1.noarch.rpm --repo-id zoo 
 </pre> 

 On the cli cLI you'll be shown: 

 <pre> 
 Task Failed 

 unexpected error occurred importing uploaded file 
 </pre> 

 In the logs you'll see: 

 <pre> 
 unexpected error occurred importing uploaded file 
 Traceback (most recent call last): 
   File "/home/vagrant/devel/pulp_rpm/plugins/pulp_rpm/plugins/importers/yum/upload.py", line 100, in upload 
     handlers[type_id](repo, type_id, unit_key, metadata, file_path, conduit, config) 
   File "/home/vagrant/devel/pulp_rpm/plugins/pulp_rpm/plugins/importers/yum/upload.py", line 318, in _handle_package 
     unit.save() 
   File "/usr/lib/python2.7/site-packages/mongoengine/document.py", line 359, in save 
     raise NotUniqueError(message %% unicode(err)) 
 NotUniqueError: Tried to save duplicate unique keys (E11000 duplicate key error index: pulp_database.units_rpm.$name_1_epoch_1_version_1_release_1_arch_1_checksumtype_1_checksum_1 dup key: { : "mouse", : "0", : "0.1.12", : "1", : "noarch", : "sha256", : "f4200643b0845fdc55ee002c92c0404a9f3a2a49f596c78b40ab56749de226ce" }) 
 </pre> 

 The expectation is that there would be better error handling/reporting. There should be no traceback in the logs, and an indication should be shown to the user about why the rpm failed to upload/import.

Back