Uploaded image for project: 'Product Technical Learning'
  1. Product Technical Learning
  2. PTL-12214

Cannot delete Organization if Lifecycle Environments are based on the wrong Library

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • RH403 - RHS6.11-en-5-20231214
    • RH403
    • None
    • False
    • Hide

      None

      Show
      None
    • False
    • 10
    • en-US (English)

      Please fill in the following information:


      URL: https://rol.redhat.com/rol/app/courses/rh403-6.11/pages/ch10s02
      Reporter RHNID: atcorduneanu@extraordy.com
      Section Title:   Guided Exercise: Query the Red Hat Satellite API                                                                     

      Issue description

      If the Lifecycle Environments are created as per the steps in the Guided Exercise, basing the path of them on the wrong Library (e.g. Library with id 1) (see this issue), the API request of removing the organization will return with apparent success, but the organization will not be deleted.

      A second attempt to request an Organization deletion will fail for that the Satellite task generated by the first request was unable to complete. It will remain blocked with the following error:
      "Cannot delete record because of dependent kt_environments"

      Steps to reproduce:
      curl -X POST -H 'ContentType: application/json' -u admin:redhat https://satellite.lab.example.com/katello/api/organizations/ --data '{"name": "Testing", "description": "Global product training"}' | python3 -m json.tool

      ///// The ID of the newly created org is 9

      curl -X POST -H 'ContentType: application/json' -u admin:redhat https://satellite.lab.example.com/katello/api/organizations/9 --data '{"name": "AnotherDevel", "prior": "1"}' | python3 -m json.tool

      // confirm LFCE creation
      hammer lifecycle-environments list --organization Testing

      curl -X DELETE -H 'ContentType: application/json' -u admin:redhat https://satellite.lab.example.com/katello/api/organizations/9 | python3 -m json.tool

      Workaround:

      Remove the Lifecycle Environments manually, resume the Organization deletion task.

      Expected result:

      I would expect the API backend to successfully delete the Organization, or at least to fail on the attempt to create a Lifecycle Environment with the wrong Library ID.

        1. Screenshot from 2024-02-08 17-52-07.png
          28 kB
          Andrei Tudor Corduneanu
        2. Screenshot from 2024-02-08 17-52-22.png
          49 kB
          Andrei Tudor Corduneanu

            glsbugs-hybridcloud@redhat.com PTL - RHEL Team
            atcorduneanu@extraordy.com Andrei Tudor Corduneanu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: