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

[APM] Catch annotations index permission error and log warning #69881

Merged

Conversation

dgieselaar
Copy link
Member

Relates to #69642. If the user doesn't have the appropriate privileges for the annotations index, instead of failing with a 500, we now catch the error and log a warning to the console.

Relates to elastic#69642. If the user doesn't have the appropriate privileges for the annotations index, instead of failing with a 500, we now catch the error and log a warning to the console.
@dgieselaar dgieselaar requested a review from a team as a code owner June 25, 2020 06:25
@botelastic botelastic bot added the Team:APM All issues that need APM UI Team support label Jun 25, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/apm-ui (Team:apm)

Copy link
Contributor

@ogupte ogupte left a comment

Choose a reason for hiding this comment

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

LGTM

@dgieselaar dgieselaar added release_note:skip Skip the PR/issue when compiling release notes v7.8.1 v7.9.0 labels Jun 25, 2020
@kibanamachine
Copy link
Contributor

💛 Build succeeded, but was flaky


Test Failures

Kibana Pipeline / kibana-xpack-agent / Firefox XPack UI Functional Tests.x-pack/test/functional/apps/infra/home_page·ts.InfraOps app Home page without metrics present renders an empty data prompt

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has failed 2 times on tracked branches: https://github.com/elastic/kibana/issues/69605

[00:00:00]       │
[00:07:47]         └-: InfraOps app
[00:07:47]           └-> "before all" hook
[00:07:47]           └-: Home page
[00:07:47]             └-> "before all" hook
[00:07:47]             └-> "before all" hook
[00:07:47]               │ info [empty_kibana] Loading "mappings.json"
[00:07:47]               │ info [o.e.c.m.MetadataDeleteIndexService] [kibana-ci-immutable-ubuntu-18-tests-xl-1593066354554299341] [.kibana_1/UBW3T1g0Q7aUVkD2RCEvKw] deleting index
[00:07:47]               │ info [o.e.c.m.MetadataDeleteIndexService] [kibana-ci-immutable-ubuntu-18-tests-xl-1593066354554299341] [.kibana_2/BcD0n2ZzT6SxqGCN2f98UA] deleting index
[00:07:47]               │ info [empty_kibana] Deleted existing index [".kibana_2",".kibana_1"]
[00:07:47]               │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-18-tests-xl-1593066354554299341] [.kibana] creating index, cause [api], templates [], shards [1]/[1], mappings [_doc]
[00:07:47]               │ info [empty_kibana] Created index ".kibana"
[00:07:47]               │ debg [empty_kibana] ".kibana" settings {"index":{"number_of_replicas":"1","number_of_shards":"1"}}
[00:07:47]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-18-tests-xl-1593066354554299341] [.kibana/JUL3mP8VSPG9FtASavlpwg] update_mapping [_doc]
[00:07:47]               │ debg Migrating saved objects
[00:07:47]               │ proc [kibana]   log   [07:06:41.144] [info][savedobjects-service] Creating index .kibana_2.
[00:07:47]               │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-18-tests-xl-1593066354554299341] [.kibana_2] creating index, cause [api], templates [], shards [1]/[1], mappings [_doc]
[00:07:47]               │ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-ubuntu-18-tests-xl-1593066354554299341] updating number_of_replicas to [0] for indices [.kibana_2]
[00:07:47]               │ proc [kibana]   log   [07:06:41.273] [info][savedobjects-service] Reindexing .kibana to .kibana_1
[00:07:47]               │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-18-tests-xl-1593066354554299341] [.kibana_1] creating index, cause [api], templates [], shards [1]/[1], mappings [_doc]
[00:07:47]               │ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-ubuntu-18-tests-xl-1593066354554299341] updating number_of_replicas to [0] for indices [.kibana_1]
[00:07:47]               │ info [o.e.t.LoggingTaskListener] [kibana-ci-immutable-ubuntu-18-tests-xl-1593066354554299341] 6505 finished with response BulkByScrollResponse[took=1.9ms,timed_out=false,sliceId=null,updated=0,created=0,deleted=0,batches=0,versionConflicts=0,noops=0,retries=0,throttledUntil=0s,bulk_failures=[],search_failures=[]]
[00:07:48]               │ info [o.e.c.m.MetadataDeleteIndexService] [kibana-ci-immutable-ubuntu-18-tests-xl-1593066354554299341] [.kibana/JUL3mP8VSPG9FtASavlpwg] deleting index
[00:07:48]               │ proc [kibana]   log   [07:06:41.717] [info][savedobjects-service] Migrating .kibana_1 saved objects to .kibana_2
[00:07:48]               │ proc [kibana]   log   [07:06:41.723] [info][savedobjects-service] Pointing alias .kibana to .kibana_2.
[00:07:48]               │ proc [kibana]   log   [07:06:41.774] [info][savedobjects-service] Finished in 632ms.
[00:07:48]               │ debg applying update to kibana config: {"accessibility:disableAnimations":true,"dateFormat:tz":"UTC"}
[00:07:48]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-18-tests-xl-1593066354554299341] [.kibana_2/NP7vPZrWT5WEBO_uuwvvfg] update_mapping [_doc]
[00:07:48]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-18-tests-xl-1593066354554299341] [.kibana_2/NP7vPZrWT5WEBO_uuwvvfg] update_mapping [_doc]
[00:07:48]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-18-tests-xl-1593066354554299341] [.kibana_2/NP7vPZrWT5WEBO_uuwvvfg] update_mapping [_doc]
[00:07:49]             └-: without metrics present
[00:07:49]               └-> "before all" hook
[00:07:49]               └-> "before all" hook
[00:07:49]                 │ info [infra/metrics_and_logs] Unloading indices from "mappings.json"
[00:07:49]                 │ info [infra/metrics_and_logs] Unloading indices from "data.json.gz"
[00:07:50]               └-> renders an empty data prompt
[00:07:50]                 └-> "before each" hook: global before each
[00:07:50]                 │ debg navigating to infraOps url: http://localhost:6111/app/metrics
[00:07:50]                 │ debg navigate to: http://localhost:6111/app/metrics
[00:07:50]                 │ debg browser[log] "^ A single error about an inline script not firing due to content security policy is expected!"
[00:07:51]                 │ debg ... sleep(700) start
[00:07:51]                 │ debg ... sleep(700) end
[00:07:51]                 │ debg returned from get, calling refresh
[00:07:53]                 │ debg browser[info] "INFO: 2020-06-25T07:06:46Z
[00:07:53]                 │        Adding connection to http://localhost:6111/elasticsearch
[00:07:53]                 │
[00:07:53]                 │      "
[00:07:54]                 │ERROR browser[error] (new TypeError("NetworkError when attempting to fetch resource.", ""))
[00:07:54]                 │ debg browser[log] "^ A single error about an inline script not firing due to content security policy is expected!"
[00:07:54]                 │ debg currentUrl = http://localhost:6111/app/metrics
[00:07:54]                 │          appUrl = http://localhost:6111/app/metrics
[00:07:54]                 │ debg TestSubjects.find(kibanaChrome)
[00:07:54]                 │ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"]') with timeout=60000
[00:08:03]                 │ debg browser[info] "INFO: 2020-06-25T07:06:56Z
[00:08:03]                 │        Adding connection to http://localhost:6111/elasticsearch
[00:08:03]                 │
[00:08:03]                 │      "
[00:08:04]                 │ debg ... sleep(501) start
[00:08:04]                 │ debg ... sleep(501) end
[00:08:04]                 │ debg in navigateTo url = http://localhost:6111/app/metrics
[00:08:04]                 │ debg TestSubjects.exists(statusPageContainer)
[00:08:04]                 │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="statusPageContainer"]') with timeout=2500
[00:08:07]                 │ debg --- retry.tryForTime error: [data-test-subj="statusPageContainer"] is not displayed
[00:08:07]                 │ debg TestSubjects.find(noMetricsIndicesPrompt)
[00:08:07]                 │ debg Find.findByCssSelector('[data-test-subj="noMetricsIndicesPrompt"]') with timeout=10000
[00:08:18]                 │ info Taking screenshot "/dev/shm/workspace/kibana/x-pack/test/functional/screenshots/failure/InfraOps app Home page without metrics present renders an empty data prompt.png"
[00:08:18]                 │ info Current URL is: http://localhost:6111/app/metrics/inventory?waffleFilter=(expression%3A''%2Ckind%3Akuery)&waffleTime=(currentTime%3A1593068831697%2CisAutoReloading%3A!f)&waffleOptions=(accountId%3A''%2CautoBounds%3A!t%2CboundsOverride%3A(max%3A1%2Cmin%3A0)%2CcustomMetrics%3A!()%2CcustomOptions%3A!()%2CgroupBy%3A!()%2Clegend%3A(palette%3Acool%2CreverseColors%3A!f%2Csteps%3A10)%2Cmetric%3A(type%3Acpu)%2CnodeType%3Ahost%2Cregion%3A''%2Csort%3A(by%3Aname%2Cdirection%3Adesc)%2Cview%3Amap)
[00:08:18]                 │ info Saving page source to: /dev/shm/workspace/kibana/x-pack/test/functional/failure_debug/html/InfraOps app Home page without metrics present renders an empty data prompt.html
[00:08:18]                 └- ✖ fail: "InfraOps app Home page without metrics present renders an empty data prompt"
[00:08:18]                 │

Stack Trace

{ TimeoutError: Waiting for element to be located By(css selector, [data-test-subj="noMetricsIndicesPrompt"])
Wait timed out after 10489ms
    at /dev/shm/workspace/kibana/node_modules/selenium-webdriver/lib/webdriver.js:842:17
    at process._tickCallback (internal/process/next_tick.js:68:7) name: 'TimeoutError', remoteStacktrace: '' }

Build metrics

✅ unchanged

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

@dgieselaar dgieselaar merged commit 589d6ff into elastic:master Jun 25, 2020
@dgieselaar dgieselaar deleted the catch-annotations-permissions-error branch June 25, 2020 14:55
dgieselaar added a commit to dgieselaar/kibana that referenced this pull request Jun 25, 2020
…ic#69881)

Relates to elastic#69642. If the user doesn't have the appropriate privileges for the annotations index, instead of failing with a 500, we now catch the error and log a warning to the console.
dgieselaar added a commit to dgieselaar/kibana that referenced this pull request Jun 25, 2020
…ic#69881)

Relates to elastic#69642. If the user doesn't have the appropriate privileges for the annotations index, instead of failing with a 500, we now catch the error and log a warning to the console.
# Conflicts:
#	x-pack/plugins/apm/server/routes/services.ts
gmmorris added a commit to gmmorris/kibana that referenced this pull request Jun 25, 2020
* master: (90 commits)
  [Encrypted Saved Objects] Adds support for migrations in ESO (elastic#69513)
  [SIEM] Replace WithSource with useWithSource hook (elastic#68722)
  [Endpoint]EMT-451: add ability to filter endpoint metadata based on presence of unenrolled events (elastic#69708)
  rename old siem kibana config to securitySolution (elastic#69874)
  Remove unused Resolver code (elastic#69914)
  [Observability] Fixing dynamic return type based on the appName (elastic#69894)
  [SECURITY SOLUTION][INGEST] Task/endpoint list tests (elastic#69419)
  Fixes special clicks and 3rd party icon sizes in nav (elastic#69767)
  [APM] Catch annotations index permission error and log warning (elastic#69881)
  [Endpoint][Ingest Manager] minor code cleanup (elastic#69844)
  [Logs UI] Logs ui context menu (elastic#69915)
  Index pattern serialize and de-serialize (elastic#68844)
  [QA] Unskip functional tests (elastic#69760)
  [SIEM][Detection Engine] - Update DE to work with new exceptions schema (elastic#69715)
  Fixes elastic#69639: Ignore url.url fields above 2048 characters (elastic#69863)
  PR: Provide limit warnings to user when API limits are reached. (elastic#69590)
  [Maps] Remove broken button (elastic#69853)
  Makes usage collection methods available on start (elastic#69836)
  [SIEM][CASE] Improve Jira's labelling (elastic#69892)
  [Logs UI] Access ML via the programmatic plugin API (elastic#68905)
  ...
dgieselaar added a commit that referenced this pull request Jun 25, 2020
Relates to #69642. If the user doesn't have the appropriate privileges for the annotations index, instead of failing with a 500, we now catch the error and log a warning to the console.
dgieselaar added a commit that referenced this pull request Jun 25, 2020
Relates to #69642. If the user doesn't have the appropriate privileges for the annotations index, instead of failing with a 500, we now catch the error and log a warning to the console.
# Conflicts:
#	x-pack/plugins/apm/server/routes/services.ts
gmmorris added a commit to gmmorris/kibana that referenced this pull request Jun 26, 2020
* master:
  [Encrypted Saved Objects] Adds support for migrations in ESO (elastic#69513)
  [SIEM] Replace WithSource with useWithSource hook (elastic#68722)
  [Endpoint]EMT-451: add ability to filter endpoint metadata based on presence of unenrolled events (elastic#69708)
  rename old siem kibana config to securitySolution (elastic#69874)
  Remove unused Resolver code (elastic#69914)
  [Observability] Fixing dynamic return type based on the appName (elastic#69894)
  [SECURITY SOLUTION][INGEST] Task/endpoint list tests (elastic#69419)
  Fixes special clicks and 3rd party icon sizes in nav (elastic#69767)
  [APM] Catch annotations index permission error and log warning (elastic#69881)
  [Endpoint][Ingest Manager] minor code cleanup (elastic#69844)
  [Logs UI] Logs ui context menu (elastic#69915)
  Index pattern serialize and de-serialize (elastic#68844)
@sorenlouv sorenlouv added the apm:test-plan-7.9.0 Test plan for 7.9 release label Jul 16, 2020
@cauemarcondes cauemarcondes self-assigned this Aug 3, 2020
@cauemarcondes
Copy link
Contributor

Tests ok
Screenshot 2020-08-03 at 15 48 21

@cauemarcondes cauemarcondes added the apm:test-plan-done Pull request that was successfully tested during the test plan label Aug 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apm:test-plan-7.9.0 Test plan for 7.9 release apm:test-plan-done Pull request that was successfully tested during the test plan release_note:skip Skip the PR/issue when compiling release notes Team:APM All issues that need APM UI Team support v7.8.1 v7.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants