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

need meaningful error message for scan job authentication error in Automate UI #3149

Closed
ericcalabretta opened this issue Mar 19, 2020 · 1 comment
Assignees
Labels
bug 🐛 Something isn't working customer-reported issues reported by customers

Comments

@ericcalabretta
Copy link

ericcalabretta commented Mar 19, 2020

Describe the bug

The Automate UI does not expose a meaningful error message for scan job authentication errors. See the attached screen shot for the unknown error on the right panel.

automate screenshot

To Reproduce

Create a scan job with incorrect authentication information. WINRM was used in this instance.

Expected behavior

Automate UI would expose a meaningful error message so users would know what actions to take to correct the underlying authentication issues. Something like WinRM::WinRMAuthorizationError

Screenshots

Screen Sho

Versions (please complete the following information):

  • OS: windows 2016 inspec target

Additional context

Full error message from the Automate server

```Mar 10 15:50:22 REDACTED_FQDN hab[104330]: compliance-service.default(O): time="2020-03-10T15:50:22-05:00" level=error msg="detect(aea5be10-a152-4c4a-8a9a-2550f8264694) connection attempt # 1 failed for node a3dvtxoadm01-10.54.137.45(6df75e96-ebe1-460a-8a84-f1dfc6dd5423) with error: Unknown inspec error for redacted_IP: exit status 1\n\nSTDERR: /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/winrm-2.3.3/lib/winrm/http/response_handler.rb:59:in raise_if_auth_error': WinRM::WinRMAuthorizationError (WinRM::WinRMAuthorizationError)\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/winrm-2.3.3/lib/winrm/http/response_handler.rb:51:in raise_if_error'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/winrm-2.3.3/lib/winrm/http/response_handler.rb:34:in `parse_to_xml'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/winrm-2.3.3/lib/winrm/http/transport.rb:186:in `send_request'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/winrm-2.3.3/lib/winrm/http/transport.rb:181:in `send_request'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/winrm-2.3.3/lib/winrm/shells/power_shell.rb:153:in `max_envelope_size_kb'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/winrm-2.3.3/lib/winrm/shells/power_shell.rb:78:in `max_fragment_blob_size'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/winrm-2.3.3/lib/winrm/shells/power_shell.rb:202:in `fragmenter'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/winrm-2.3.3/lib/winrm/shells/power_shell.rb:166:in `block in open_shell_payload'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/winrm-2.3.3/lib/winrm/shells/power_shell.rb:165:in `map'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/winrm-2.3.3/lib/winrm/shells/power_shell.rb:165:in `open_shell_payload'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/winrm-2.3.3/lib/winrm/shells/power_shell.rb:123:in `open_shell'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/winrm-2.3.3/lib/winrm/shells/base.rb:169:in `block in open'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/winrm-2.3.3/lib/winrm/shells/retryable.rb:35:in `retryable'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/winrm-2.3.3/lib/winrm/shells/base.rb:167:in `open'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/winrm-2.3.3/lib/winrm/shells/base.rb:128:in `with_command_shell'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/winrm-2.3.3/lib/winrm/shells/base.rb:79:in `run'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/train-winrm-0.2.5/lib/train-winrm/connection.rb:118:in `run_command_via_connection'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/train-3.2.0/lib/train/plugins/base_connection.rb:128:in `run_command'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/train-3.2.0/lib/train/platforms/detect/helpers/os_windows.rb:9:in `check_cmd'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/train-3.2.0/lib/train/platforms/detect/helpers/os_windows.rb:4:in `detect_windows'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/train-3.2.0/lib/train/platforms/detect/specifications/os.rb:38:in `block in load'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/train-3.2.0/lib/train/platforms/detect/scanner.rb:46:in `instance_eval'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/train-3.2.0/lib/train/platforms/detect/scanner.rb:46:in `block in scan_children'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/train-3.2.0/lib/train/platforms/detect/scanner.rb:45:in `each'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/train-3.2.0/lib/train/platforms/detect/scanner.rb:45:in `scan_children'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/train-3.2.0/lib/train/platforms/detect/scanner.rb:60:in `scan_family_children'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/train-3.2.0/lib/train/platforms/detect/scanner.rb:51:in `block in scan_children'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/train-3.2.0/lib/train/platforms/detect/scanner.rb:45:in `each'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/train-3.2.0/lib/train/platforms/detect/scanner.rb:45:in `scan_children'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/train-3.2.0/lib/train/platforms/detect/scanner.rb:33:in `block in scan'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/train-3.2.0/lib/train/platforms/detect/scanner.rb:27:in `each'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/train-3.2.0/lib/train/platforms/detect/scanner.rb:27:in `scan'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/train-3.2.0/lib/train/platforms/detect.rb:9:in `scan'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/train-3.2.0/lib/train/plugins/base_connection.rb:116:in `platform'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/inspec-4.18.51/lib/inspec/resources/platform.rb:18:in `initialize'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/inspec-4.18.51/lib/inspec/plugin/v1/plugin_types/resource.rb:104:in `initialize'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/inspec-4.18.51/lib/inspec/backend.rb:89:in `new'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/inspec-4.18.51/lib/inspec/backend.rb:89:in `block (3 levels) in create'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/inspec-4.18.51/lib/inspec/metadata.rb:68:in `supports_platform?'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/inspec-4.18.51/lib/inspec/profile.rb:148:in `initialize'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/inspec-4.18.51/lib/inspec/profile.rb:60:in `new'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/inspec-4.18.51/lib/inspec/profile.rb:60:in `for_path'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/inspec-4.18.51/lib/inspec/profile.rb:67:in `for_fetcher'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/inspec-4.18.51/lib/inspec/profile.rb:73:in `for_target'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/inspec-4.18.51/lib/inspec/runner.rb:192:in `add_target'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/inspec-4.18.51/lib/inspec/runner.rb:232:in `eval_with_virtual_profile'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/inspec-4.18.51/lib/inspec/cli.rb:404:in `run_command'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/inspec-4.18.51/lib/inspec/cli.rb:304:in `detect'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/inspec-4.18.51/lib/inspec/base_cli.rb:35:in `start'\n\tfrom /hab/pkgs/chef/inspec/4.18.51/20191211220937/lib/gems/inspec-bin-4.18.51/bin/inspec:11:in `

'\n"


Aha! Link: https://chef.aha.io/features/SH-681
@ericcalabretta ericcalabretta added the bug 🐛 Something isn't working label Mar 19, 2020
@vjeffrey
Copy link

vjeffrey commented Mar 19, 2020

likely related to the same issue that forced us to make this change: #3051 (comment)

mmmm. actually now that I read more maybe not?
it probably isn't getting caught by https://github.com/chef/automate/blob/master/components/compliance-service/inspec/cli.go#L244

this isn't the first time this has happened. maybe we should consider returning the full error if we don't recognize it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working customer-reported issues reported by customers
Projects
None yet
Development

No branches or pull requests

3 participants