HCLmainframetools / mainframeToolsDocs

Documentation for the HCL Mainframe Tools VS Code Extension
1 stars 0 forks source link

Authentication error when attempting to deploy HCLREXX exec #6

Open fswarbrick opened 3 years ago

fswarbrick commented 3 years ago

VSCode error box shows with the following information:

Failed to deploy HCLREXX exec: This operation requires authentication. 
z/OSMF REST API Error: Rest API failure with HTTP(S) status 401 
Host: 192.86.32.250 
Port: 10443 
Base Path: Resource: /zosmf/restfiles/ds?dslevel=Z85779.EXEC 
Request: GET Headers: [{"Accept-Encoding":"gzip"},{"X-IBM-Max-Items":"0"},{"X-CSRF-ZOSMF-HEADER":true}] 
Payload: GET

I turned on tracing and the following information is in the zowe.log file:

[2021/06/10 04:00:01.018] [DEBUG] [extension.js:73] Creating a z/OSMF session from the profile named %s
[2021/06/10 04:00:01.022] [DEBUG] [extension.js:73] Endpoint: /zosmf/restfiles/ds?dslevel=Z85779.EXEC
[2021/06/10 04:00:01.190] [DEBUG] [extension.js:73] onEnd() called for rest client s
[2021/06/10 04:00:01.192] [DEBUG] [extension.js:73] Encountered an error trying to parse causeErrors as JSON  - causeErrors is likely not JSON format
[2021/06/10 04:00:01.194] [DEBUG] [extension.js:73] Error was processed by overridden processError method in RestClient s
[2021/06/10 04:00:01.197] [ERROR] [extension.js:73] [i [Error]: This operation requires authentication.

z/OSMF REST API Error:
Rest API failure with HTTP(S) status 401

Host:      192.86.32.250
Port:      10443
Base Path: 
Resource:  /zosmf/restfiles/ds?dslevel=Z85779.EXEC
Request:   GET
Headers:   [{"Accept-Encoding":"gzip"},{"X-IBM-Max-Items":"0"},{"X-CSRF-ZOSMF-HEADER":true}]
Payload:   GET

    at s.populateError (c:\Users\fswar\.vscode\extensions\zowe.vscode-extension-for-zowe-1.15.1\out\src\extension.js:69:370077)
    at s.onEnd (c:\Users\fswar\.vscode\extensions\zowe.vscode-extension-for-zowe-1.15.1\out\src\extension.js:69:368512)
    at IncomingMessage.<anonymous> (c:\Users\fswar\.vscode\extensions\zowe.vscode-extension-for-zowe-1.15.1\out\src\extension.js:69:366934)
    at IncomingMessage.emit (events.js:327:22)
    at endReadableNT (internal/streams/readable.js:1327:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)] {
  mDetails: {
    msg: 'This operation requires authentication.\n' +
      '\n' +
      'z/OSMF REST API Error:\n' +
      'Rest API failure with HTTP(S) status 401\n' +
      '\n' +
      'Host:      192.86.32.250\n' +
      'Port:      10443\n' +
      'Base Path: \n' +
      'Resource:  /zosmf/restfiles/ds?dslevel=Z85779.EXEC\n' +
      'Request:   GET\n' +
      'Headers:   [{"Accept-Encoding":"gzip"},{"X-IBM-Max-Items":"0"},{"X-CSRF-ZOSMF-HEADER":true}]\n' +
      'Payload:   GET\n',
    causeErrors: '',
    source: 'http',
    errorCode: 401,
    protocol: 'https',
    port: 10443,
    host: '192.86.32.250',
    basePath: '',
    httpStatus: 401,
    errno: undefined,
    syscall: undefined,
    payload: undefined,
    headers: [ [Object], [Object], [Object] ],
    resource: '/zosmf/restfiles/ds?dslevel=Z85779.EXEC',
    request: 'GET',
    additionalDetails: 'Username or password are not valid or expired.\n\n'
  },
  mMessage: 'This operation requires authentication.\n' +
    '\n' +
    'z/OSMF REST API Error:\n' +
    'Rest API failure with HTTP(S) status 401\n' +
    '\n' +
    'Host:      192.86.32.250\n' +
    'Port:      10443\n' +
    'Base Path: \n' +
    'Resource:  /zosmf/restfiles/ds?dslevel=Z85779.EXEC\n' +
    'Request:   GET\n' +
    'Headers:   [{"Accept-Encoding":"gzip"},{"X-IBM-Max-Items":"0"},{"X-CSRF-ZOSMF-HEADER":true}]\n' +
    'Payload:   GET\n'
}

This seems to me to indicate that my authentication information for my selected profile (zcobol) is not being passed in the zosmf request. Here is my profile:

zowe profiles list zosmf --sc
- 
  name:     zcobol (default) 
  contents: 
    host:               192.86.32.250
    port:               10443
    user:               managed by Zowe Explorer
    password:           managed by Zowe Explorer
    rejectUnauthorized: false
    responseTimeout:    30

Other information:

HCL z Tools version: 0.0.13
Zowe Explorer version: 1.15.1
Zowe CLI version: 6.23.0

VSCode
Version: 1.56.2 (user setup)
Commit: 054a9295330880ed74ceaedda236253b4f39a335
Date: 2021-05-12T17:13:13.157Z
Electron: 12.0.4
Chrome: 89.0.4389.114
Node.js: 14.16.0
V8: 8.9.255.24-electron.0
OS: Windows_NT x64 10.0.19041
retrofita commented 2 years ago

Any progress on this. I managed to deploy it but when using it with my existing zosmf profiles I get something similar:

Failed to load data This operation requires authentication. z/OSMF REST API Error: Rest API failure with HTTP(S) status 401 Host: xxxx.xxx.xxxxx Port: xxxxx Base Path: Resource: /zosmf/restfiles/ds?dslevel=SYST.ZTOOLS.LOAD Request: GET Headers: [{"Accept-Encoding":"gzip"},{"X-IBM-Max-Items":"0"},{"X-CSRF-ZOSMF-HEADER":true}] Payload: GET

I can do a bodgey by coding my userid and RSA token in the profile and get further with the REXX abending saying extraneous information is passed. This seems like a good idea/tool but as it exists doesn't work.