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

[Kibana] Upgrading Integrations leads to Saved object [tag/security-solution-default] conflict #166798

Closed
matthiasledergerber opened this issue Sep 20, 2023 · 13 comments · Fixed by #170789
Assignees
Labels
bug Fixes for quality problems that affect the customer experience Team:Fleet Team label for Observability Data Collection Fleet team

Comments

@matthiasledergerber
Copy link

Kibana version: 8.10.0
Elasticsearch version: 8.10.0
Server OS version: Debian 12
Browser version: Google Chrome
Original install method (e.g. download page, yum, from source, etc.): apt

Describe the bug:

Upgrading Integrations

  • Bitwarden 1.3.0 to 1.4.0
  • MISP 1.21.0 to 1.22.0
  • Cisco ASA 2.21.0 to 2.22.0

leads to Failed to install MISP package.

{"service":{"node":{"roles":["background_tasks","ui"]}},"ecs":{"version":"8.6.1"},"@timestamp":"2023-09-20T10:32:44.309+02:00","message":"Attempt to update the mappings for the logs-bitwarden.collection-default (write_index_only)","log":{"level":"INFO","logger":"plugins.fleet"},"process":{"pid":2729},"trace":{"id":"cf2ef5057f6c48a8c0fea48625676e08"},"transaction":{"id":"a834775bed672c48"}} {"service":{"node":{"roles":["background_tasks","ui"]}},"ecs":{"version":"8.6.1"},"@timestamp":"2023-09-20T10:32:44.309+02:00","message":"Attempt to update the mappings for the logs-bitwarden.group-default (write_index_only)","log":{"level":"INFO","logger":"plugins.fleet"},"process":{"pid":2729},"trace":{"id":"cf2ef5057f6c48a8c0fea48625676e08"},"transaction":{"id":"a834775bed672c48"}} {"service":{"node":{"roles":["background_tasks","ui"]}},"ecs":{"version":"8.6.1"},"@timestamp":"2023-09-20T10:32:44.310+02:00","message":"Attempt to update the mappings for the logs-bitwarden.policy-default (write_index_only)","log":{"level":"INFO","logger":"plugins.fleet"},"process":{"pid":2729},"trace":{"id":"cf2ef5057f6c48a8c0fea48625676e08"},"transaction":{"id":"a834775bed672c48"}} {"service":{"node":{"roles":["background_tasks","ui"]}},"ecs":{"version":"8.6.1"},"@timestamp":"2023-09-20T10:32:44.311+02:00","message":"Attempt to update the mappings for the logs-bitwarden.event-default (write_index_only)","log":{"level":"INFO","logger":"plugins.fleet"},"process":{"pid":2729},"trace":{"id":"cf2ef5057f6c48a8c0fea48625676e08"},"transaction":{"id":"a834775bed672c48"}} {"service":{"node":{"roles":["background_tasks","ui"]}},"ecs":{"version":"8.6.1"},"@timestamp":"2023-09-20T10:32:44.334+02:00","message":"Failure to install package [bitwarden]: [ConcurrentInstallOperationError: Concurrent installation or upgrade of bitwarden-1.4.0 detected, aborting. Original error: Saved object [tag/security-solution-default] conflict]","log":{"level":"WARN","logger":"plugins.fleet"},"process":{"pid":2729},"trace":{"id":"cf2ef5057f6c48a8c0fea48625676e08"},"transaction":{"id":"a834775bed672c48"}}

Steps to reproduce:

  1. Select Integrations to upgrade
  2. Click on Upgrade to latest version
  3. Wait for the error

Expected behavior:

Updates of the Integrations should be possible without error

Screenshots (if relevant):
image

Any additional context:

Possible Related elastic/integrations#7789

@matthiasledergerber matthiasledergerber added the bug Fixes for quality problems that affect the customer experience label Sep 20, 2023
@botelastic botelastic bot added the needs-team Issues missing a team label label Sep 20, 2023
@matthiasledergerber
Copy link
Author

Stilla problem in Kibana version: 8.10.2

{"service":{"node":{"roles":["background_tasks","ui"]}},"ecs":{"version":"8.6.1"},"@timestamp":"2023-09-26T00:47:25.756+02:00","message":"Failure to install package [cisco_duo]: [ConcurrentInstallOperationError: Concurrent installation or upgrade of cisco_duo-1.18.0 detected, aborting. Original error: Saved object [tag/fleet-managed-nmt] conflict]","log":{"level":"WARN","logger":"plugins.fleet"},"process":{"pid":126243},"trace":{"id":"80eeaefb957739370db851313cca67ae"},"transaction":{"id":"6702d707cb4a2b0b"}} {"service":{"node":{"roles":["background_tasks","ui"]}},"ecs":{"version":"8.6.1"},"@timestamp":"2023-09-26T00:47:25.757+02:00","message":"Concurrent installation or upgrade of cisco_duo-1.18.0 detected, aborting. Original error: Saved object [tag/fleet-managed-nmt] conflict","log":{"level":"ERROR","logger":"plugins.fleet"},"process":{"pid":126243},"trace":{"id":"80eeaefb957739370db851313cca67ae"},"transaction":{"id":"6702d707cb4a2b0b"}}

@matthiasledergerber
Copy link
Author

I've tried to remove and reinstall the integreation. I can confirm there are no installed integrations of Cisco ASA but it doesnt let me install the integration. Even after uninstalling the integration from fleet (5 Assets were active according to the uninstall dialogue). It seems as integrations are still stuck somehow

Error installing cisco_asa 2.23.0: Concurrent installation or upgrade of cisco_asa-2.23.0 detected, aborting. Original error: Saved object [tag/fleet-managed-nmt] conflict

image

After removing the integration it gets reinstalled into random spaces. Sometimes all objects are created, sometimes not.
image

it is tracked as installed again. however i dont have any assets in the space. trying to reinstall the assets leads to the integration being untracked again

image

However, the cisco asa integration seems to be stable uninstalled. The Cisco Duo integration seems to be stuck worse. Even after removing everything under saved objects it gets reinstalled again and again. The problem is there is no clear indication of what is wrong as the error message seems to be related to an saved object. Somehow the installation seems to be stuck.

{"service":{"node":{"roles":["background_tasks","ui"]}},"ecs":{"version":"8.6.1"},"@timestamp":"2023-09-26T01:47:33.150+02:00","message":"Attempt to update the mappings for the logs-cisco_duo.offline_enrollment-default (write_index_only)","log":{"level":"INFO","logger":"plugins.fleet"},"process":{"pid":128177},"trace":{"id":"5c659b2bcba89ba912accd01efe7fdcb"},"transaction":{"id":"0fa85e147ebd2314"}} {"service":{"node":{"roles":["background_tasks","ui"]}},"ecs":{"version":"8.6.1"},"@timestamp":"2023-09-26T01:47:33.151+02:00","message":"Attempt to update the mappings for the logs-cisco_duo.telephony-default (write_index_only)","log":{"level":"INFO","logger":"plugins.fleet"},"process":{"pid":128177},"trace":{"id":"5c659b2bcba89ba912accd01efe7fdcb"},"transaction":{"id":"0fa85e147ebd2314"}} {"service":{"node":{"roles":["background_tasks","ui"]}},"ecs":{"version":"8.6.1"},"@timestamp":"2023-09-26T01:47:33.152+02:00","message":"Attempt to update the mappings for the logs-cisco_duo.summary-default (write_index_only)","log":{"level":"INFO","logger":"plugins.fleet"},"process":{"pid":128177},"trace":{"id":"5c659b2bcba89ba912accd01efe7fdcb"},"transaction":{"id":"0fa85e147ebd2314"}} {"service":{"node":{"roles":["background_tasks","ui"]}},"ecs":{"version":"8.6.1"},"@timestamp":"2023-09-26T01:47:33.153+02:00","message":"Attempt to update the mappings for the logs-cisco_duo.admin-default (write_index_only)","log":{"level":"INFO","logger":"plugins.fleet"},"process":{"pid":128177},"trace":{"id":"5c659b2bcba89ba912accd01efe7fdcb"},"transaction":{"id":"0fa85e147ebd2314"}} {"service":{"node":{"roles":["background_tasks","ui"]}},"ecs":{"version":"8.6.1"},"@timestamp":"2023-09-26T01:47:33.155+02:00","message":"Attempt to update the mappings for the logs-cisco_duo.auth-default (write_index_only)","log":{"level":"INFO","logger":"plugins.fleet"},"process":{"pid":128177},"trace":{"id":"5c659b2bcba89ba912accd01efe7fdcb"},"transaction":{"id":"0fa85e147ebd2314"}} {"service":{"node":{"roles":["background_tasks","ui"]}},"ecs":{"version":"8.6.1"},"@timestamp":"2023-09-26T01:47:33.166+02:00","message":"Failure to install package [cisco_duo]: [ConcurrentInstallOperationError: Concurrent installation or upgrade of cisco_duo-1.18.0 detected, aborting. Original error: Saved object [tag/fleet-managed-nmt] conflict]","log":{"level":"WARN","logger":"plugins.fleet"},"process":{"pid":128177},"trace":{"id":"5c659b2bcba89ba912accd01efe7fdcb"},"transaction":{"id":"0fa85e147ebd2314"}}

Tyring to add a new Cisco Duo Integration leads to

{"service":{"node":{"roles":["background_tasks","ui"]}},"ecs":{"version":"8.6.1"},"@timestamp":"2023-09-26T01:46:33.924+02:00","message":"Failure to install package [cisco_duo]: [ConcurrentInstallOperationError: Concurrent installation or upgrade of cisco_duo-1.18.0 detected, aborting. Original error: Saved object [tag/fleet-pkg-cisco_duo-nmt] conflict]","log":{"level":"WARN","logger":"plugins.fleet"},"process":{"pid":128177},"trace":{"id":"17cf822a118a60feafb98411b0755916"},"transaction":{"id":"d78d68d5f42c81ce"}}

As an user of many Elastic Integrations with multiple Kibana spaces, this feature needs more stability in order to be used reliably in production.

@jughosta jughosta added the Team:Fleet Team label for Observability Data Collection Fleet team label Oct 4, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@botelastic botelastic bot removed the needs-team Issues missing a team label label Oct 4, 2023
@kpollich
Copy link
Member

kpollich commented Oct 4, 2023

Thanks for the detailed bug report, @matthiasledergerber - I've pulled this onto our bug board internally and we'll get this looked at in short order.

@criamico - I think this is also related to the initial change we made in #152814. cc @P1llus as you might have some insight as well.

@P1llus
Copy link
Member

P1llus commented Oct 4, 2023

@kpollich Hmm it should not be directly related but, I remember a longer time ago, dashboards was exported to integrations including even managed tags. Elastic package was fixed later on, but I feel maybe some dashboards still have their references to managed tags? Its not related to our included tags though.
The tags causing issues are created by fleet and iwe seen this issue before our newer feature as well..

@P1llus
Copy link
Member

P1llus commented Oct 4, 2023

This seems more spaces related?

@kpollich
Copy link
Member

kpollich commented Oct 4, 2023

Yeah I think you're correct about spaces, just wondered if anything stood out about the default security tag we set up.

@matthiasledergerber
Copy link
Author

My guess is that this is related to the following issues:

What I can tell:

  • The broken references in the dashboards were fixed.
  • However, it seems as the issue with upgrading or reinstalling integrations combined with multiple Kibana Spaces still persists and I cannot find any useful information in the logfiles despite the concurrent installation error. In the newest version it seems as soon as i try to upgrade the integration it fails and gets stuck in a reinstall loop (Dashboard assets are created in spaces randomly)
  • I had success with one integration: uninstall the integration completely from the agent policy and reinstall again. However this doesn't seem right when some integrations are assigned to dozens of agent policies. With an other integration I wasn't successful with this procedure and it is still stuck.

@matthiasledergerber
Copy link
Author

8.10.3 still exists
image

already tried:

  • Remove Integration

  • Run:
    DELETE kbn:/api/fleet/epm/packages/cisco_duo/1.18.0 {"force":true, "ignore_constraints": true }

  • Remove Assets from other Spaces

  • Readd interation -> Fails with error (see image above)

@kpollich
Copy link
Member

Fix for this is scheduled for 8.12 as of now.

@matthiasledergerber
Copy link
Author

Solution for this issue that randomly reoccurs:

Remove the Tags Security Solution from the default space. Interesting to have them used in the default space despite installing the integration in a different space

Somehow they are created multiple times, despite deleting them.

@kpollich kpollich self-assigned this Nov 7, 2023
@kpollich
Copy link
Member

kpollich commented Nov 7, 2023

Started taking a look at this today. I have some steps to reproduce:

  1. Create a non-default space, e.g. My second space
  2. Install the bitwarden integration in this second space - doesn't matter what version
  3. Switch to your default space
  4. Navigate to the bitwarden integration details page
  5. Attempt to reinstall the integration
  6. Note the errors and broken state
Screen.Recording.2023-11-07.at.2.13.35.PM.mov

The root error in the logs is

[2023-11-07T14:13:57.560-05:00][WARN ][plugins.fleet] Failure to install package [bitwarden]: [ConcurrentInstallOperationError: Concurrent installation or upgrade of bitwarden-1.8.0 detected, aborting. Original error: Saved object [tag/security-solution-default] conflict]
[2023-11-07T14:13:57.560-05:00][ERROR][plugins.fleet] Concurrent installation or upgrade of bitwarden-1.8.0 detected, aborting. Original error: Saved object [tag/security-solution-default] conflict

@kpollich
Copy link
Member

kpollich commented Nov 7, 2023

I think the issue is that the security solution tag ID is not unique across spaces, so when the integration upgrade/reinstall happens in a space that differs from the initial installation we'll see this conflict.

If you attempt to install any integration tagged with the security solution tag in another space after the tag was created elsewhere, you'll see this conflict error.

The easiest solution for us to move forward here is to create the Security Solution tag in each space where a security solution integration is installed. This is consistent with how we treat other tags (e.g. Managed and the package title tags) generated by Fleet/Integrations.

image

The space on the top is the one I installed bitwarden, the bottom is where I installed cisco_asa. You can see how each tag has a different color and number of tagged assets. Because tags can't be global, we generate them in each space today. This is a limitation with Kibana saved objects. There's an effort to make various saved object/asset types shareable across spaces e.g. #167901 under which I think this problem with tags also falls.

@P1llus - Right now, we use security-solution-default as the tag ID across all security solution integrations. If Fleet generated an ID like security-solution-default-my-second-space where the space ID is appended, would that break the security solution UI? I'm assuming if I'm currently in a secondary space, I will only be able populate the UI with integrations that are installed in my current space based on tag presence. Maybe that's preferred? Curious if you have thoughts on the multi space concerns here.

kpollich added a commit that referenced this issue Nov 10, 2023
## Summary

Fixes #166798

Appends the current space ID to the ID of the security solution tag.

Note: If there are integrations suffering from the above bug (might be
"stuck" in `installing` status, showing concurrent installation errors,
etc), they should be reinstalled via the API in their corresponding
space, e.g.

```
# In Kibana dev tools for the space in which the integration is installed
POST kbn:/api/fleet/epm/packages/cisco_asa/2.27.1
{
  "force": true
}
```

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue Nov 10, 2023
## Summary

Fixes elastic#166798

Appends the current space ID to the ID of the security solution tag.

Note: If there are integrations suffering from the above bug (might be
"stuck" in `installing` status, showing concurrent installation errors,
etc), they should be reinstalled via the API in their corresponding
space, e.g.

```
# In Kibana dev tools for the space in which the integration is installed
POST kbn:/api/fleet/epm/packages/cisco_asa/2.27.1
{
  "force": true
}
```

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit dd2fda2)
kibanamachine referenced this issue Nov 10, 2023
…71034)

# Backport

This will backport the following commits from `main` to `8.11`:
- [[Fleet] Append space ID to security solution tag
(#170789)](#170789)

<!--- Backport version: 8.9.7 -->

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

<!--BACKPORT [{"author":{"name":"Kyle
Pollich","email":"kyle.pollich@elastic.co"},"sourceCommit":{"committedDate":"2023-11-10T16:01:36Z","message":"[Fleet]
Append space ID to security solution tag (#170789)\n\n##
Summary\r\n\r\nFixes
https://github.com/elastic/kibana/issues/166798\r\n\r\nAppends the
current space ID to the ID of the security solution tag.\r\n\r\nNote: If
there are integrations suffering from the above bug (might
be\r\n\"stuck\" in `installing` status, showing concurrent installation
errors,\r\netc), they should be reinstalled via the API in their
corresponding\r\nspace, e.g.\r\n\r\n```\r\n# In Kibana dev tools for the
space in which the integration is installed\r\nPOST
kbn:/api/fleet/epm/packages/cisco_asa/2.27.1\r\n{\r\n \"force\":
true\r\n}\r\n```\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"dd2fda271187f718def78002516861736dc48cf7","branchLabelMapping":{"^v8.12.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Fleet","backport:prev-minor","v8.12.0"],"number":170789,"url":"https://github.com/elastic/kibana/pull/170789","mergeCommit":{"message":"[Fleet]
Append space ID to security solution tag (#170789)\n\n##
Summary\r\n\r\nFixes
https://github.com/elastic/kibana/issues/166798\r\n\r\nAppends the
current space ID to the ID of the security solution tag.\r\n\r\nNote: If
there are integrations suffering from the above bug (might
be\r\n\"stuck\" in `installing` status, showing concurrent installation
errors,\r\netc), they should be reinstalled via the API in their
corresponding\r\nspace, e.g.\r\n\r\n```\r\n# In Kibana dev tools for the
space in which the integration is installed\r\nPOST
kbn:/api/fleet/epm/packages/cisco_asa/2.27.1\r\n{\r\n \"force\":
true\r\n}\r\n```\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"dd2fda271187f718def78002516861736dc48cf7"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.12.0","labelRegex":"^v8.12.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/170789","number":170789,"mergeCommit":{"message":"[Fleet]
Append space ID to security solution tag (#170789)\n\n##
Summary\r\n\r\nFixes
https://github.com/elastic/kibana/issues/166798\r\n\r\nAppends the
current space ID to the ID of the security solution tag.\r\n\r\nNote: If
there are integrations suffering from the above bug (might
be\r\n\"stuck\" in `installing` status, showing concurrent installation
errors,\r\netc), they should be reinstalled via the API in their
corresponding\r\nspace, e.g.\r\n\r\n```\r\n# In Kibana dev tools for the
space in which the integration is installed\r\nPOST
kbn:/api/fleet/epm/packages/cisco_asa/2.27.1\r\n{\r\n \"force\":
true\r\n}\r\n```\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"dd2fda271187f718def78002516861736dc48cf7"}}]}]
BACKPORT-->

Co-authored-by: Kyle Pollich <kyle.pollich@elastic.co>
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.

5 participants