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

Zowe Explorer fails to open a USS directory #1447

Open
plavjanik opened this issue Aug 18, 2021 · 8 comments
Open

Zowe Explorer fails to open a USS directory #1447

plavjanik opened this issue Aug 18, 2021 · 8 comments
Labels
bug Something isn't working On-Hold priority-medium Not functioning - next quarter if capacity permits

Comments

@plavjanik
Copy link

plavjanik commented Aug 18, 2021

Describe the bug

I am trying to open my home USS directory on the mainframe using Zowe Explorer. The directory exists and is accessible via SSH and ls works without issues. I do not have issues with other directories that I have tried but my home is quite useful for me.

But when I try to open it in Zowe Explorer I get the following error:

Retrieving response from uss-file-list Error: The get request appeared to succeed, but the response was not in the expected format:
Unexpected token � in JSON at position 20774

image

To Reproduce

  1. Open a directory like mine (I am not sure what is causing it but I can provide any information that you request)
  2. You will get the message that is described above but no list of files displayed:
    image

Expected behavior

No error and list of files and directories displayed.

Screenshots

Above.

Desktop (please complete the following information):

  • OS: macOS 10.15.7 (19H1323)
  • Zowe Explorer Version: v1.18.0
  • (Optional) Zowe CLI Version: 6.31.0
  • (Optional) Are you using Secure Credential Store? No

Additional context

@plavjanik plavjanik added the bug Something isn't working label Aug 18, 2021
@plavjanik
Copy link
Author

It might be connected to #111 that has been closed but not resolved.

@lauren-li
Copy link
Contributor

@plavjanik Could this be due to a special character(s) in the name of a file or directory underneath your home directory? Do you get the error when you try the steps below?:

  1. Create an empty test directory with no special characters in the name (for example, a/plape03/abc).
  2. In the USS view, search for and open the directory you created in Step 1.
  3. See if error occurs.

@plavjanik
Copy link
Author

plavjanik commented Oct 22, 2021

Hello @lauren-li, if I create a new directory with files with just standard ASCII characters then there is no problem.

When you create a file in it using:

touch `echo "Test\001\002"`

You will get a similar problem. Note: The you need to preserve \ characters when you copy & paste it. If it is not possible in your terminal, then putting the command in a shell script will work.

@plavjanik
Copy link
Author

plavjanik commented Nov 4, 2021

If you want to create a file with all special characters then you can use the following script: https://gist.github.com/plavjanik/803c98271e9f9cb574580a14a8ad2d5f

@lauren-li
Copy link
Contributor

Hi @plavjanik, thank you for the additional information!

I was trying to recreate the issue according to your steps with creating files like Test\001\002. Although my Terminal does not preserve the \ character and running the provided script creates files with spaces instead of the \-prefixed characters in the filename, I was able to use ISPF to create both directories and files with a \ in the name on z/OS.

I tested with both Zowe Explorer 1.18.0 and the newer Zowe Explorer 1.20.0, and got the same result:

  • I was able to open a USS directory named test\dir, containing a file that has \ in its filename.
  • When trying to open a USS file with a \ in the name (for example, test\file or test\dir/\001), I get a 400 Bad Request error. This could be addressed as its own issue if others are seeing this, as well.

Does the below screenshot resemble what you are trying to do with accessing a USS directory containing a file whose name contains the \ character?:

Screen Shot 2021-11-04 at 4 16 58 PM

@plavjanik
Copy link
Author

Hello, it looks like that you have created a file that has a name the real \ in it so there is no special character.

When I run a shell script that has one command:

touch `echo "Test\001\002"`

Then it creates one file that cannot be listed in Explorer:

image

Such directory is does not expand in Explorer:

image

This is how it is displayed in USS:

$ ls
Test
$ ls -b
Test\001\002

I have prepared a script that can create more special characters:
https://gist.github.com/plavjanik/803c98271e9f9cb574580a14a8ad2d5f

@zFernand0 zFernand0 added the priority-medium Not functioning - next quarter if capacity permits label Oct 5, 2022
@JillieBeanSim JillieBeanSim mentioned this issue Sep 25, 2023
31 tasks
@t1m0thyj
Copy link
Member

This is caused by z/OSMF returning a broken JSON object with invalid syntax when USS filenames contain special characters. Please upvote this RFE to request a fix in the z/OSMF REST API: https://ibm-z-hardware-and-operating-systems.ideas.ibm.com/ideas/ZOS-I-3760

@t1m0thyj t1m0thyj moved this from New Issues to Medium Priority in Zowe Explorer for VS Code Dec 26, 2023
@JillieBeanSim
Copy link
Contributor

Removing from Epic as it requires an update from zosmf rest apis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working On-Hold priority-medium Not functioning - next quarter if capacity permits
Projects
Status: Medium Priority
Development

No branches or pull requests

6 participants