Bug 604840 - cannot create bundle after initially cancelling it
Summary: cannot create bundle after initially cancelling it
Alias: None
Product: RHQ Project
Classification: Other
Component: Provisioning
Version: 3.0.0
Hardware: All
OS: All
medium vote
Target Milestone: ---
: ---
Assignee: Jay Shaughnessy
QA Contact: Sunil Kondkar
Depends On:
Blocks: jon24-provisioning
TreeView+ depends on / blocked
Reported: 2010-06-16 20:10 UTC by John Mazzitelli
Modified: 2010-08-12 16:50 UTC (History)
0 users

Clone Of:
Last Closed: 2010-08-12 16:50:26 UTC

Attachments (Terms of Use)
create-bundle-error.txt (11.88 KB, text/plain)
2010-06-16 20:10 UTC, John Mazzitelli
no flags Details

Description John Mazzitelli 2010-06-16 20:10:32 UTC
Created attachment 424575 [details]

Description of problem:

If you upload a bundle distribution file, and before finishing the Create Wizard, you cancel it, then try to upload the bundle distribution file again, you get an exception.

Steps to Reproduce:
1. Create a New bundle, upload a bundle distribution file, then step through the Create Wizard stopping at the final "Summary" step page.
2. At the final Summary step, click the cancel button (do NOT click finish; just cancel button)
3. Repeat step 1 with the same bundle distro file
4. At the final Summary step, click the "Finish" button (do NOT cancel)
Actual results:

You get an error in the message panel saying it failed to create the bundle. See the attached stack trace for the actual error.

Expected results:

It should have created the bundle properly.

Comment 1 John Mazzitelli 2010-06-18 13:45:58 UTC
I think this has to do with our "bundle delete" code. We need to make sure we clean up everything on a delete.

Comment 2 Jay Shaughnessy 2010-06-21 21:03:19 UTC
I have not been able to reproduce this, maybe something else is going on in order to get this to happen.

Comment 3 John Mazzitelli 2010-06-23 12:29:25 UTC
I just got this again. Before doing the replication steps described here, upload another bundle distribution file. Once you get a bundle distro file in the DB, then do the steps here. For example, I have two bundle distro files:

bundle-test v1.0
bundle-test v2.0

I uploaded the v1.0 successfully.  Then I went through the create wizard with v2.0 but canceled at the end. I then uploaded v2.0 again, but this time I did not cancel.

Comment 4 Jay Shaughnessy 2010-06-23 20:47:30 UTC
fix commit: e71e170a064a93f981f0e8d773a28bccb2897484

The problem here is that we did neither of the following:

1) when removing a BundleVersion remove the PackageVersions for its BundleFiles.

2) when creating a BundleVersion reuse a PackageVersion if it was already there.

So, PackageVersions for a Bundle were only removed if the Bundle itself was deleted.

To solve the problem we now do (1).  We now cascade remove (via Hibernate) the PV when the BundleFile is removed. 

This works because we always create a new PV for a BV's BundleFiles.  The PV is versioned after the BV. If in the future we decide to reuse a PV if it is physically the same file used by multiple BVs, or possibly refer to PVs outside of the Bundle's own repo, then this strategy will need to be updated.

Comment 5 Sunil Kondkar 2010-06-25 11:00:12 UTC
Verified on JON 2.4 GA_QA build#42

Uploaded 1st version of a bundle distribution file. Went through the create wizard with 2nd version and canceled at the summary page. I then uploaded v2.0 again and clicked 'Finish' button on summary page. The 2nd version is uploaded successfully.
No exception is observed.

Comment 6 Corey Welton 2010-08-12 16:50:26 UTC
Mass-closure of verified bugs against JON.

Note You need to log in before you can comment on or make changes to this bug.