Bug 863421 - Inconsistency in changeset status between UI and CLI
Inconsistency in changeset status between UI and CLI
Status: CLOSED WORKSFORME
Product: Red Hat Satellite 6
Classification: Red Hat
Component: API (Show other bugs)
6.0.1
Unspecified Unspecified
unspecified Severity high (vote)
: Unspecified
: --
Assigned To: Brad Buckingham
Katello QA List
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-05 08:51 EDT by Sachin Ghai
Modified: 2014-09-18 11:32 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-10-18 07:09:43 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Sachin Ghai 2012-10-05 08:51:27 EDT
Description of problem:
I created a changeset to delete the repo from 'dev' env. The repo was successfully deleted after applying changeset from cli.

However when I re-promoted the same repo again to 'dev' env, the status in cli/UI says promoted and product was really promoted to dev.

And in changeset list the status shown as promoted for same changeset. See the status for changeset "add_2_repos" in below output. 


katello> changeset list --env dev --org ACME_Corporation
<snip>

 13   del_fake               deletion      2012/10/04 09:28:37   deleted    2                dev               
 30   remove_2_repos         deletion      2012/10/05 07:45:19   deleted    2                dev               
 32   add_2_repos            promotion     2012/10/05 10:28:55   promoted   2                dev               
 33   add_repos              promotion     2012/10/05 12:21:53   review     2                dev             

</snip>

But when I tried to promote some other product to 'dev' env via cli, then cli throws error as:

>>katello> changeset apply --env dev --org ACME_Corporation --name add_repos
>>Cannot promote the changeset 'add_repos' while another changeset >>(add_2_repos) is being promoted.


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


How reproducible:
tried two times

Steps to Reproduce:
1. delete a product1 from env 'dev'
2. then re-promote the same product1 to 'dev'
3. now try to promote some other product2 to 'dev'
  
Actual results:
can not promote the channgeset created for product2 as product1 is being promoted. But actually product1 is already promoted to next env

Expected results:
The Cli should not show this inconsistency. 

In changeset list it shows product1 is promoted however when user tries to promote product2, cli throws error "product 1 is being promoted'

Additional info:
Comment 2 Sachin Ghai 2012-10-05 09:02:14 EDT
Steps I followed are here to promote/delete following 2 repos:

Red Hat Enterprise Linux 6 Server - Optional RPMs x86_64 6.3
Red Hat Enterprise Linux 6 Server RPMs x86_64 6.3


remove repos from 'dev' env:
============================

katello> changeset create --name remove_2_repos --env dev --org ACME_Corporation --deletion
Successfully created changeset [ remove_2_repos ] for environment [ dev ]
katello> changeset update --from_product "Red Hat Enterprise Linux Server" --add_repo "Red Hat Enterprise Linux 6 Server - Optional RPMs x86_64 6.3" --name remove_2_repos --org ACME_Corporation --environment dev
Successfully updated changeset [ remove_2_repos ]

katello> changeset update --from_product "Red Hat Enterprise Linux Server" --add_repo "Red Hat Enterprise Linux 6 Server RPMs x86_64 6.3" --name remove_2_repos --org ACME_Corporation --environment dev
Successfully updated changeset [ remove_2_repos ]
katello> changeset apply --env dev --org ACME_Corporation --name remove_2_reposChangeset [ remove_2_repos ] applied




promoting same repos as deleted above:
=======================================

katello> changeset create --name add_2_repos --env dev --org ACME_CorporationSuccessfully created changeset [ add_2_repos ] for environment [ dev ]
katello> changeset update --from_product "Red Hat Enterprise Linux Server" --add_repo "Red Hat Enterprise Linux 6 Server - Optional RPMs x86_64 6.3"  --name add_2_repos --org ACME_Corporation --environment dev
Successfully updated changeset [ add_2_repos ]
katello> changeset apply --env dev --org ACME_Corporation --name add_2_repos
Changeset [ add_2_repos ] applied

Trying to promote another repo:
===============================

katello> changeset apply --env dev --org ACME_Corporation --name add_repos
Cannot promote the changeset 'add_repos' while another changeset (add_2_repos) is being promoted.
katello> 




katello> changeset list --env dev --org ACME_Corporation
-------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                                      Changeset List

 Id   Name                   Action Type   Updated At            State      Environment Id   Environment Name  
-------------------------------------------------------------------------------------------------------------------------------------------------------------
              
 13   del_fake               deletion      2012/10/04 09:28:37   deleted    2                dev               
 30   remove_2_repos         deletion      2012/10/05 07:45:19   deleted    2                dev               
 32   add_2_repos            promotion     2012/10/05 10:28:55   promoted   2                dev               
 33   add_repos              promotion     2012/10/05 12:21:53   review     2                dev
Comment 4 Brad Buckingham 2012-10-17 16:52:38 EDT
I've tried to reproduce this one using both small and large repos; however, I've not been successful in recreating the issue reported.  Are you able to easily reproduce the error on your env?  Would it be possible for me to access and debug using that environment?

Note: I did see an issue with deletion of large repos reporting success during the 'apply' when the deletion is still in progress.  I am going to create a separate BZ for that, since it generates a different error.  E.g.

katello> changeset update --from_product prod1 --add_repo repo1 --name add_repo1 --org ACME_Corporation --environment dev
Successfully updated changeset [ add_repo1 ]
katello> changeset apply --env dev --org ACME_Corporation --name add_repo1
Changeset [ add_repo1 ] promotion failed: Resources::Pulp::Repository: 409 Conflict "A repository with the id, ACME_Corporation-dev-prod1-repo1, already exists" (POST /pulp/api/repositories/ACME_Corporation-prod1-repo1/clone/)
Comment 5 Sachin Ghai 2012-10-18 07:06:28 EDT
Unfortunately the setup where I found this issue is no longer available.

But I tried again on some other setup and this time I couldn't re-create this issue.  The 'changeset list' is giving correct status and even after deleting large repos from 'dev' env, I can new repos. Here are the steps I followed:


Removed repos from dev env:
==============
katello> changeset create --name remove2repos --env Dev --org redhat --deletion
Successfully created changeset [ remove2repos ] for environment [ Dev ]

katello> changeset update --from_product "Red Hat Enterprise Linux Server" --add_repo "Red Hat Enterprise Linux 6 Server RPMs i386 6Server" --env Dev --org redhat --name remove2repos
Successfully updated changeset [ remove2repos ]

katello> changeset update --from_product "Red Hat Enterprise Linux Server" --add_repo "Red Hat Enterprise Linux 6 Server RPMs x86_64 6Server" --env Dev --org redhat --name remove2repos
Successfully updated changeset [ remove2repos ]


katello> changeset apply --name remove2repos --env Dev --org redhat 
Changeset [ remove2repos ] applied 


Re-added same repos to dev env:
=============================
katello> changeset create --name add2repos --env Dev --org redhat 
Successfully created changeset [ add2repos ] for environment [ Dev ]

katello> changeset update --name add2repos --from_product "Red Hat Enterprise Linux Server" Red Hat Enterprise Linux 6 Server RPMs x86_64 6Server" --env Dev --org redhat
Successfully updated changeset [ add2repos ]

katello> changeset update --name add2repos --from_product "Red Hat Enterprise Linux Server" --add_repo "Red Hat Enterprise Linux 6 Server RPMs i386 6Server" --env Dev --org redhat
Successfully updated changeset [ add2repos ]

katello> changeset apply --name add2repos --env Dev --org redhat
Changeset [ add2repos ] applied 


Immediately try to add a new repo and it was added successfully.

 katello> changeset update --from_product "Red Hat Enterprise Linux Server" --add_repo "Red Hat CloudForms Tools for RHEL 6 RPMs i386 6Server" --env Dev --org redhat --name newrepo
Successfully updated changeset [ newrepo ]

katello> changeset apply --name newrepo --env Dev --org redhat
Changeset [ newrepo ] applied       
    
katello> changeset create --name newrepo --env Dev --org redhat
Successfully created changeset [ newrepo ] for environment [ Dev ]



katello> changeset list --env Dev --org redhat
-------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                                      Changeset List

 Id   Name                                          Action Type   Updated At            State      Environment Id   Environment Name  
-------------------------------------------------------------------------------------------------------------------------------------------------------------
 7    newrepo                                       promotion     2012/10/18 16:09:31   promoted   3                Dev               
 6    add2repos                                     promotion     2012/10/18 16:04:08   promoted   3                Dev               
 5    remove2repos                                  deletion      2012/10/18 15:43:19   deleted    3                Dev               
 4    promote_rhel                                  promotion     2012/10/18 15:13:01   promoted   3                Dev               
 3    Promote template(s): rhel-x86_64-6Server-cf   promotion     2012/10/12 17:20:05   promoted   3                Dev               
 2    Promote template(s): rhel-i386-6Server-cf     promotion     2012/10/12 17:17:42   promoted   3                Dev               
 1    Promote Red Hat provider                      promotion     2012/10/12 17:13:39   promoted   3                Dev
Comment 6 Sachin Ghai 2012-10-18 07:09:43 EDT
Tested it with following repos:

"Red Hat Enterprise Linux 6 Server RPMs i386 6Server"
"Red Hat Enterprise Linux 6 Server RPMs x86_64 6Server" 

As i'm no longer facing this issue, so closing this now. I'll reopen the issue if I hit again.
Comment 7 Mike McCune 2013-08-16 14:17:48 EDT
getting rid of 6.0.0 version since that doesn't exist

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