Skip to content

Conversation

@hop-dev
Copy link
Contributor

@hop-dev hop-dev commented Jul 28, 2025

Summary

I noticed on calling the init API multiple times we get the error:

 proc [kibana] Unhandled Promise rejection detected:
 proc [kibana] 
 proc [kibana] Error: A monitoring entity source with the name "default-monitoring-index-default" already exists.
 proc [kibana]     at MonitoringEntitySourceDescriptorClient.assertNameUniqueness (monitoring_entity_source.ts:103:15)
 proc [kibana]     at processTicksAndRejections (node:internal/process/task_queues:105:5)
 proc [kibana]     at MonitoringEntitySourceDescriptorClient.create (monitoring_entity_source.ts:24:5)
 proc [kibana] 

I have changed it so that if it already exists we update it, this way we get the chance to repair it if anything has gone wrong.

@hop-dev hop-dev self-assigned this Jul 28, 2025
@hop-dev hop-dev added backport:skip This PR does not require backporting Team:Entity Analytics Security Entity Analytics Team labels Jul 28, 2025
@hop-dev hop-dev requested a review from a team as a code owner July 28, 2025 16:53
@hop-dev hop-dev added backport:version Backport to applied version labels v9.1.0 labels Jul 28, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-entity-analytics (Team:Entity Analytics)

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

cc @hop-dev

Copy link
Contributor

@CAWilson94 CAWilson94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this, looking good! 🚀

@hop-dev
Copy link
Contributor Author

hop-dev commented Aug 4, 2025

@elasticmachine merge upstream

@hop-dev hop-dev merged commit 6869eb1 into elastic:main Aug 5, 2025
14 checks passed
@hop-dev hop-dev deleted the maybe-create-mds branch August 5, 2025 10:25
@hop-dev hop-dev removed backport:skip This PR does not require backporting v9.2.0 labels Aug 5, 2025
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 9.1

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

kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Aug 5, 2025
…esn't already exist (update otherwise) (elastic#229693)

## Summary

I noticed on calling the init API multiple times we get the error:

```
 proc [kibana] Unhandled Promise rejection detected:
 proc [kibana]
 proc [kibana] Error: A monitoring entity source with the name "default-monitoring-index-default" already exists.
 proc [kibana]     at MonitoringEntitySourceDescriptorClient.assertNameUniqueness (monitoring_entity_source.ts:103:15)
 proc [kibana]     at processTicksAndRejections (node:internal/process/task_queues:105:5)
 proc [kibana]     at MonitoringEntitySourceDescriptorClient.create (monitoring_entity_source.ts:24:5)
 proc [kibana]
 ```

I have  changed it so that if it already exists we update it, this way we get the chance to repair it if anything has gone wrong.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit 6869eb1)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
9.1

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

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Aug 5, 2025
… it doesn't already exist (update otherwise) (#229693) (#230532)

# Backport

This will backport the following commits from `main` to `9.1`:
- [[Entity Analytics][Privmon] Only create default index source if it
doesn't already exist (update otherwise)
(#229693)](#229693)

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

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

<!--BACKPORT [{"author":{"name":"Mark
Hopkin","email":"mark.hopkin@elastic.co"},"sourceCommit":{"committedDate":"2025-08-05T10:25:07Z","message":"[Entity
Analytics][Privmon] Only create default index source if it doesn't
already exist (update otherwise) (#229693)\n\n## Summary\n\nI noticed on
calling the init API multiple times we get the error:\n\n```\n proc
[kibana] Unhandled Promise rejection detected:\n proc [kibana] \n proc
[kibana] Error: A monitoring entity source with the name
\"default-monitoring-index-default\" already exists.\n proc [kibana] at
MonitoringEntitySourceDescriptorClient.assertNameUniqueness
(monitoring_entity_source.ts:103:15)\n proc [kibana] at
processTicksAndRejections (node:internal/process/task_queues:105:5)\n
proc [kibana] at MonitoringEntitySourceDescriptorClient.create
(monitoring_entity_source.ts:24:5)\n proc [kibana] \n ```\n\nI have
changed it so that if it already exists we update it, this way we get
the chance to repair it if anything has gone
wrong.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"6869eb1a64c6365cea08830e1f74b5340b521897","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Entity
Analytics","backport:version","v9.1.0","v9.2.0"],"title":"[Entity
Analytics][Privmon] Only create default index source if it doesn't
already exist (update
otherwise)","number":229693,"url":"https://github.com/elastic/kibana/pull/229693","mergeCommit":{"message":"[Entity
Analytics][Privmon] Only create default index source if it doesn't
already exist (update otherwise) (#229693)\n\n## Summary\n\nI noticed on
calling the init API multiple times we get the error:\n\n```\n proc
[kibana] Unhandled Promise rejection detected:\n proc [kibana] \n proc
[kibana] Error: A monitoring entity source with the name
\"default-monitoring-index-default\" already exists.\n proc [kibana] at
MonitoringEntitySourceDescriptorClient.assertNameUniqueness
(monitoring_entity_source.ts:103:15)\n proc [kibana] at
processTicksAndRejections (node:internal/process/task_queues:105:5)\n
proc [kibana] at MonitoringEntitySourceDescriptorClient.create
(monitoring_entity_source.ts:24:5)\n proc [kibana] \n ```\n\nI have
changed it so that if it already exists we update it, this way we get
the chance to repair it if anything has gone
wrong.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"6869eb1a64c6365cea08830e1f74b5340b521897"}},"sourceBranch":"main","suggestedTargetBranches":["9.1"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/229693","number":229693,"mergeCommit":{"message":"[Entity
Analytics][Privmon] Only create default index source if it doesn't
already exist (update otherwise) (#229693)\n\n## Summary\n\nI noticed on
calling the init API multiple times we get the error:\n\n```\n proc
[kibana] Unhandled Promise rejection detected:\n proc [kibana] \n proc
[kibana] Error: A monitoring entity source with the name
\"default-monitoring-index-default\" already exists.\n proc [kibana] at
MonitoringEntitySourceDescriptorClient.assertNameUniqueness
(monitoring_entity_source.ts:103:15)\n proc [kibana] at
processTicksAndRejections (node:internal/process/task_queues:105:5)\n
proc [kibana] at MonitoringEntitySourceDescriptorClient.create
(monitoring_entity_source.ts:24:5)\n proc [kibana] \n ```\n\nI have
changed it so that if it already exists we update it, this way we get
the chance to repair it if anything has gone
wrong.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"6869eb1a64c6365cea08830e1f74b5340b521897"}}]}]
BACKPORT-->

Co-authored-by: Mark Hopkin <mark.hopkin@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
delanni pushed a commit to delanni/kibana that referenced this pull request Aug 5, 2025
…esn't already exist (update otherwise) (elastic#229693)

## Summary

I noticed on calling the init API multiple times we get the error:

```
 proc [kibana] Unhandled Promise rejection detected:
 proc [kibana] 
 proc [kibana] Error: A monitoring entity source with the name "default-monitoring-index-default" already exists.
 proc [kibana]     at MonitoringEntitySourceDescriptorClient.assertNameUniqueness (monitoring_entity_source.ts:103:15)
 proc [kibana]     at processTicksAndRejections (node:internal/process/task_queues:105:5)
 proc [kibana]     at MonitoringEntitySourceDescriptorClient.create (monitoring_entity_source.ts:24:5)
 proc [kibana] 
 ```

I have  changed it so that if it already exists we update it, this way we get the chance to repair it if anything has gone wrong.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
@wildemat wildemat mentioned this pull request Aug 7, 2025
10 tasks
@jaredburgettelastic jaredburgettelastic changed the title [Entity Analytics][Privmon] Only create default index source if it doesn't already exist (update otherwise) [Entity Analytics][Privmon] Only create Privileged user monitoring default index source if it doesn't already exist (update otherwise) Aug 11, 2025
NicholasPeretti pushed a commit to NicholasPeretti/kibana that referenced this pull request Aug 18, 2025
…esn't already exist (update otherwise) (elastic#229693)

## Summary

I noticed on calling the init API multiple times we get the error:

```
 proc [kibana] Unhandled Promise rejection detected:
 proc [kibana] 
 proc [kibana] Error: A monitoring entity source with the name "default-monitoring-index-default" already exists.
 proc [kibana]     at MonitoringEntitySourceDescriptorClient.assertNameUniqueness (monitoring_entity_source.ts:103:15)
 proc [kibana]     at processTicksAndRejections (node:internal/process/task_queues:105:5)
 proc [kibana]     at MonitoringEntitySourceDescriptorClient.create (monitoring_entity_source.ts:24:5)
 proc [kibana] 
 ```

I have  changed it so that if it already exists we update it, this way we get the chance to repair it if anything has gone wrong.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels release_note:fix Team:Entity Analytics Security Entity Analytics Team v9.1.2 v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants