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] catching only mapper errors #167044

Merged
merged 15 commits into from
Sep 26, 2023
Merged

Conversation

juliaElastic
Copy link
Contributor

@juliaElastic juliaElastic commented Sep 22, 2023

Summary

Closes #162772

Changed the logic to only rollover on mapper errors, will check in ES what are the possible errors.
I think it would be useful to completely fail on unexpected errors instead of hiding bugs (like the simulate template error).

Added 2 flags in package install API to be able to ignore unexpected mapping errors and skip rollover, this can be useful if we want to bypass throwing an error / doing rollover in a support case.

To verify, run the package install API with the flags to skip rollover:

// latest prerelease version in latest main
POST kbn:/api/fleet/epm/packages/apm/8.11.0-preview-1695202343?skipDataStreamRollover=true&ignoreMappingUpdateErrors=true
{
  "force": true
}

// take latest from registry, this installs 8.4.2
POST kbn:/api/fleet/epm/packages/apm?skipDataStreamRollover=true&ignoreMappingUpdateErrors=true
{
  "force": true
}

See in the logs that rollover is skipped:

[2023-09-26T11:29:09.802+02:00][INFO ][plugins.fleet] Mappings update for metrics-apm.internal-default failed due to ResponseError: illegal_argument_exception
        Root causes:
                illegal_argument_exception: Mapper for [clr.gc.gen0size] conflicts with existing mapper:
        Cannot update parameter [index] from [false] to [true]
[2023-09-26T11:29:09.802+02:00][INFO ][plugins.fleet] Skipping rollover for metrics-apm.internal-default as "skipDataStreamRollover" is enabled

Checklist

@juliaElastic juliaElastic added the release_note:skip Skip the PR/issue when compiling release notes label Sep 22, 2023
@juliaElastic juliaElastic requested a review from a team as a code owner September 22, 2023 13:39
@juliaElastic juliaElastic self-assigned this Sep 22, 2023
@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Sep 22, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@apmmachine
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • /oblt-deploy-serverless : Deploy a serverless Kibana instance using the Observability test environments.
  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@juliaElastic juliaElastic marked this pull request as draft September 22, 2023 13:46
return;
}
logger.error(`Mappings update for ${dataStreamName} failed due to unexpected error: ${err}`);
throw err;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

My only concern here is that this might surface existing errors that were ignored before, but I think it's better to see the errors early.

@nchaulet
Copy link
Member

@juliaElastic I think it's a great improvement but I am wondering if we should push that changes with a new flag to bypass mappings update/rollover and log the errors, so we have an escape hatch for future SDH if things go wrong.

@@ -61,6 +61,10 @@ export interface FleetConfigType {
};
};
createArtifactsBulkBatchSize?: number;
packageUpgrade?: {
Copy link
Member

Choose a reason for hiding this comment

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

I am wondering if it make more sense to have these flags on the install package endpoint, so we can apply this on case per case basis, if an error happen or a package upgrade is stuck, wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah that could be easier to apply than a kibana config, the only caveat is that we can't stop Fleet setup to re-run the upgrade if a preconfigured package has an issue.
Though if the API call succeeds, the setup should not try to reinstall the package, so it might be enough to have the flags on the API.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the API flags are ready

Copy link
Member

@nchaulet nchaulet left a comment

Choose a reason for hiding this comment

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

LGTM 🚀 This will be a great tool for future SDHs

@kibana-ci
Copy link
Collaborator

kibana-ci commented Sep 26, 2023

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #32 / serverless observability UI Observability Log Explorer Header menu "before all" hook for "should inject the app header menu on the top navbar"

Metrics [docs]

✅ unchanged

History

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

cc @juliaElastic

Copy link
Member

@kpollich kpollich left a comment

Choose a reason for hiding this comment

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

Looks great thank you!

@juliaElastic
Copy link
Contributor Author

Tests seem to fail due to this issue: #167255

@juliaElastic juliaElastic enabled auto-merge (squash) September 26, 2023 13:26
Copy link
Contributor

@watson watson left a comment

Choose a reason for hiding this comment

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

I've verified that the 26 TypeScript errors coming from x-pack/test/tsconfig.json in the "Check Types Commit Diff" check are not related to this PR and so we can safely merge it as long as the other CI checks are green

@watson watson merged commit 08d44fe into elastic:main Sep 26, 2023
23 of 25 checks passed
@kibanamachine kibanamachine added v8.11.0 backport:skip This commit does not require backporting labels Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v8.11.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Fleet] Throttle package upgrade triggered by setup after stack upgrade
8 participants