Skip to content

Conversation

mayankmani-sde
Copy link
Collaborator

@mayankmani-sde mayankmani-sde commented Aug 25, 2025

SUMMARY

Override Zoau Error response with more descriptive error messages

Fix #1985

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

data_set

ADDITIONAL INFORMATION
 - name: Delete GDG base
     zos_data_set:
      name: "NAZARE.WDEPLOY.ANSIBLE.TEST"
      type: gdg
      state: absent
      force: true
     register: dataset_creation
  
   - name: Print dataset creation output
     debug:
      msg:
        - "Dataset creation output: {{dataset_creation }}"
The full traceback is:
  File "/tmp/ansible_zos_data_set_payload_ecjuam8_/ansible_zos_data_set_payload.zip/ansible_collections/ibm/ibm_zos_core/plugins/modules/zos_data_set.py", line 1965, in run_module
    current_changed = perform_data_set_operations(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/ansible_zos_data_set_payload_ecjuam8_/ansible_zos_data_set_payload.zip/ansible_collections/ibm/ibm_zos_core/plugins/modules/zos_data_set.py", line 1463, in perform_data_set_operations
    changed = data_set.ensure_absent(force=force)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/ansible_zos_data_set_payload_ecjuam8_/ansible_zos_data_set_payload.zip/ansible_collections/ibm/ibm_zos_core/plugins/module_utils/data_set.py", line 3065, in ensure_absent
    raise GenerationDataGroupDeleteError(
fatal: [zvm]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "batch": null,
            "block_size": null,
            "directory_blocks": null,
            "empty": false,
            "extended": false,
            "fifo": false,
            "force": true,
            "key_length": null,
            "key_offset": null,
            "limit": null,
            "name": "NAZARE.WDEPLOY.ANSIBLE.TEST",
            "noscratch": false,
            "purge": false,
            "record_format": "fb",
            "record_length": null,
            "replace": false,
            "scratch": false,
            "sms_data_class": null,
            "sms_management_class": null,
            "sms_storage_class": null,
            "space_primary": 5,
            "space_secondary": 3,
            "space_type": "m",
            "state": "absent",
            "tmp_hlq": null,
            "type": "gdg",
            "volumes": null
        }
    },
    "message": "",
    "msg": "GenerationDataGroupDeleteError('Data set deletion failed: the generation data set is currently in use by another job or session. Try deleting after ensuring no active usage.')",
    "names": [
        "NAZARE.WDEPLOY.ANSIBLE.TEST"
    ]
}

PLAY RECAP *******************************************************************************************************************************************************
zvm                        : ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0   

@mayankmani-sde mayankmani-sde marked this pull request as ready for review August 25, 2025 21:47
@mayankmani-sde mayankmani-sde linked an issue Aug 28, 2025 that may be closed by this pull request
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Can't delete GDG dataset if an active GDS is used
1 participant