Bug 782561

Summary: better error message when import new manifest into org fails
Product: [Community] Candlepin Reporter: Tom McKay <tomckay>
Component: candlepinAssignee: Devan Goodwin <dgoodwin>
Status: CLOSED CURRENTRELEASE QA Contact: Eric Sammons <esammons>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 0.9CC: dgoodwin
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-07-17 13:04:06 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
portion of catalina.out during upload of second manifest none

Description Tom McKay 2012-01-17 17:31:21 UTC
Created attachment 555834 [details]
portion of catalina.out during upload of second manifest

Importing a new manifest into an organization that has already had one imported gives an error:

Candlepin::Owner: 400 Bad Request {
  "displayMessage" : "Bad data in export archive"
} (POST /candlepin/owners/org2/imports?force=true)

Comment 1 Tom McKay 2012-01-17 19:01:33 UTC
Working as expected; improve error message returned to indicate that the problem arose from trying to import a manifest from a different distributor.

Comment 2 Bryan Kearney 2012-01-17 19:20:09 UTC
I would assume we would like better error text to tell you what data was bad.

Comment 3 Devan Goodwin 2012-01-18 16:51:30 UTC
I have internationalized all of the messages going into this particular exception class, two are unlikely to ever appear, the third is the one reported above:

(dgoodwin@redhat {master} ~/src/candlepin/proxy) $ curl -k -u admin:admin -F upload=@/tmp/candlepin-export-50405/export.zip "https://redhat.local.rm-rf.ca:8443/candlepin/owners/bob/imports"
(dgoodwin@redhat {master} ~/src/candlepin/proxy) $ curl -k -u admin:admin -F upload=@/tmp/candlepin-export-57777/export.zip "https://redhat.local.rm-rf.ca:8443/candlepin/owners/bob/imports"
{
  "displayMessage" : "Owner has already imported from another distributor"
}%                                                            

Look ok?

For QE: to verify you need to make two manifests from different upstream distributors/consumers and try to import them into the same owner.

The easiest way to do this if you are using a devel candlepin install is the proxy/buildconf/scripts/gen-export.rb script, just run it twice and you'll get two different manifests for dummy products, from different consumers. Wipe your db, import one, then the other.

Comment 4 Tom McKay 2012-01-18 17:12:56 UTC
Message looks good to me.

Comment 5 Devan Goodwin 2012-01-20 17:39:52 UTC
Fixed in candlepin.git master: 91168aa9782c4f7d1f4000b5d7c55b246a75d97a

Will be in >= candlepin-0.5.12-1

Comment 6 Bryan Kearney 2012-07-17 13:04:06 UTC
Marking all community bugs modified or beyong as closed.