Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

list_dsn_members function causes most following functions to fail #299

Closed
john-craig opened this issue Jun 27, 2024 · 2 comments · Fixed by #302
Closed

list_dsn_members function causes most following functions to fail #299

john-craig opened this issue Jun 27, 2024 · 2 comments · Fixed by #302
Assignees
Labels

Comments

@john-craig
Copy link

Describe the bug

list_dsn_members function leaves X-IBM-Attributes key set as member in request arguments, borking most following requests.

Expected and actual results

Details about the behavior:

  1. Expected behavior: Other zos_files functions function normally after call of list_dsn_members
  2. Actual behavior: Requests after using the list_dsn_members function using the same zos_files object fail with, {"category":1,"rc":4,"reason":12,"message":"X-IBM-Attributes","details":["member"]}
  3. Applicable log files:
Traceback (most recent call last):
  File "/home/ibmuser/.local/bin/gamacles", line 8, in <module>
    sys.exit(gamacles_cli())
             ^^^^^^^^^^^^^^
  File "/home/ibmuser/.local/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ibmuser/.local/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/home/ibmuser/.local/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ibmuser/.local/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ibmuser/.local/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ibmuser/.local/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ibmuser/.local/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ibmuser/.local/lib/python3.11/site-packages/gamacles/main.py", line 150, in linkedit
    dev_linkedit(dry_run, steplib, amblist, ctx.obj['config'])
  File "/home/ibmuser/.local/lib/python3.11/site-packages/gamacles/development/linkedit.py", line 200, in dev_linkedit
    amblist_steplib(username, load_module, steplib_dataset, zos_files, zos_jobs)
  File "/home/ibmuser/.local/lib/python3.11/site-packages/gamacles/development/linkedit.py", line 15, in amblist_steplib
    ensure_dataset(f'{username}.{load_module}.AMBLIST', AMBLIST_DATASET_OPTS, zos_files)
  File "/home/ibmuser/.local/lib/python3.11/site-packages/gamacles/development/common.py", line 95, in ensure_dataset
    res = zos_files.list_dsn(dsname)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ibmuser/.local/lib/python3.11/site-packages/zowe/zos_files_for_zowe_sdk/files.py", line 125, in list_dsn
    response_json = self.request_handler.perform_request("GET", custom_args)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ibmuser/.local/lib/python3.11/site-packages/zowe/core_for_zowe_sdk/request_handler.py", line 71, in perform_request
    self.__validate_response()
  File "/home/ibmuser/.local/lib/python3.11/site-packages/zowe/core_for_zowe_sdk/request_handler.py", line 135, in __validate_response
    raise RequestFailed(self.response.status_code, output_str)
zowe.core_for_zowe_sdk.exceptions.RequestFailed: HTTP Request has failed with status code 500. 

Describe your environment

  • Python and PIP versions installed (run python --version, pip --version):
    • Python 3.11.7
    • "zowe==1.0.0.dev15"
  • Environment variables in use: N/A
  • Operating system and version: Redhat Linux 4.18.0-553.5.1.el8_10.x86_64
  • Shell/terminal (bash, cmd, powershell, etc...): Running from a Python CLI script
@john-craig john-craig added the bug Something isn't working label Jun 27, 2024
@github-project-automation github-project-automation bot moved this to New Issues in Zowe CLI Squad Jun 27, 2024
Copy link

Thank you for creating a bug report.
We will investigate the bug and evaluate its impact on the product.
If you haven't already, please ensure you have provided steps to reproduce the bug and as much context as possible.

@john-craig
Copy link
Author

This is a temporary workaround:

def list_dsn_members_safe(dataset, zos_files):
    res = zos_files.list_dsn_members(dataset)

    if "headers" in zos_files.request_arguments and "X-IBM-Attributes" in zos_files.request_arguments["headers"]:
        zos_files.request_arguments["headers"]["X-IBM-Attributes"] = None
    
    return res

@zowe-robot zowe-robot moved this from New Issues to High Priority in Zowe CLI Squad Jul 1, 2024
@JTonda JTonda moved this from High Priority to In Progress in Zowe CLI Squad Jul 1, 2024
@zFernand0 zFernand0 linked a pull request Jul 2, 2024 that will close this issue
4 tasks
@github-project-automation github-project-automation bot moved this from In Progress to Closed in Zowe CLI Squad Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants