Uploaded image for project: 'Satellite'
  1. Satellite
  2. SAT-21494

Creating an organization or a location through the API is not atomic

XMLWordPrintable

    • Moderate
    • No

      Description of problem:

      Trying to issue a concurrent location creation (through Ansible, in our case) for 1 Satellite and n capsules creates n+1 locations with the same name instead of 1 and returning 422 for the rest of them

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

      I've tested this in 6.13 and Stream, so I suppose that all the versions in between are also affected.

      How reproducible:

      Always.

      Steps to Reproduce:
      1. Create the equivalent of this Ansible playbook:

      ```

      • name: "Create location(s)"
        ansible.builtin.uri:
        url: "https://{{ satellite }}/api/locations"
        method: POST
        user: "admin"
        password: "{{ pass }}"
        force_basic_auth: True
        validate_certs: False
        body: "{{
        Unknown macro: { 'location'}

        }}"
        status_code:

      • 201
      • 422 # "Name has already been taken"
        body_format: json
        ```

      2. Run the playbook against a bunch of systems using a new location as parameter (the same for every system).

      3. Check the number of locations created.

      Actual results:

      n+1 new locations are created, all with the same name and characteristics.

      Expected results:

      Only 1 location is created and a 422 status is reported for the rest of them.

      Additional info:

              jira-bugzilla-migration RH Bugzilla Integration
              rhn-support-pmendezh_jira Pablo Mendez Hernandez (Inactive)
              RH Bugzilla Integration RH Bugzilla Integration
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: