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

[Fleet] Don't error on missing package_assets value #91744

Merged
merged 3 commits into from
Feb 19, 2021

Conversation

jfsiii
Copy link
Contributor

@jfsiii jfsiii commented Feb 17, 2021

Summary

closes #89111

  • Update TS type to make package_assets key in EPM packages saved object optional
  • Update two places in code to deal with optional vs required property

Checklist

Manual testing

  1. checkout 7.10 branch
    1. start ES: nvm use; yarn kbn bootstrap; yarn es snapshot --version 7.10.3 --license=trial -E xpack.security.authc.api_key.enabled=true -E path.data=../data
    2. start Kibana: yarn start --no-base-path
    3. run curl -X POST -H 'kbn-xsrf: 1234' --user elastic:changeme localhost:5601/api/fleet/setup
    4. observe {"is_initialized: true}
  2. checkout 7.11 branch
    1. start ES: nvm use; yarn kbn bootstrap; yarn es snapshot --version 7.11.1 --license=trial -E xpack.security.authc.api_key.enabled=true -E path.data=../data
    2. start Kibana: yarn start --no-base-path
    3. run curl -X POST -H 'kbn-xsrf: 1234' --user elastic:changeme localhost:5601/api/fleet/setup
    4. observe {"is_initialized: true}
  3. checkout master branch
    1. start ES: nvm use; yarn kbn bootstrap; yarn es snapshot --version 8.0.0 --license=trial -E xpack.security.authc.api_key.enabled=true -E path.data=../data
    2. start Kibana: yarn start --no-base-path
    3. run curl -X POST -H 'kbn-xsrf: 1234' --user elastic:changeme localhost:5601/api/fleet/setup
    4. observe error {"statusCode":500,"error":"Internal Server Error","message":"Cannot read property 'map' of undefined"}
  4. checkout this PR 8911-fleet-startup-error
    1. start ES: nvm use; yarn kbn bootstrap; yarn es snapshot --version 8.0.0 --license=trial -E xpack.security.authc.api_key.enabled=true -E path.data=../data
    2. start Kibana: yarn start --no-base-path
    3. run curl -X POST -H 'kbn-xsrf: 1234' --user elastic:changeme localhost:5601/api/fleet/setup
    4. observe success {"is_initialized: true}

Notes

  • you might need to do a yarn kbn clean when starting kibana if it fails. There have been some big changes in the tooling recently

@jfsiii
Copy link
Contributor Author

jfsiii commented Feb 18, 2021

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

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

@jfsiii jfsiii marked this pull request as ready for review February 18, 2021 19:39
@jfsiii jfsiii requested a review from a team as a code owner February 18, 2021 19:39
@jfsiii jfsiii added release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v7.12.0 labels Feb 18, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@jfsiii jfsiii added the bug Fixes for quality problems that affect the customer experience label Feb 18, 2021
Copy link
Contributor

@jen-huang jen-huang left a comment

Choose a reason for hiding this comment

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

Code LGTM 🚀

Copy link
Contributor

@skh skh left a comment

Choose a reason for hiding this comment

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

I can reproduce the problem on master, and I verified that this change fixes it. 🚀

@jfsiii jfsiii added the auto-backport Deprecated - use backport:version if exact versions are needed label Feb 19, 2021
@jfsiii jfsiii merged commit 5bfcc09 into elastic:master Feb 19, 2021
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Feb 19, 2021
## Summary
closes elastic#89111

 * Update TS type to make `package_assets` key in EPM packages saved object optional
 * Update two places in code to deal with optional vs required property

### Checklist

- [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios

#### Manual testing
1. checkout `7.10` branch
   1. **start ES:** `nvm use; yarn kbn bootstrap; yarn es snapshot --version 7.10.3 --license=trial  -E xpack.security.authc.api_key.enabled=true -E path.data=../data`
   1. **start Kibana**: `yarn start --no-base-path`
   1. **run** `curl -X POST -H 'kbn-xsrf: 1234' --user elastic:changeme localhost:5601/api/fleet/setup`
   2. **observe** `{"is_initialized: true}`
1. checkout `7.11` branch
   1. **start ES:** `nvm use; yarn kbn bootstrap; yarn es snapshot --version 7.11.1 --license=trial  -E xpack.security.authc.api_key.enabled=true -E path.data=../data`
   1. **start Kibana**: `yarn start --no-base-path`
   1. **run** `curl -X POST -H 'kbn-xsrf: 1234' --user elastic:changeme localhost:5601/api/fleet/setup`
   1. **observe** `{"is_initialized: true}`
1. checkout `master` branch
   1. **start ES:** `nvm use; yarn kbn bootstrap; yarn es snapshot --version 8.0.0 --license=trial  -E xpack.security.authc.api_key.enabled=true -E path.data=../data`
   1. **start Kibana**: `yarn start --no-base-path`
   1. **run** `curl -X POST -H 'kbn-xsrf: 1234' --user elastic:changeme localhost:5601/api/fleet/setup`
   1. **observe error** {"statusCode":500,"error":"Internal Server Error","message":"Cannot read property 'map' of undefined"}
1. checkout this PR `8911-fleet-startup-error`
   1. **start ES:** `nvm use; yarn kbn bootstrap; yarn es snapshot --version 8.0.0 --license=trial  -E xpack.security.authc.api_key.enabled=true -E path.data=../data`
   1. **start Kibana**: `yarn start --no-base-path`
   1. **run** `curl -X POST -H 'kbn-xsrf: 1234' --user elastic:changeme localhost:5601/api/fleet/setup`
   1. **observe success** `{"is_initialized: true}`

**_Notes_**
 * _you might need to do a `yarn kbn clean` when starting kibana if it fails. There have been some big changes in the tooling recently_
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Feb 19, 2021
## Summary
closes elastic#89111

 * Update TS type to make `package_assets` key in EPM packages saved object optional
 * Update two places in code to deal with optional vs required property

### Checklist

- [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios

#### Manual testing
1. checkout `7.10` branch
   1. **start ES:** `nvm use; yarn kbn bootstrap; yarn es snapshot --version 7.10.3 --license=trial  -E xpack.security.authc.api_key.enabled=true -E path.data=../data`
   1. **start Kibana**: `yarn start --no-base-path`
   1. **run** `curl -X POST -H 'kbn-xsrf: 1234' --user elastic:changeme localhost:5601/api/fleet/setup`
   2. **observe** `{"is_initialized: true}`
1. checkout `7.11` branch
   1. **start ES:** `nvm use; yarn kbn bootstrap; yarn es snapshot --version 7.11.1 --license=trial  -E xpack.security.authc.api_key.enabled=true -E path.data=../data`
   1. **start Kibana**: `yarn start --no-base-path`
   1. **run** `curl -X POST -H 'kbn-xsrf: 1234' --user elastic:changeme localhost:5601/api/fleet/setup`
   1. **observe** `{"is_initialized: true}`
1. checkout `master` branch
   1. **start ES:** `nvm use; yarn kbn bootstrap; yarn es snapshot --version 8.0.0 --license=trial  -E xpack.security.authc.api_key.enabled=true -E path.data=../data`
   1. **start Kibana**: `yarn start --no-base-path`
   1. **run** `curl -X POST -H 'kbn-xsrf: 1234' --user elastic:changeme localhost:5601/api/fleet/setup`
   1. **observe error** {"statusCode":500,"error":"Internal Server Error","message":"Cannot read property 'map' of undefined"}
1. checkout this PR `8911-fleet-startup-error`
   1. **start ES:** `nvm use; yarn kbn bootstrap; yarn es snapshot --version 8.0.0 --license=trial  -E xpack.security.authc.api_key.enabled=true -E path.data=../data`
   1. **start Kibana**: `yarn start --no-base-path`
   1. **run** `curl -X POST -H 'kbn-xsrf: 1234' --user elastic:changeme localhost:5601/api/fleet/setup`
   1. **observe success** `{"is_initialized: true}`

**_Notes_**
 * _you might need to do a `yarn kbn clean` when starting kibana if it fails. There have been some big changes in the tooling recently_
@kibanamachine
Copy link
Contributor

💚 Backport successful

7.12 / #92002
7.x / #92003

Successful backport PRs will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request Feb 19, 2021
## Summary
closes #89111

 * Update TS type to make `package_assets` key in EPM packages saved object optional
 * Update two places in code to deal with optional vs required property

### Checklist

- [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios

#### Manual testing
1. checkout `7.10` branch
   1. **start ES:** `nvm use; yarn kbn bootstrap; yarn es snapshot --version 7.10.3 --license=trial  -E xpack.security.authc.api_key.enabled=true -E path.data=../data`
   1. **start Kibana**: `yarn start --no-base-path`
   1. **run** `curl -X POST -H 'kbn-xsrf: 1234' --user elastic:changeme localhost:5601/api/fleet/setup`
   2. **observe** `{"is_initialized: true}`
1. checkout `7.11` branch
   1. **start ES:** `nvm use; yarn kbn bootstrap; yarn es snapshot --version 7.11.1 --license=trial  -E xpack.security.authc.api_key.enabled=true -E path.data=../data`
   1. **start Kibana**: `yarn start --no-base-path`
   1. **run** `curl -X POST -H 'kbn-xsrf: 1234' --user elastic:changeme localhost:5601/api/fleet/setup`
   1. **observe** `{"is_initialized: true}`
1. checkout `master` branch
   1. **start ES:** `nvm use; yarn kbn bootstrap; yarn es snapshot --version 8.0.0 --license=trial  -E xpack.security.authc.api_key.enabled=true -E path.data=../data`
   1. **start Kibana**: `yarn start --no-base-path`
   1. **run** `curl -X POST -H 'kbn-xsrf: 1234' --user elastic:changeme localhost:5601/api/fleet/setup`
   1. **observe error** {"statusCode":500,"error":"Internal Server Error","message":"Cannot read property 'map' of undefined"}
1. checkout this PR `8911-fleet-startup-error`
   1. **start ES:** `nvm use; yarn kbn bootstrap; yarn es snapshot --version 8.0.0 --license=trial  -E xpack.security.authc.api_key.enabled=true -E path.data=../data`
   1. **start Kibana**: `yarn start --no-base-path`
   1. **run** `curl -X POST -H 'kbn-xsrf: 1234' --user elastic:changeme localhost:5601/api/fleet/setup`
   1. **observe success** `{"is_initialized: true}`

**_Notes_**
 * _you might need to do a `yarn kbn clean` when starting kibana if it fails. There have been some big changes in the tooling recently_

Co-authored-by: John Schulz <john.schulz@elastic.co>
gmmorris added a commit to gmmorris/kibana that referenced this pull request Feb 19, 2021
* master: (111 commits)
  [Logs UI] Replace dependencies in the infra bundle (elastic#91503)
  [Search Source] Do not request unmapped fields if source filters are provided (elastic#91921)
  [APM] Kql Search Bar suggests values outside the selected time range (elastic#91918)
  Refactored component edit policy tests into separate folders and using client integration testing setup (elastic#91657)
  [Fleet] Don't error on missing package_assets value (elastic#91744)
  [Lens] Pass used histogram interval to chart (elastic#91370)
  [Indexpattern management] Use indexPatterns Service instead of savedObjects client (elastic#91839)
  [Security Solutions] Fixes Cypress tests for indicator match by making the selectors more specific (elastic#91947)
  [CI] backportrc can skip CI (elastic#91886)
  Revert "[SOM] fix flaky suites (elastic#91809)"
  [Fleet] Install Elastic Agent integration by default during setup (elastic#91676)
  [Fleet] Silently swallow 404 errors when deleting ingest pipelines (elastic#91778)
  [data.search] Use incrementCounter for search telemetry (elastic#91230)
  [Fleet] Bootstrap functional test suite (elastic#91898)
  [Alerts][Docs] Added API documentation for alerts plugin (elastic#91067)
  Use correct environment in anomaly detection setup link (elastic#91877)
  [FTSR] Convert to tasks and add jest/api integration suites (elastic#91770)
  [CI] Build and publish storybooks (elastic#87701)
  docs: add PHP agent info to docs (elastic#91773)
  [DOCS] Adds and updates Visualization advanced settings (elastic#91904)
  ...
kibanamachine added a commit that referenced this pull request Feb 19, 2021
## Summary
closes #89111

 * Update TS type to make `package_assets` key in EPM packages saved object optional
 * Update two places in code to deal with optional vs required property

### Checklist

- [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios

#### Manual testing
1. checkout `7.10` branch
   1. **start ES:** `nvm use; yarn kbn bootstrap; yarn es snapshot --version 7.10.3 --license=trial  -E xpack.security.authc.api_key.enabled=true -E path.data=../data`
   1. **start Kibana**: `yarn start --no-base-path`
   1. **run** `curl -X POST -H 'kbn-xsrf: 1234' --user elastic:changeme localhost:5601/api/fleet/setup`
   2. **observe** `{"is_initialized: true}`
1. checkout `7.11` branch
   1. **start ES:** `nvm use; yarn kbn bootstrap; yarn es snapshot --version 7.11.1 --license=trial  -E xpack.security.authc.api_key.enabled=true -E path.data=../data`
   1. **start Kibana**: `yarn start --no-base-path`
   1. **run** `curl -X POST -H 'kbn-xsrf: 1234' --user elastic:changeme localhost:5601/api/fleet/setup`
   1. **observe** `{"is_initialized: true}`
1. checkout `master` branch
   1. **start ES:** `nvm use; yarn kbn bootstrap; yarn es snapshot --version 8.0.0 --license=trial  -E xpack.security.authc.api_key.enabled=true -E path.data=../data`
   1. **start Kibana**: `yarn start --no-base-path`
   1. **run** `curl -X POST -H 'kbn-xsrf: 1234' --user elastic:changeme localhost:5601/api/fleet/setup`
   1. **observe error** {"statusCode":500,"error":"Internal Server Error","message":"Cannot read property 'map' of undefined"}
1. checkout this PR `8911-fleet-startup-error`
   1. **start ES:** `nvm use; yarn kbn bootstrap; yarn es snapshot --version 8.0.0 --license=trial  -E xpack.security.authc.api_key.enabled=true -E path.data=../data`
   1. **start Kibana**: `yarn start --no-base-path`
   1. **run** `curl -X POST -H 'kbn-xsrf: 1234' --user elastic:changeme localhost:5601/api/fleet/setup`
   1. **observe success** `{"is_initialized: true}`

**_Notes_**
 * _you might need to do a `yarn kbn clean` when starting kibana if it fails. There have been some big changes in the tooling recently_

Co-authored-by: John Schulz <john.schulz@elastic.co>
@jfsiii jfsiii deleted the 8911-fleet-startup-error branch April 6, 2021 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed bug Fixes for quality problems that affect the customer experience release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v7.12.0 v7.13.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Ingest Management] 'Cannot read property 'map' of undefined' error accessing to fleet
5 participants