zowe / zowe-cli

Zowe CLI
Eclipse Public License 2.0
113 stars 87 forks source link

Profile creation failed #1437

Open plavjanik opened 2 years ago

plavjanik commented 2 years ago

Describe the bug

I am creating a new profile and I have entered the name ca32 (z/OSMF) to differentiate between FTP and z/OSMF. The extension accepted the name as valid initially but it failed to create the profile.

To Reproduce

  1. Create new connection to z/OS for data sets
  2. Use ca32 (z/OSMF) or similar as the name and enter other values
  3. It fails to create profile with this error:
Profile IO Error: Error creating profile file ("C:\Users\pp669351\.zowe\profiles\zosmf\ca32 (z\OSMF).yaml"). Error Details: ENOENT: no such file or directory, open 'C:\Users\pp669351\.zowe\profiles\zosmf\ca32 (z\OSMF).yaml'

Expected behavior

A profile is successfully created or the name is not accepted immediately after entering so a valid name can be entered.

Screenshots

image

Desktop (please complete the following information):

github-actions[bot] commented 2 years ago

Thank you for creating a bug report. If you haven't already, please ensure you have provided steps to reproduce it and as much context as possible.

zFernand0 commented 2 years ago

I was able to reproduce the same problem with the CLI.

root@SSH:~/gh# zowe -V
7.2.1
root@SSH:~/gh# zowe profiles create zosmf "ca32 (z/OSMF)" -H test 
Command Error:
Profile IO Error: Error creating profile file ("/root/.zowe/profiles/zosmf/ca32 (z/OSMF).yaml"). Error Details: ENOENT: no such file or directory, open '/root/.zowe/profiles/zosmf/ca32 (z/OSMF).yaml'
Error Details:
ENOENT: no such file or directory, open '/root/.zowe/profiles/zosmf/ca32 (z/OSMF).yaml'

Warning: The command 'profiles create' is deprecated.
Recommended replacement: The 'config init' command
root@SSH:~/gh# 

Transfering since we use the same APIs.

github-actions[bot] commented 1 year ago

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.

zFernand0 commented 1 year ago

This is an enhancement request for V1 profiles and the Zowe V1 release is in maintenance mode. Closing since Team configuration files do support most special characters as long as it's a valid JSON object. For instance, this is a valid profile name on V2 "name__!@#$%^&*()_-+=<>/?\\|{}\"__"

plavjanik commented 1 year ago

It is ok not to support some characters. The typical response of software is to explain this in an error message so users know what characters can be entered. Current message does not say what is wrong and how it can be corrected.

plavjanik commented 1 year ago

Try to look at it from the perspective of a user. You enter a perfectly valid string - the name of the service that is used by Zowe: z/OSMF but then the CLI fails with an error that does not make much sense. As a user I would expect either Zowe to explain why my input was invalid so I can do it correctly next time or ideally to allow me to enter it and change it to something that is valid on the current file system automatically. This is an error that is not handled properly and users have to guess what how to do a workaround. And when they find it, it gives a bad impression about the product. The fix for that is easy and a similar approach should be taken in all cases when input is requested from the user. It this case the product just does not work but what if there is a case when it can lead to more severe problems?