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] Return 400 error instead of 500 when integration policy failed to update due to invalid processors #210341

Closed
juliaElastic opened this issue Feb 10, 2025 · 1 comment · Fixed by #210363
Assignees
Labels
bug Fixes for quality problems that affect the customer experience Team:Fleet Team label for Observability Data Collection Fleet team

Comments

@juliaElastic
Copy link
Contributor

We received an alert when an integration policy was attempted to be updated from the UI and failed with an error about duplicated mapping key processors.
This kind of error shouldn't cause an alert (because of returning an 500 error), it should return a 400 error.

PUT /api/fleet/package_policies/?

duplicated mapping key (8:1)

 5 | data_stream:
 6 |   dataset: lg_app_php
 7 | processors:
 8 | processors:
-----^
 9 |   - add_host_metadata: \~
 10 |   - add_cloud_metadata: \~
@juliaElastic juliaElastic added bug Fixes for quality problems that affect the customer experience Team:Fleet Team label for Observability Data Collection Fleet team labels Feb 10, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@juliaElastic juliaElastic self-assigned this Feb 10, 2025
juliaElastic added a commit that referenced this issue Feb 10, 2025
## Summary

Closes #210341

Catch yaml error when updating package policies to throw a Fleet error,
this results in a 400 response code instead of 500 which caused a PD
alert in serverless.

To verify:
- add System integration, then go to Edit integration policy
- add the yaml below to Processors
- click on Save and continue
- expect a HTTP 400 error response

```
data_stream:
  dataset: test

processors:
  - add_host_metadata: \~
  - add_cloud_metadata: \~
```

<img width="2551" alt="image"
src="https://github.com/user-attachments/assets/0c839601-e278-4715-a7e9-743235e69832"
/>



### Checklist

- [x] [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
kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue Feb 10, 2025
## Summary

Closes elastic#210341

Catch yaml error when updating package policies to throw a Fleet error,
this results in a 400 response code instead of 500 which caused a PD
alert in serverless.

To verify:
- add System integration, then go to Edit integration policy
- add the yaml below to Processors
- click on Save and continue
- expect a HTTP 400 error response

```
data_stream:
  dataset: test

processors:
  - add_host_metadata: \~
  - add_cloud_metadata: \~
```

<img width="2551" alt="image"
src="https://github.com/user-attachments/assets/0c839601-e278-4715-a7e9-743235e69832"
/>

### Checklist

- [x] [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

(cherry picked from commit 734a63d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Team:Fleet Team label for Observability Data Collection Fleet team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants