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

[Ingest Manager] Split Registry errors into Connection & Response #76558

Merged
merged 2 commits into from
Sep 3, 2020

Conversation

jfsiii
Copy link
Contributor

@jfsiii jfsiii commented Sep 2, 2020

Summary

Pulled out of #74409

  • Add RegistryResponseError for !response.ok responses from the Registry like 4xx/5xx
  • Add RegistryConnectionError for a failure due to exhausted retries of system errors
  • Everything else that fails trying to connect continues to be a RegistryError
  • Change error messages

RegistryResponseError in master vs PR

- "Error connecting to package registry at http://localhost:8080/search?package=aws&internal=true&experimental=true: Error connecting to package registry at http://localhost:8080/search?package=aws&internal=true&experimental=true: Too Many Requests"
+ "'429 Too Many Requests' error response from package registry at http://localhost:8080/search?package=aws&internal=true&experimental=true"

RegistryConnectionError in master vs PR

- "Error connecting to package registry at http://localhost:8080/search?package=aws&internal=true&experimental=true: request to http://localhost:8080/search?package=aws&internal=true&experimental=true failed, reason: connect ECONNREFUSED 127.0.0.1:8080"
+ "Error connecting to package registry: request to http://localhost:8080/package/system/0.5.3 failed, reason: connect ECONNREFUSED 127.0.0.1:8080"

Checklist

  setupIngestManager
    fetchUrl / getResponse errors
      ✓ regular Errors do not retry. Becomes RegistryError (8ms)
      ✓ TypeErrors do not retry. Becomes RegistryError (1ms)
      only system errors retry (like ECONNRESET)
        ✓ they eventually succeed (7012ms)
        ✓ or error after 1 failure & 5 retries with RegistryConnectionError (31020ms)
      4xx or 5xx from Registry become RegistryResponseError
        ✓ 404 (2ms)
        ✓ 429 (2ms)
        ✓ 500 (2ms)
      url in RegistryResponseError message is response.url || requested_url
        ✓ given response.url, use that (2ms)
        ✓ no response.url, use requested url (1ms)

@jfsiii jfsiii added the Team:Fleet Team label for Observability Data Collection Fleet team label Sep 2, 2020
@@ -53,13 +53,7 @@ describe('setupIngestManager', () => {
throw new FetchError('message 3', 'system', { code: 'ESOMETHING' });
})
// this one succeeds
.mockImplementationOnce(() => Promise.resolve(new Response(successValue)))
.mockImplementationOnce(() => {
Copy link
Contributor Author

@jfsiii jfsiii Sep 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving these extra mock responses was messing up counts in later tests. Confirmed real behavior was expected. Assume issue is in clearing mocks, but decided to just drop these.

@jfsiii jfsiii marked this pull request as ready for review September 2, 2020 21:32
@jfsiii jfsiii requested a review from a team September 2, 2020 21:32
@elasticmachine
Copy link
Contributor

Pinging @elastic/ingest-management (Team:Ingest Management)

@jfsiii jfsiii added release_note:skip Skip the PR/issue when compiling release notes v7.10.0 v8.0.0 apm:test-plan-7.9.0 Test plan for 7.9 release v7.9.2 and removed apm:test-plan-7.9.0 Test plan for 7.9 release labels Sep 2, 2020
Comment on lines -22 to -25
if (error instanceof PackageOutdatedError) {
return 400;
} else {
return 400; // Bad Request
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If and else both returned 400, so I combined them

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@ruflin
Copy link
Contributor

ruflin commented Sep 3, 2020

These error message are much nicer. Do we log these errors into the Kibana log file?

@jfsiii jfsiii merged commit 2db7895 into elastic:master Sep 3, 2020
jloleysens added a commit to jloleysens/kibana that referenced this pull request Sep 3, 2020
…nes/processors-forms-k-s

* 'master' of github.com:elastic/kibana: (216 commits)
  [Ingest Manager] Split Registry errors into Connection & Response (elastic#76558)
  [Security Solution] add an excess validation instead of the exact match (elastic#76472)
  Introduce TS incremental builds & move src/test_utils to TS project  (elastic#76082)
  fix bad merge (elastic#76629)
  [Newsfeed] Ensure the version format when calling the API (elastic#76381)
  remove server_extensions mixin (elastic#76606)
  Remove legacy applications and legacy mode (elastic#75987)
  [Discover] Fix sidebar element focus behavior when adding / removing columns (elastic#75749)
  Replace FetchOptions with ISearchOptions (elastic#76538)
  Move streams utils to the core  (elastic#76397)
  [Ingest Manager] Wording & linking improvements (elastic#76284)
  remove legacy kibana plugin (elastic#76064)
  [Form lib] Fix regression on field not being validated after reset to its default value. (elastic#76379)
  Legacy SO import: Fix bug causing multiple overrides to only show the last confirm modal (elastic#76482)
  [APM] Service maps layout enhancements (elastic#76481)
  [Security Solution][Detection Engine] Remove RuleTypeSchema in favor of Type for TypeScript (elastic#76586)
  [Security Solution][Exceptions] - Updates enum schema and tests (elastic#76544)
  Index Pattern class - remove toJSON and toString (elastic#76246)
  skip failing suite (elastic#76581)
  Split up and clarify Enterprise Search codeowners (elastic#76580)
  ...

# Conflicts:
#	x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processor_settings_fields.tsx
#	x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/foreach.tsx
jloleysens added a commit to jloleysens/kibana that referenced this pull request Sep 3, 2020
…oleysens/kibana into ingest-pipelines/processors-forms-k-s

* 'ingest-pipelines/processors-forms-k-s' of github.com:jloleysens/kibana: (216 commits)
  [Ingest Manager] Split Registry errors into Connection & Response (elastic#76558)
  [Security Solution] add an excess validation instead of the exact match (elastic#76472)
  Introduce TS incremental builds & move src/test_utils to TS project  (elastic#76082)
  fix bad merge (elastic#76629)
  [Newsfeed] Ensure the version format when calling the API (elastic#76381)
  remove server_extensions mixin (elastic#76606)
  Remove legacy applications and legacy mode (elastic#75987)
  [Discover] Fix sidebar element focus behavior when adding / removing columns (elastic#75749)
  Replace FetchOptions with ISearchOptions (elastic#76538)
  Move streams utils to the core  (elastic#76397)
  [Ingest Manager] Wording & linking improvements (elastic#76284)
  remove legacy kibana plugin (elastic#76064)
  [Form lib] Fix regression on field not being validated after reset to its default value. (elastic#76379)
  Legacy SO import: Fix bug causing multiple overrides to only show the last confirm modal (elastic#76482)
  [APM] Service maps layout enhancements (elastic#76481)
  [Security Solution][Detection Engine] Remove RuleTypeSchema in favor of Type for TypeScript (elastic#76586)
  [Security Solution][Exceptions] - Updates enum schema and tests (elastic#76544)
  Index Pattern class - remove toJSON and toString (elastic#76246)
  skip failing suite (elastic#76581)
  Split up and clarify Enterprise Search codeowners (elastic#76580)
  ...
gmmorris added a commit to gmmorris/kibana that referenced this pull request Sep 3, 2020
* master: (340 commits)
  [data.search.SearchSource] Remove legacy ES client APIs. (elastic#75943)
  [release notes] automatically retry on Github API 5xx errors (elastic#76447)
  [es_ui_shared] Fix eslint exhaustive deps rule (elastic#76392)
  [i18n] Integrate 7.9.1 Translations (elastic#76391)
  [APM] Update aggregations to support script sources (elastic#76429)
  [Security Solution] Refactor Network Top Countries to use Search Strategy (elastic#76244)
  Document security settings available on ESS (elastic#76513)
  [Ingest Manager] Add input revision to the config send to the agent (elastic#76327)
  [DOCS] Identifies cloud settings for Monitoring (elastic#76579)
  [DOCS] Identifies Cloud settings in Dev Tools (elastic#76583)
  [Ingest Manager] Better default value for fleet long polling timeout (elastic#76393)
  [data.indexPatterns] Fix broken rollup index pattern creation (elastic#76593)
  [Ingest Manager] Split Registry errors into Connection & Response (elastic#76558)
  [Security Solution] add an excess validation instead of the exact match (elastic#76472)
  Introduce TS incremental builds & move src/test_utils to TS project  (elastic#76082)
  fix bad merge (elastic#76629)
  [Newsfeed] Ensure the version format when calling the API (elastic#76381)
  remove server_extensions mixin (elastic#76606)
  Remove legacy applications and legacy mode (elastic#75987)
  [Discover] Fix sidebar element focus behavior when adding / removing columns (elastic#75749)
  ...
jfsiii pushed a commit that referenced this pull request Sep 3, 2020
…6558) (#76636)

* Split Registry errors into Connection & Response

* Ensure a url in ResponseError message. Add tests
# Conflicts:
#	x-pack/plugins/ingest_manager/server/errors.ts
jfsiii pushed a commit that referenced this pull request Sep 3, 2020
…6558) (#76634)

* Split Registry errors into Connection & Response

* Ensure a url in ResponseError message. Add tests
@jfsiii
Copy link
Contributor Author

jfsiii commented Sep 3, 2020

@ruflin not directly in this PR, but they are in #74409 and will be in others

@ghost
Copy link

ghost commented Sep 18, 2020

Hi @nchaulet

We have gone through the ticket and observed it required DEV_Validation to test the ticket .

Please let us know if anything is missing from our end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v7.9.2 v7.10.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants