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

NSFS | NC | CLI | Manage return multiple error response when exit wait for process completion #7900

Closed
naveenpaul1 opened this issue Mar 14, 2024 · 3 comments
Assignees
Labels

Comments

@naveenpaul1
Copy link
Contributor

Environment info

  • NooBaa Version: VERSION
  • Platform: Kubernetes 1.14.1 | minikube 1.1.1 | OpenShift 4.1 | other: specify

Actual behavior

  1. Manage NSFS process exit is not waiting for complete response flush out both in success and error flows.
    There is a chance that output might break if output size is large, as mentioned in this issue
    Noobaa health command giving trimmed output in pipe #7894
    To avoid that we tried to added proccess.exit() only after printing all stdout response but got multiple error response for a single command and it breaking unit test and error message in terminal.

change added :

process.stdout.write(err + '\n', () => {
process.exit(1);
});

Expected behaviour

  1. Only one valid error message should get printed for one error flow
  2. unit test should not fail after changes

Steps to reproduce

  1. sudo node src/cmd/manage_nsfs account status --name acc01sss --from_file 'blabla' --test test
    Response :

{
"error": {
"code": "InvalidArgument",
"message": "Invalid argument",
"detail": "from_file, test are invalid options for account status. Supported options are: name, access_key, show_secrets, config_root, config_root_backend"
}
}
{
"error": {
"code": "InvalidArgumentType",
"message": "Invalid argument type",
"detail": "type of flag test should be undefined"
}
}

More information - Screenshots / Logs / Other output

@naveenpaul1 naveenpaul1 self-assigned this Mar 14, 2024
@romayalon
Copy link
Contributor

@naveenpaul1 Do you still see this issue? I tried it now and I got only one error -

{
  "error": {
    "code": "InvalidArgument",
    "message": "Invalid argument",
    "detail": "from_file, test are invalid options for account status. Supported options are: name, access_key, show_secrets, config_root, config_root_backend"
  }
}

@guymguym
Copy link
Member

guymguym commented May 1, 2024

@naveenpaul1 can we close?

@naveenpaul1
Copy link
Contributor Author

@guymguym its looking good now, We can close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants