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]: Error when creating an Agent Policy, seen after editing an Integration / package policy that is used in other Agent Policies #121059

Closed
amolnater-qasource opened this issue Dec 13, 2021 · 9 comments · Fixed by #121101 or #121965
Assignees
Labels
bug Fixes for quality problems that affect the customer experience impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. Team:Fleet Team label for Observability Data Collection Fleet team

Comments

@amolnater-qasource
Copy link

amolnater-qasource commented Dec 13, 2021

Kibana version: 7.16.0, 7.16.1, 8.0.0-SNAPSHOT, 8.1.0-SNAPSHOT

Host OS and Browser version: All, All

Build details:

Build: 46258
Commit: 8751518b4a507d6659d93735b6f90d164514327a

Minimum steps to reproduce:

  1. Create two Agent policies with "Collect system logs and metrics" enabled, called test1 and test2
  2. Edit the system package policy in the test1 policy
  3. Try to create a new policy test3 with "Collect system logs and metrics" enabled
Original reproduction steps

Preconditions:

  1. 7.16.1 BC-2 Kibana Cloud environment should be available.
  2. Few agents(in our case 1 windows, 1 mac and 1 linux tar agent was installed) must be installed with different policies.
  3. Kibana should be running from few hours(In our case running from 4 hours).

Steps to reproduce:

  1. Navigate to agent policies.
  2. After few hours of running kibana, create a policy with unchecking Collect system logs and metrics.
  3. Observe policy is created.
  4. Now again re-attempt to create new policy without unchecking.
  5. Observe error that policy already exists, however it actually doesn't.
  6. Then observe the same policy is created again without system integration.

Screen Recording:

Agent.policies.-.Fleet.-.Elastic.-.Google.Chrome.2021-12-13.14-56-45.mp4

NOTE:

  • We have observed this issue earlier reproducible during 7.16.0 BC builds testing.
  • We have also observed this issue currently on 8.0-Snapshot too.
@amolnater-qasource amolnater-qasource added bug Fixes for quality problems that affect the customer experience impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. Team:Fleet Team label for Observability Data Collection Fleet team labels Dec 13, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@amolnater-qasource
Copy link
Author

@manishgupta-qasource Please review.

@manishgupta-qasource
Copy link

Reviewed & mention to @kpollich

CC: @EricDavisX

@kpollich kpollich self-assigned this Dec 13, 2021
@nchaulet nchaulet assigned nchaulet and unassigned kpollich Dec 13, 2021
@nchaulet
Copy link
Member

nchaulet commented Dec 13, 2021

This issue seems to be present since we introduce the globally unique package name in 7.16.0
The error is due to an error in our incrementPackage name function where we only retrieve one package policy instead of all package policy for a package.

You can reproduce it by:

  1. creating two policy with system integration enabled let call them agent policy test1 than agent policy test2
  2. edit the system package policy in the test1 policy
  3. create a new policy test3 with system integration enabled.

@joshdover
Copy link
Member

I think we also need to document a known issue for this in the 7.16.0 release. I believe the workaround would be to rename the other system integration policies, is that correct?

@criamico would you be able to test that workaround and add a known issue to https://github.com/elastic/observability-docs/blob/main/docs/en/ingest-management/release-notes/release-notes-7.16.asciidoc? You can follow the example in the 7.15.0 notes: https://github.com/elastic/observability-docs/blob/main/docs/en/ingest-management/release-notes/release-notes-7.15.asciidoc

@EricDavisX EricDavisX changed the title [Inconsistent][Fleet]: Unable to create a policy after few hours of normal working kibana. [Fleet]: Error when creating an Agent Policy, seen after editing an Integration / package policy that is used in other Agent Policies Dec 13, 2021
@nchaulet
Copy link
Member

I think we also need to document a known issue for this in the 7.16.0 release. I believe the workaround would be to rename the other system integration policies, is that correct?

One easy workaround will be to create the policy without the system integration and add it later with a proper name.

@amolnater-qasource
Copy link
Author

amolnater-qasource commented Dec 23, 2021

Hi @joshdover & @nchaulet
This issue is again inconsistently reproducible on latest 8.0 Snapshot.
We have attempted on 3 different Kibana environments and we successfully reproduced it with below steps:

  • We created a New Policy added 5-6 system integrations.
  • Created a New Policy 02.
  • Added 1 more system integration to New Policy.
  • Created a New Policy 03 and observed already exist error.
  • New Policy 03 created without System integration.

We have tried various combinations however this issue is randomly reproducible while creating policies and adding system integrations to it.

Screen Recordings:

Agent.policies.-.Fleet.-.Elastic.-.Google.Chrome.2021-12-23.15-14-11.mp4
Agent.policies.-.Fleet.-.Elastic.-.Google.Chrome.2021-12-23.15-11-57.mp4

Build details:
Build: 48841
Commit: 0668b86

Hence we are re-opening this issue.
Thanks

@nchaulet
Copy link
Member

Hi @amolnater-qasource thanks for testing this again I found an issue with our increment function where we were not handling correctly the increment correctly if there is more than 10 package policies #121965

@amolnater-qasource
Copy link
Author

Hi @nchaulet
Thanks for looking into this.
We have revalidated this issue on latest 8.0 Snapshot and we have found it fixed now.

  • We observed no errors while creating several policies and on adding system integrations.

Build details:
Build: 48868
Commit: a29e016

Screenshot:
11

Further, we will keep track of this issue on further builds too.

Thanks

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 impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. Team:Fleet Team label for Observability Data Collection Fleet team
Projects
None yet
6 participants