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

Improve user friendlyness error for listing members in a data set #935

Closed
Tracked by #1671
Joe-Winchester opened this issue Feb 1, 2021 · 10 comments · Fixed by #1738
Closed
Tracked by #1671

Improve user friendlyness error for listing members in a data set #935

Joe-Winchester opened this issue Feb 1, 2021 · 10 comments · Fixed by #1738
Labels
community-upvoted enhancement New feature or request good first issue Good for newcomers priority-high Production outage - this quarter or at least next quarter v3 prospective changes for v3
Milestone

Comments

@Joe-Winchester
Copy link
Member

Problem

When using zowe files list all-members <PDS-NAME> if the PDS is invalid the error message includes information about 404 codes and rc: 8, which can make it look as though there is a runtime CLI problem rather than just a user error.

Joes-MBP-3:~ Joe$ zowe files list all-members "WINCJ.JCL"
Command Error:
z/OSMF REST API Error:
Rest API failure with HTTP(S) status 404
category: 4
rc:       8
reason:   0
message:  LMINIT error
details: 
  - ISRZ002 Data set not cataloged - 'WINCJ.JCL' was not found in catalog.


Error Details:
HTTP(S) error status "404" received.
Review request details (resource, base path, credentials, payload) and ensure correctness.

Host:      winmvs3b.hursley.ibm.com
Port:      32070
Base Path: 
Resource:  /zosmf/restfiles/ds/WINCJ.JCL/member
Request:   GET
Headers:   [{"X-IBM-Max-Items":"0"},{"X-CSRF-ZOSMF-HEADER":true}]
Payload:   undefined
``
 
**Solution**

echo a more user friendly error, such as `Partitioned Data Set {n)` not found.

There are other examples of where a CLI command with an invalid path or input PDS emits the raw https://. response.  If one exists that parses the response into a more friendly error, this could perhaps become a good example for others to base and form some good first issue cli items.  It's possible there is already such an example of how to do this so apologies if so.
@MikeBauerCA
Copy link
Contributor

@dkelosky do you think we should open a z/OSMF RFE to improve this error message?

@dkelosky
Copy link
Contributor

dkelosky commented Feb 1, 2021

Potentially, as I read this though, I think we have a good message already. The problem is that it’s buried by a bunch of other messages.

Are you interested in only seeing the “details” @Joe-Winchester ?

@Joe-Winchester
Copy link
Member Author

I agree there is a good message there, but it's wrapped in a quite a bit of chaff. By comparison with other CLIs when a mistake is made there is usually a one-liner, e.g

>chmod asd
chmod: asd: No such file or directory
>

In the example of `zowe files list all-members "WINCJ.JCL" the current echo to the user has "Command Error" and "Error Details" that get colored red in my mac terminal and look like a low level crash. Including the "HTTP(S) error status "404" received" also feels like low level debug info that a user can't really do a lot about.

What if you just echo'd the details:

>zowe files list all-members "WINCJ.JCL"
-ISRZ002 Data set not cataloged - 'WINCJ.JCL' was not found in catalog
>

The message ISRZ002 is a z/OS error so it can be googled.

Likewise `zowe files list uss /u/bob' emits

Command Error:
z/OSMF REST API Error:
Rest API failure with HTTP(S) status 404
category: 1
rc:       4
reason:   8
message:  Path name not found
details: 
  - EDC5129I No such file or directory. (errno2=0x053B006C)


Error Details:
HTTP(S) error status "404" received.
Review request details (resource, base path, credentials, payload) and ensure correctness.

Host:      winmvs3b.hursley.ibm.com
Port:      32070
Base Path: 
Resource:  /zosmf/restfiles/fs?path=%2Fu%2Fbob
Request:   GET
Headers:   [{"X-IBM-Max-Items":"0"},{"X-CSRF-ZOSMF-HEADER":true}]
Payload:   undefined

This could be simplified to

>zowe files list uss /u/bob
- EDC5129I No such file or directory. (errno2=0x053B006C)
>

and so forth.

Maybe have some kind of "messageResponse=DEBUG/INFO" value that can be set as a Zowe parm in case someone does want to drill down into low level REST debugging ?

@dkelosky
Copy link
Contributor

dkelosky commented Feb 2, 2021

I think it's a neat idea. If we print out a short version of errors, we can also echo how to enable verbose messaging.

All we need now are a bunch of 👍

@MikeBauerCA
Copy link
Contributor

For this particular error, I agree. I would like to see a sampling of other common errors, with and without the details. The "Review request details" section has helped in various situations, especially with connection details (e.g. mistyped host/port).

@namanpatel1112
Copy link
Contributor

namanpatel1112 commented Jul 26, 2021

@dkelosky @Joe-Winchester @MikeBauerCA
I made the above PR 1075 for the command. Please confirm if you think this is a good way to implement user friendly error messaging. Then, I can do this for other commands that we need to discuss and do it for.

Basically, I've edited catching an error in packages/zosfiles/src/methods/list/List.ts to throw only the short error message unless an option --debug-response or --dr is specified with the command. If the option is included, then it shows all the REST API level info.

@dkelosky
Copy link
Contributor

Thanks for the tag; I'll add a comment to the PR.

@namanpatel1112 namanpatel1112 removed their assignment Aug 24, 2022
@awharn awharn added enhancement New feature or request for-review To be reviewed in an Eng & Prod Mgmt meeting labels Sep 15, 2022
@github-actions
Copy link

Thank you for raising this issue.
The community has 90 days to upvote 👍 the issue.
If it receives 5 upvotes, we will move it to our backlog. If not, we will close it.

@zFernand0 zFernand0 added priority-high Production outage - this quarter or at least next quarter and removed for-review To be reviewed in an Eng & Prod Mgmt meeting labels Oct 7, 2022
@zFernand0
Copy link
Member

After some discussion, here are a list of things we could do to accomplish this.

  1. Add color to the labels within the error message (e.g. categories, rc, reason, message, details)
  2. Create a ZOWE_CLI_SHORT_ERRORS environment variable
    • Only show details when enabled
    • Full error should still be in the logs
  3. Ask z/OSMF for a short user-friendly message
  4. Ask z/OSMF for a "catalog" endpoint (similar to qwikref)

Only implementing the number 1 item makes this a good first issue

@zFernand0 zFernand0 added the good first issue Good for newcomers label Oct 12, 2022
@ATorrise ATorrise added the v3 prospective changes for v3 label Dec 6, 2022
@ATorrise ATorrise self-assigned this Dec 12, 2022
@ATorrise ATorrise removed their assignment Feb 16, 2023
@zFernand0 zFernand0 added enhancement New feature or request and removed enhancement New feature or request labels Mar 8, 2023
@github-actions
Copy link

github-actions bot commented Mar 8, 2023

Thank you for raising this enhancement request.
The community has 90 days to vote on it.
If the enhancement receives at least 5 upvotes, it is added to our development backlog.
If it receives fewer votes, the issue is closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community-upvoted enhancement New feature or request good first issue Good for newcomers priority-high Production outage - this quarter or at least next quarter v3 prospective changes for v3
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants