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] fix latest_executed_state error #212935

Merged
merged 3 commits into from
Mar 3, 2025

Conversation

juliaElastic
Copy link
Contributor

@juliaElastic juliaElastic commented Mar 3, 2025

Fix schema validation error when latest_executed_state: {}.

The logic sets an empty object here:


This caused an error on the Integration Details page:

Failed output validation: [response body.items.4.installationInfo.latest_executed_state.name]: expected value of type [string] but got [undefined]

Tested locally by manually updating latest_executed_state to {}, now the /epm/packages API works as expected.

image

@juliaElastic juliaElastic added release_note:skip Skip the PR/issue when compiling release notes backport:prev-minor Backport to (9.0) the previous minor version (i.e. one version back from main) backport:prev-major Backport to (8.x, 8.18, 8.17, 8.16) the previous major branch and other branches in development labels Mar 3, 2025
@juliaElastic juliaElastic self-assigned this Mar 3, 2025
@juliaElastic juliaElastic requested a review from a team as a code owner March 3, 2025 15:33
@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Mar 3, 2025
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.

🚀

@juliaElastic juliaElastic enabled auto-merge (squash) March 3, 2025 15:47
…t --include-path /api/status --include-path /api/alerting/rule/ --include-path /api/alerting/rules --include-path /api/actions --include-path /api/security/role --include-path /api/spaces --include-path /api/fleet --include-path /api/dashboards --update'
@juliaElastic juliaElastic merged commit d291339 into elastic:main Mar 3, 2025
9 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.16, 8.17, 8.18, 8.x, 9.0

https://github.com/elastic/kibana/actions/runs/13637432666

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

✅ unchanged

cc @juliaElastic

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Mar 3, 2025
Fix schema validation error when `latest_executed_state: {}`.

The logic sets an empty object here:
https://github.com/elastic/kibana/blob/63394e6bfdedf8c8e76a457673d662d57afdc2a0/x-pack/platform/plugins/shared/fleet/server/services/epm/packages/install_state_machine/steps/update_latest_executed_state.ts#L63
This caused an error on the Integration Details page:

`Failed output validation: [response
body.items.4.installationInfo.latest_executed_state.name]: expected
value of type [string] but got [undefined]`

Tested locally by manually updating `latest_executed_state` to `{}`, now
the `/epm/packages` API works as expected.

<img width="1459" alt="image"
src="https://github.com/user-attachments/assets/bbee7787-93a7-4099-ba9b-ff5d031f7637"
/>

(cherry picked from commit d291339)
@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
8.16 Backport failed because of merge conflicts
8.17 Backport failed because of merge conflicts
8.18 Backport failed because of merge conflicts
8.x Backport failed because of merge conflicts

You might need to backport the following PRs to 8.x:
- [Detection Engine][API Docs] Update request/response examples for value lists APIs (#205957)
- [Detection Engine][Docs] Added response and request descriptions for API docs (#205822)
- [Core] [UA] Support API Deprecations (#196081)
9.0

Note: Successful backport PRs will be merged automatically after passing CI.

Manual backport

To create the backport manually run:

node scripts/backport --pr 212935

Questions ?

Please refer to the Backport tool documentation

@juliaElastic juliaElastic removed the backport:prev-major Backport to (8.x, 8.18, 8.17, 8.16) the previous major branch and other branches in development label Mar 4, 2025
kibanamachine added a commit that referenced this pull request Mar 4, 2025
# Backport

This will backport the following commits from `main` to `9.0`:
- [[Fleet] fix `latest_executed_state` error
(#212935)](#212935)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Julia
Bardi","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-03-03T18:07:28Z","message":"[Fleet]
fix `latest_executed_state` error (#212935)\n\nFix schema validation
error when `latest_executed_state: {}`.\n\nThe logic sets an empty
object
here:\nhttps://github.com/elastic/kibana/blob/63394e6bfdedf8c8e76a457673d662d57afdc2a0/x-pack/platform/plugins/shared/fleet/server/services/epm/packages/install_state_machine/steps/update_latest_executed_state.ts#L63\nThis
caused an error on the Integration Details page:\n\n`Failed output
validation:
[response\nbody.items.4.installationInfo.latest_executed_state.name]:
expected\nvalue of type [string] but got [undefined]`\n\nTested locally
by manually updating `latest_executed_state` to `{}`, now\nthe
`/epm/packages` API works as expected.\n\n<img width=\"1459\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/bbee7787-93a7-4099-ba9b-ff5d031f7637\"\n/>","sha":"d2913395afd2d2a1e740663e9546fd94a569be64","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","backport:prev-minor","backport:prev-major","v9.1.0"],"title":"[Fleet]
fix `latest_executed_state`
error","number":212935,"url":"https://github.com/elastic/kibana/pull/212935","mergeCommit":{"message":"[Fleet]
fix `latest_executed_state` error (#212935)\n\nFix schema validation
error when `latest_executed_state: {}`.\n\nThe logic sets an empty
object
here:\nhttps://github.com/elastic/kibana/blob/63394e6bfdedf8c8e76a457673d662d57afdc2a0/x-pack/platform/plugins/shared/fleet/server/services/epm/packages/install_state_machine/steps/update_latest_executed_state.ts#L63\nThis
caused an error on the Integration Details page:\n\n`Failed output
validation:
[response\nbody.items.4.installationInfo.latest_executed_state.name]:
expected\nvalue of type [string] but got [undefined]`\n\nTested locally
by manually updating `latest_executed_state` to `{}`, now\nthe
`/epm/packages` API works as expected.\n\n<img width=\"1459\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/bbee7787-93a7-4099-ba9b-ff5d031f7637\"\n/>","sha":"d2913395afd2d2a1e740663e9546fd94a569be64"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/212935","number":212935,"mergeCommit":{"message":"[Fleet]
fix `latest_executed_state` error (#212935)\n\nFix schema validation
error when `latest_executed_state: {}`.\n\nThe logic sets an empty
object
here:\nhttps://github.com/elastic/kibana/blob/63394e6bfdedf8c8e76a457673d662d57afdc2a0/x-pack/platform/plugins/shared/fleet/server/services/epm/packages/install_state_machine/steps/update_latest_executed_state.ts#L63\nThis
caused an error on the Integration Details page:\n\n`Failed output
validation:
[response\nbody.items.4.installationInfo.latest_executed_state.name]:
expected\nvalue of type [string] but got [undefined]`\n\nTested locally
by manually updating `latest_executed_state` to `{}`, now\nthe
`/epm/packages` API works as expected.\n\n<img width=\"1459\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/bbee7787-93a7-4099-ba9b-ff5d031f7637\"\n/>","sha":"d2913395afd2d2a1e740663e9546fd94a569be64"}}]}]
BACKPORT-->

Co-authored-by: Julia Bardi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (9.0) the previous minor version (i.e. one version back from main) release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v9.0.0 v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants