[Fleet] Package policy saving failure when secrets enabled for the first time #160537
Labels
bug
Fixes for quality problems that affect the customer experience
Team:Fleet
Team label for Observability Data Collection Fleet team
Part of #154715
Followup to #157176
Context
With the merging of #157176 input variables can be saved and stored as secrets from Fleet UI. There is one remaining bug that happens when a package policy with secret variables was created before the feature was enabled and edited afterwards.
Steps to reproduce
Cf. #157176 (comment)
secretsStorage
feature flag.secretsStorage
is not present inxpack.fleet.enableExperimental
in yourkibana.dev.yml
.xpack.fleet.registryUrl: http://localhost:8080
to yourkibana.dev.yml
.secretsStorage
feature flag (xpack.fleet.enableExperimental: ['secretsStorage']
).Save integration
. The first time, the request will fail with404 Bad Request
and the following error message:Save integration
again. This time, the request will succeed and the package policy will be saved correctly.Details and observations
Server error
The following error appears in Kibana logs:
Error stack trace:
This error originates here. Note that the
catch
block is responsible for creating the Bad Request response. The error itself seems to be due to invalid parsing of the initial filter query param.API requests
There are no differences in the API request payloads between the first failed request and the second successful requests. Only the responses (404 vs. 200) are different due to the above thrown error.
Screenshots
First request fails:
Second request succeeds:
The text was updated successfully, but these errors were encountered: