Skip to content

ZE FileSystemProvider stat function throws an authentication error for correct credentials #3662

@hohy

Description

@hohy

Describe the bug

When calling the stat function of the Zowe Explorer FileSystemProvider while logged out of the Authentication Service, a FileSystemError is thrown even though correct credentials are provided during the authentication prompt. The error indicates an authentication failure, but subsequent stat calls with the same parameters succeed without error.

To Reproduce

  1. Open VSCode
  2. Configure zosmf profile but DO NOT log in to Authentication Service
  3. Call ZE FS provider with code similar to this
try {
  await vscode.workspace.fs.stat(
    vscode.Uri.parse(`zowe-ds:/${profileName}/${dsn}?fetch=true`)
  );
} catch (error) {
  vscode.window.showErrorMessage(error.stack);
}
  1. Zowe Explorer prompts for login to the Authentication Service
  2. Enter correct credentials
  3. ZE displays Login to authentication service successful dialog.
  4. Despite the successful login, the stat function throws the following error:
Error (FileSystemError): Rest API failure with HTTP(S) status 401 This operation requires authentication.
  1. Repeating the same stat call with the same parameters returns the correct result without error.

Expected behavior
The initial stat call should succeed if correct credentials are provided during the authentication prompt, even if the user was not previously logged in. No error should be thrown in this scenario.

Screenshots

Desktop (please complete the following information):

  • OS: macOC
  • Zowe Explorer Version: 3.2.0
  • (Optional) Zowe CLI Version:
  • (Optional) Do you have secure credentials enabled?
  • (Optional) Are you using a custom credential manager?

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority-mediumNot functioning - next quarter if capacity permitsseverity-mediumBug where workaround exists or that doesn't prevent the usage of Zowe. Just makes it more complex.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Closed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions