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

Simulate index fails when index name already exists and has an alias #84256

Closed
marshallmain opened this issue Feb 23, 2022 · 3 comments · Fixed by #84675
Closed

Simulate index fails when index name already exists and has an alias #84256

marshallmain opened this issue Feb 23, 2022 · 3 comments · Fixed by #84675
Assignees
Labels
>bug :Data Management/Indices APIs APIs to create and manage indices and templates

Comments

@marshallmain
Copy link
Contributor

Elasticsearch Version

8.2.0

Installed Plugins

No response

Java Version

bundled

OS Version

Darwin Kernel Version 20.6.0

Problem Description

The simulate index API returns an error if used with an index name that already exists and the existing index has an alias defined.

{
  "error" : {
    "root_cause" : [
      {
        "type" : "illegal_state_exception",
        "reason" : "Cannot remove non-existent alias [my-index-alias] for index [my-index]"
      }
    ],
    "type" : "illegal_state_exception",
    "reason" : "Cannot remove non-existent alias [my-index-alias] for index [my-index]"
  },
  "status" : 500
}

Previously in 8.0 the simulate index API would return the expected mappings, settings, and aliases even when used with an index name that already exists.

Steps to Reproduce

  1. Create a minimal index template that includes an alias
POST _index_template/my_template
{
  "index_patterns": [
    "my-index*"
  ],
  "template": {
    "aliases": {
      "my-index-alias": {
        "is_write_index": false
      }
    }
  }
}
  1. Create an index using the index template
PUT my-index
  1. Simulate an index with the same name as the created index
POST _index_template/_simulate_index/my-index

Logs (if relevant)

info [r.suppressed] [Marshalls-MacBook-Pro.local] path: /_index_template/_simulate_index/my-index, params: {pretty=true, name=my-index}
   │      java.lang.IllegalStateException: Cannot remove non-existent alias [my-index-alias] for index [my-index]
   │      	at org.elasticsearch.cluster.metadata.Metadata$Builder.removeAlias(Metadata.java:1362) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.cluster.metadata.Metadata$Builder.updateAliases(Metadata.java:1333) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.cluster.metadata.Metadata$Builder.put(Metadata.java:1235) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.action.admin.indices.template.post.TransportSimulateIndexTemplateAction.resolveTemporaryState(TransportSimulateIndexTemplateAction.java:179) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.action.admin.indices.template.post.TransportSimulateIndexTemplateAction.masterOperation(TransportSimulateIndexTemplateAction.java:131) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.action.admin.indices.template.post.TransportSimulateIndexTemplateAction.masterOperation(TransportSimulateIndexTemplateAction.java:57) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.action.support.master.TransportMasterNodeAction.executeMasterOperation(TransportMasterNodeAction.java:121) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.action.support.master.TransportMasterNodeAction$AsyncSingleAction.lambda$doStart$3(TransportMasterNodeAction.java:215) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.action.ActionRunnable$2.doRun(ActionRunnable.java:62) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.common.util.concurrent.EsExecutors$DirectExecutorService.execute(EsExecutors.java:221) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.action.support.master.TransportMasterNodeAction$AsyncSingleAction.doStart(TransportMasterNodeAction.java:215) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.action.support.master.TransportMasterNodeAction.doExecute(TransportMasterNodeAction.java:152) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.action.support.master.TransportMasterNodeAction.doExecute(TransportMasterNodeAction.java:52) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.action.support.TransportAction$RequestFilterChain.proceed(TransportAction.java:79) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.action.support.ActionFilter$Simple.apply(ActionFilter.java:53) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.action.support.TransportAction$RequestFilterChain.proceed(TransportAction.java:77) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.action.filter.SecurityActionFilter.lambda$applyInternal$3(SecurityActionFilter.java:162) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.action.ActionListener$DelegatingFailureActionListener.onResponse(ActionListener.java:219) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.authz.AuthorizationService.lambda$authorizeAction$4(AuthorizationService.java:392) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.authz.AuthorizationService$AuthorizationResultListener.onResponse(AuthorizationService.java:958) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.authz.AuthorizationService$AuthorizationResultListener.onResponse(AuthorizationService.java:922) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.action.support.ContextPreservingActionListener.onResponse(ContextPreservingActionListener.java:31) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.authz.AuthorizationService.lambda$authorizeAction$5(AuthorizationService.java:406) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:136) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.authz.RBACEngine.authorizeClusterAction(RBACEngine.java:165) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.authz.AuthorizationService.authorizeAction(AuthorizationService.java:396) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.authz.AuthorizationService.maybeAuthorizeRunAs(AuthorizationService.java:372) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.authz.AuthorizationService.lambda$authorize$1(AuthorizationService.java:257) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:136) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.action.support.ContextPreservingActionListener.onResponse(ContextPreservingActionListener.java:31) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.authz.RBACEngine.lambda$resolveAuthorizationInfo$0(RBACEngine.java:138) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:136) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.authz.store.CompositeRolesStore.lambda$getRoles$1(CompositeRolesStore.java:184) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:136) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.core.security.authz.store.RoleReferenceIntersection.lambda$buildRole$0(RoleReferenceIntersection.java:47) [x-pack-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:136) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.action.support.GroupedActionListener.onResponse(GroupedActionListener.java:55) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.authz.store.CompositeRolesStore.buildRoleFromRoleReference(CompositeRolesStore.java:232) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.core.security.authz.store.RoleReferenceIntersection.lambda$buildRole$1(RoleReferenceIntersection.java:50) [x-pack-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at java.lang.Iterable.forEach(Iterable.java:75) [?:?]
   │      	at org.elasticsearch.xpack.core.security.authz.store.RoleReferenceIntersection.buildRole(RoleReferenceIntersection.java:50) [x-pack-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.authz.store.CompositeRolesStore.getRole(CompositeRolesStore.java:199) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.authz.store.CompositeRolesStore.getRoles(CompositeRolesStore.java:174) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.authz.RBACEngine.resolveAuthorizationInfo(RBACEngine.java:135) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.authz.AuthorizationService.authorize(AuthorizationService.java:259) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.action.filter.SecurityActionFilter.lambda$applyInternal$4(SecurityActionFilter.java:158) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:136) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.action.ActionListener$MappedActionListener.onResponse(ActionListener.java:101) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.authc.AuthenticatorChain.authenti
   │ info cateAsync(AuthenticatorChain.java:92) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.authc.AuthenticationService.authenticate(AuthenticationService.java:171) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.action.filter.SecurityActionFilter.applyInternal(SecurityActionFilter.java:154) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.action.filter.SecurityActionFilter.apply(SecurityActionFilter.java:113) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.action.support.TransportAction$RequestFilterChain.proceed(TransportAction.java:77) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:54) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.tasks.TaskManager.registerAndExecute(TaskManager.java:170) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.client.internal.node.NodeClient.executeLocally(NodeClient.java:113) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.client.internal.node.NodeClient.doExecute(NodeClient.java:91) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.client.internal.support.AbstractClient.execute(AbstractClient.java:380) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.rest.action.admin.indices.RestSimulateIndexTemplateAction.lambda$prepareRequest$0(RestSimulateIndexTemplateAction.java:54) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.rest.BaseRestHandler.handleRequest(BaseRestHandler.java:103) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.rest.SecurityRestFilter.lambda$handleRequest$0(SecurityRestFilter.java:112) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:136) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.authc.support.SecondaryAuthenticator.lambda$authenticateAndAttachToContext$2(SecondaryAuthenticator.java:84) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:136) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.authc.support.SecondaryAuthenticator.authenticate(SecondaryAuthenticator.java:94) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.authc.support.SecondaryAuthenticator.authenticateAndAttachToContext(SecondaryAuthenticator.java:78) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.rest.SecurityRestFilter.lambda$handleRequest$2(SecurityRestFilter.java:106) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:136) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.action.ActionListener$MappedActionListener.onResponse(ActionListener.java:101) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.action.ActionListener$RunBeforeActionListener.onResponse(ActionListener.java:389) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.authc.AuthenticatorChain.writeAuthToContext(AuthenticatorChain.java:350) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.authc.AuthenticatorChain.finishAuthentication(AuthenticatorChain.java:326) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.authc.AuthenticatorChain.maybeLookupRunAsUser(AuthenticatorChain.java:204) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.authc.AuthenticatorChain.lambda$doAuthenticate$1(AuthenticatorChain.java:120) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:136) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.core.common.IteratingActionListener.onResponse(IteratingActionListener.java:141) [x-pack-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.authc.AuthenticatorChain.lambda$getAuthenticatorConsumer$4(AuthenticatorChain.java:187) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:136) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.authc.RealmsAuthenticator.lambda$consumeToken$3(RealmsAuthenticator.java:217) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:136) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.action.support.ContextPreservingActionListener.onResponse(ContextPreservingActionListener.java:31) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.core.common.IteratingActionListener.onResponse(IteratingActionListener.java:141) [x-pack-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.authc.RealmsAuthenticator.lambda$consumeToken$0(RealmsAuthenticator.java:162) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:136) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.authc.support.CachingUsernamePasswordRealm.lambda$authenticateWithCache$1(CachingUsernamePasswordRealm.java:155) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:136) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.authc.support.CachingUsernamePasswordRealm.handleCachedAuthentication(CachingUsernamePasswordRealm.java:242) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.authc.support.CachingUsernamePasswordRealm.lambda$authenticateWithCache$2(CachingUsernamePasswordRealm.java:139) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:136) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.common.util.concurrent.ListenableFuture.notifyListenerDirectly(ListenableFuture.java:113) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.common.util.concurrent.ListenableFuture.addListener(ListenableFuture.java:55) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.authc.support.CachingUsernamePasswordRealm.authenticateWithCache(CachingUsernamePasswordRealm.java:134) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.authc.support.CachingUsernamePasswordRealm.authenticate(CachingUsernamePasswordRealm.java:105) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.authc.RealmsAuthenticator.lambda$consumeToken$2(RealmsAuthenticator.java:146) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.core.common.IteratingActionListener.run(IteratingActionListener.java:117) [x-pack-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.authc.RealmsAuthenticator.consumeToken(RealmsAuthenticator.java:233) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.authc.RealmsAuthenticator.authenticate(RealmsAuthenticator.java:82) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.authc.AuthenticatorChain.lambda$getAuthenticatorConsumer$5(AuthenticatorChain.java:179) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.core.common.IteratingActionListener.onResponse(IteratingActionListener.java:135) [x-pack-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.authc.AuthenticatorChain.lambda$getAuthenticatorConsumer$5(AuthenticatorChain.java:157) [x-pack-security-8.2.0-SNA
   │ info PSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.core.common.IteratingActionListener.onResponse(IteratingActionListener.java:135) [x-pack-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.authc.AuthenticatorChain.lambda$getAuthenticatorConsumer$5(AuthenticatorChain.java:157) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.core.common.IteratingActionListener.onResponse(IteratingActionListener.java:135) [x-pack-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.authc.AuthenticatorChain.lambda$getAuthenticatorConsumer$5(AuthenticatorChain.java:157) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.core.common.IteratingActionListener.run(IteratingActionListener.java:117) [x-pack-core-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.authc.AuthenticatorChain.doAuthenticate(AuthenticatorChain.java:135) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.authc.AuthenticatorChain.authenticateAsync(AuthenticatorChain.java:94) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.authc.AuthenticationService.authenticate(AuthenticationService.java:149) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.authc.AuthenticationService.authenticate(AuthenticationService.java:127) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.xpack.security.rest.SecurityRestFilter.handleRequest(SecurityRestFilter.java:100) [x-pack-security-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.rest.RestController.dispatchRequest(RestController.java:391) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.rest.RestController.tryAllHandlers(RestController.java:470) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.rest.RestController.dispatchRequest(RestController.java:306) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.http.AbstractHttpServerTransport.dispatchRequest(AbstractHttpServerTransport.java:385) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.http.AbstractHttpServerTransport.handleIncomingRequest(AbstractHttpServerTransport.java:464) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.http.AbstractHttpServerTransport.incomingRequest(AbstractHttpServerTransport.java:359) [elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.http.netty4.Netty4HttpRequestHandler.channelRead0(Netty4HttpRequestHandler.java:32) [transport-netty4-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at org.elasticsearch.http.netty4.Netty4HttpRequestHandler.channelRead0(Netty4HttpRequestHandler.java:18) [transport-netty4-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99) [netty-transport-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) [netty-transport-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) [netty-transport-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) [netty-transport-4.1.73.Final.jar:4.1.73.Final]
   │      	at org.elasticsearch.http.netty4.Netty4HttpPipeliningHandler.channelRead(Netty4HttpPipeliningHandler.java:48) [transport-netty4-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
   │      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) [netty-transport-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) [netty-transport-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) [netty-transport-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [netty-codec-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) [netty-transport-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) [netty-transport-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) [netty-transport-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [netty-codec-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) [netty-codec-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) [netty-transport-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) [netty-transport-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) [netty-transport-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [netty-codec-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) [netty-transport-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) [netty-transport-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) [netty-transport-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [netty-codec-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) [netty-transport-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) [netty-transport-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) [netty-transport-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:327) [netty-codec-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:299) [netty-codec-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) [netty-transport-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) [netty-transport-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) [netty-transport-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286) [netty-handler-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) [netty-transport-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) [netty-transport-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) [netty-transport-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [netty-codec-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.channel.AbstractChannelHandle
   │ info rContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) [netty-transport-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) [netty-transport-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) [netty-transport-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) [netty-transport-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) [netty-transport-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) [netty-transport-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) [netty-transport-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166) [netty-transport-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:722) [netty-transport-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:623) [netty-transport-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:586) [netty-transport-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496) [netty-transport-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) [netty-common-4.1.73.Final.jar:4.1.73.Final]
   │      	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [netty-common-4.1.73.Final.jar:4.1.73.Final]
   │      	at java.lang.Thread.run(Thread.java:833) [?:?]
@marshallmain marshallmain added >bug needs:triage Requires assignment of a team area label labels Feb 23, 2022
@arteam arteam added the :Data Management/Indices APIs APIs to create and manage indices and templates label Feb 23, 2022
@elasticmachine elasticmachine added the Team:Data Management Meta label for data/management team label Feb 23, 2022
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

@arteam arteam removed Team:Data Management Meta label for data/management team needs:triage Requires assignment of a team area label labels Feb 23, 2022
@peluja1012
Copy link

This bug is causing multiple automated tests in Security Solution to fail in CI builds. Furthermore, it breaks existing functionality around our "alerts on alerts" feature of Detection Rules. It's also causing the issue reported in this ticket. Help prioritizing a fix would be greatly appreciated. 🙏

@dakrone dakrone self-assigned this Mar 1, 2022
@dakrone
Copy link
Member

dakrone commented Mar 1, 2022

@peluja1012 yep, I'll take a look at this.

dakrone added a commit to dakrone/elasticsearch that referenced this issue Mar 4, 2022
…emplate

Previously when constructing the "fake" response when simulating an index
template (`/_index_template/_simulate_index/<myindexname>`) an error would be thrown if there was an
index, alias, or data stream already existing with the provided index name. This commit makes it so
that simulating an index that may already exist treats it as though it was a new creation of the
index.

Resolves elastic#84256
FrankHassanabad added a commit to elastic/kibana that referenced this issue Mar 15, 2022
…126294)

## Summary

Increases the timeouts from 2 minutes to now 5 minutes and unskips the detection tests. If any of the tests fail consistently then I will skip just those individual tests instead of the whole suit.

See #125851 and elastic/elasticsearch#84256

This could cause issues with:
#125319

If so, then we will have to deal with the cloud based tests in a different way but in reality we need the extra time as some test cases do take a while to run on CI.

This also:
* Removes skips around code that have been in there for a while and adds documentation to the parts that are left over.

### 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
maksimkovalev pushed a commit to maksimkovalev/kibana that referenced this issue Mar 18, 2022
…lastic#126294)

## Summary

Increases the timeouts from 2 minutes to now 5 minutes and unskips the detection tests. If any of the tests fail consistently then I will skip just those individual tests instead of the whole suit.

See elastic#125851 and elastic/elasticsearch#84256

This could cause issues with:
elastic#125319

If so, then we will have to deal with the cloud based tests in a different way but in reality we need the extra time as some test cases do take a while to run on CI.

This also:
* Removes skips around code that have been in there for a while and adds documentation to the parts that are left over.

### 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
jsoriano added a commit to elastic/elastic-package that referenced this issue Jul 4, 2024
Use a different data stream name when simulating to check if synthetic is enabled.
There seems to be some conflict if the same name is reused. Maybe related to
elastic/elasticsearch#84256 or some similar issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Data Management/Indices APIs APIs to create and manage indices and templates
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants