zowe / zowe-explorer-vscode

Visual Studio Code Extension for Zowe, which lets users interact with z/OS Data Sets, Unix System Services, and Jobs on a remote mainframe instance. Powered by Zowe SDKs.
Eclipse Public License 2.0
173 stars 92 forks source link

Error opening USS directory #2797

Open pablocarle opened 8 months ago

pablocarle commented 8 months ago

Describe the bug

Opening a directory in USS results in error parsing JSON

[2024/03/22 08:47:47] [ERROR] Error: The get request appeared to succeed, but the response was not in the expected format:
Bad control character in string literal in JSON at position 1050 (line 10 column 18)
{
  errorDetails: r [Error]: The get request appeared to succeed, but the response was not in the expected format:
  Bad control character in string literal in JSON at position 1050 (line 10 column 18)
      at Function.parse (/Users/user/.vscode/extensions/zowe.vscode-extension-for-zowe-2.15.1/out/src/extension.js:29:406487)
      at Function.<anonymous> (/Users/user/.vscode/extensions/zowe.vscode-extension-for-zowe-2.15.1/out/src/extension.js:90:57741)
      at Generator.next (<anonymous>)
      at s (/Users/user/.vscode/extensions/zowe.vscode-extension-for-zowe-2.15.1/out/src/extension.js:90:57243)
      at processTicksAndRejections (node:internal/process/task_queues:95:5) {
    mDetails: {
      msg: 'The get request appeared to succeed, but the response was not in the expected format:\n' +
        'Bad control character in string literal in JSON at position 1050 (line 10 column 18)',
      stack: 'SyntaxError: Bad control character in string literal in JSON at position 1050 (line 10 column 18)\n' +
        '    at JSON.parse (<anonymous>)\n' +
        '    at Function.parse (/Users/user/.vscode/extensions/zowe.vscode-extension-for-zowe-2.15.1/out/src/extension.js:29:406463)\n' +
        '    at Function.<anonymous> (/Users/user/.vscode/extensions/zowe.vscode-extension-for-zowe-2.15.1/out/src/extension.js:90:57741)\n' +
        '    at Generator.next (<anonymous>)\n' +
        '    at s (/Users/user/.vscode/extensions/zowe.vscode-extension-for-zowe-2.15.1/out/src/extension.js:90:57243)\n' +
        '    at processTicksAndRejections (node:internal/process/task_queues:95:5)',
      additionalDetails: 'Bad control character in string literal in JSON at position 1050 (line 10 column 18)',
      causeErrors: SyntaxError: Bad control character in string literal in JSON at position 1050 (line 10 column 18)
          at JSON.parse (<anonymous>)
          at Function.parse (/Users/user/.vscode/extensions/zowe.vscode-extension-for-zowe-2.15.1/out/src/extension.js:29:406463)
          at Function.<anonymous> (/Users/user/.vscode/extensions/zowe.vscode-extension-for-zowe-2.15.1/out/src/extension.js:90:57741)
          at Generator.next (<anonymous>)
          at s (/Users/user/.vscode/extensions/zowe.vscode-extension-for-zowe-2.15.1/out/src/extension.js:90:57243)
          at processTicksAndRejections (node:internal/process/task_queues:95:5) {
        vslsStack: [
          CallSite {},
          CallSite {},
          CallSite {},
          CallSite {},
          CallSite {},
          CallSite {}
        ]
      }
    },
    mMessage: 'The get request appeared to succeed, but the response was not in the expected format:\n' +
      'Bad control character in string literal in JSON at position 1050 (line 10 column 18)',
    vslsStack: [ CallSite {}, CallSite {}, CallSite {}, CallSite {}, CallSite {} ]
  },
  label: 'pagent',
  moreInfo: 'Retrieving response from uss-file-list'
}

I would like to know if there is any workaround for this.

Desktop (please complete the following information):

github-actions[bot] commented 8 months ago

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.

t1m0thyj commented 8 months ago

The z/OSMF API does not properly escape JSON responses when listing USS directories that contain filenames with special characters. We are waiting on this IBM RFE to be addressed: https://ibm-z-hardware-and-operating-systems.ideas.ibm.com/ideas/ZOS-I-3760

There is also a related issue in the Zowe CLI repo: https://github.com/zowe/zowe-cli/issues/1748

EmmasBox commented 3 weeks ago

This bug is still a problem in Zowe Explorer 3.0.2, I am unable to open my z/OS Unix home folder through Zowe Explorer because of one the files contains special characters.