codeconsole opened a new issue, #15667:
URL: https://github.com/apache/grails-core/issues/15667

   ### Expected Behavior
   
   An absolutely MASSIVE exception is logged on startup if there is an index 
creation issue.  A bunch of useless information. 
   
   ```groovy
    } catch (MongoCommandException e) {
         LOG.error("Failed to create compound index for entity [" + 
entity.getName() + "] with definition [" +
     indexDef + "]: " + e.getMessage(), e);
     }
   ```
   
   MongoDatastore.java:875
   ```
   2026-05-18T01:52:05.929Z ERROR 3173333 --- [  restartedMain] 
o.g.d.mapping.core.AbstractDatastore     : Failed to create compound index for 
entity [...] with definition [...: Command failed with error 86 
(IndexKeySpecsConflict): 'An existing index has the same name as the requested 
index. When index names are not specified, they are auto generated and can 
cause conflicts. Please refer to our documentation. Requested index: ...  name: 
... on server localhost:27017. The full response is {"ok": 0.0, "errmsg": "An 
existing index has the same name as the requested index. When index names are 
not specified, they are auto generated and can cause conflicts. Please refer to 
our documentation. Requested index:... , existing index: ...
   
   com.mongodb.MongoCommandException: Command failed with error 86 
(IndexKeySpecsConflict): 'An existing index has the same name as the requested 
index. When index names are not specified, they are auto generated and can 
cause conflicts. Please refer to our documentation. Requested index: ..., 
existing index: ...  on server localhost:27017. The full response is {"ok": 
0.0, "errmsg": "An existing index has the same name as the requested index. 
When index names are not specified, they are auto generated and can cause 
conflicts. Please refer to our documentation. Requested index:... ", "code": 
86, "codeName": "IndexKeySpecsConflict"}
           at 
com.mongodb.internal.connection.ProtocolHelper.getCommandFailureException(ProtocolHelper.java:210)
           at 
com.mongodb.internal.connection.InternalStreamConnection.receiveCommandMessageResponse(InternalStreamConnection.java:520)
           at 
com.mongodb.internal.connection.InternalStreamConnection.sendAndReceiveInternal(InternalStreamConnection.java:448)
           at 
com.mongodb.internal.connection.InternalStreamConnection.lambda$sendAndReceive$0(InternalStreamConnection.java:375)
           at 
com.mongodb.internal.connection.InternalStreamConnection.sendAndReceive(InternalStreamConnection.java:378)
           at 
com.mongodb.internal.connection.UsageTrackingInternalConnection.sendAndReceive(UsageTrackingInternalConnection.java:111)
           at 
com.mongodb.internal.connection.DefaultConnectionPool$PooledConnection.sendAndReceive(DefaultConnectionPool.java:747)
           at 
com.mongodb.internal.connection.CommandProtocolImpl.execute(CommandProtocolImpl.java:61)
           at 
com.mongodb.internal.connection.DefaultServer$DefaultServerProtocolExecutor.execute(DefaultServer.java:208)
           at 
com.mongodb.internal.connection.DefaultServerConnection.executeProtocol(DefaultServerConnection.java:112)
           at 
com.mongodb.internal.connection.DefaultServerConnection.command(DefaultServerConnection.java:82)
           at 
com.mongodb.internal.connection.DefaultServerConnection.command(DefaultServerConnection.java:74)
           at 
com.mongodb.internal.connection.DefaultServer$OperationCountTrackingConnection.command(DefaultServer.java:298)
           at 
com.mongodb.internal.operation.SyncOperationHelper.lambda$executeCommand$5(SyncOperationHelper.java:209)
           at 
com.mongodb.internal.operation.SyncOperationHelper.lambda$withSourceAndConnection$0(SyncOperationHelper.java:131)
           at 
com.mongodb.internal.operation.SyncOperationHelper.withSuppliedResource(SyncOperationHelper.java:156)
           at 
com.mongodb.internal.operation.SyncOperationHelper.lambda$withSourceAndConnection$1(SyncOperationHelper.java:130)
           at 
com.mongodb.internal.operation.SyncOperationHelper.withSuppliedResource(SyncOperationHelper.java:156)
           at 
com.mongodb.internal.operation.SyncOperationHelper.withSourceAndConnection(SyncOperationHelper.java:129)
           at 
com.mongodb.internal.operation.SyncOperationHelper.executeCommand(SyncOperationHelper.java:207)
           at 
com.mongodb.internal.operation.CreateIndexesOperation.execute(CreateIndexesOperation.java:105)
           at 
com.mongodb.internal.operation.CreateIndexesOperation.execute(CreateIndexesOperation.java:60)
           at 
com.mongodb.client.internal.MongoClusterImpl$OperationExecutorImpl.execute(MongoClusterImpl.java:446)
           at 
com.mongodb.client.internal.MongoCollectionImpl.executeCreateIndexes(MongoCollectionImpl.java:941)
           at 
com.mongodb.client.internal.MongoCollectionImpl.createIndexes(MongoCollectionImpl.java:923)
           at 
com.mongodb.client.internal.MongoCollectionImpl.createIndexes(MongoCollectionImpl.java:918)
           at 
com.mongodb.client.internal.MongoCollectionImpl.createIndex(MongoCollectionImpl.java:903)
           at 
org.grails.datastore.mapping.mongo.MongoDatastore.initializeIndices(MongoDatastore.java:870)
           at 
org.grails.datastore.mapping.mongo.MongoDatastore.buildIndex(MongoDatastore.java:541)
           at 
org.grails.datastore.mapping.mongo.MongoDatastore.initialize(MongoDatastore.java:765)
           at 
org.grails.datastore.mapping.mongo.MongoDatastore.<init>(MongoDatastore.java:237)
           at 
org.grails.datastore.mapping.mongo.MongoDatastore.<init>(MongoDatastore.java:274)
           at 
org.grails.datastore.mapping.mongo.MongoDatastore.<init>(MongoDatastore.java:383)
           at 
java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62)
           at 
java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
           at 
java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:483)
           at 
org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:210)
           at 
org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:146)
           at 
org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:318)
           at 
org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:309)
           at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1395)
           at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1232)
           at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:569)
           at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:529)
           at 
org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:339)
           at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:373)
           at 
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:337)
           at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
           at 
org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:413)
           at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1375)
           at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1205)
           at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:569)
           at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:529)
           at 
org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:339)
           at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:373)
           at 
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:337)
           at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
           at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByName(AbstractAutowireCapableBeanFactory.java:1493)
           at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1446)
           at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:606)
           at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:529)
           at 
org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:339)
           at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:373)
           at 
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:337)
           at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
           at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByName(AbstractAutowireCapableBeanFactory.java:1493)
           at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1446)
           at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:606)
           at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:529)
           at 
org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:339)
           at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:373)
           at 
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:337)
           at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
           at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByName(AbstractAutowireCapableBeanFactory.java:1493)
           at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1446)
           at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:606)
           at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:529)
           at 
org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:339)
           at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:373)
           at 
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:337)
           at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
           at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1708)
           at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1653)
           at 
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:784)
           at 
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:767)
           at 
org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:146)
           at 
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:509)
           at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1459)
           at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:606)
           at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:529)
           at 
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBeanValue(BeanDefinitionValueResolver.java:407)
           at 
org.springframework.beans.factory.support.BeanDefinitionValueResolver.lambda$resolveValueIfNecessary$1(BeanDefinitionValueResolver.java:153)
           at 
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:262)
           at 
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:152)
           at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1725)
           at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1474)
           at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:606)
           at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:529)
           at 
org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:339)
           at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:373)
           at 
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:337)
           at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:207)
           at 
org.springframework.boot.web.servlet.ServletContextInitializerBeans.getOrderedBeansOfType(ServletContextInitializerBeans.java:230)
           at 
org.springframework.boot.web.servlet.ServletContextInitializerBeans.getOrderedBeansOfType(ServletContextInitializerBeans.java:221)
           at 
org.springframework.boot.web.servlet.ServletContextInitializerBeans.addServletContextInitializerBeans(ServletContextInitializerBeans.java:106)
           at 
org.springframework.boot.web.servlet.ServletContextInitializerBeans.<init>(ServletContextInitializerBeans.java:95)
           at 
org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.getServletContextInitializerBeans(ServletWebServerApplicationContext.java:271)
           at 
org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.selfInitialize(ServletWebServerApplicationContext.java:245)
           at 
org.springframework.boot.web.embedded.tomcat.TomcatStarter.onStartup(TomcatStarter.java:52)
           at 
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4452)
           at 
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:164)
           at 
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1201)
           at 
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1191)
           at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:328)
           at 
org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:81)
           at 
java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:149)
           at 
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:747)
           at 
org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:783)
           at 
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:164)
           at 
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1201)
           at 
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1191)
           at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:328)
           at 
org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:81)
           at 
java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:149)
           at 
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:747)
           at 
org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:201)
           at 
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:164)
           at 
org.apache.catalina.core.StandardService.startInternal(StandardService.java:410)
           at 
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:164)
           at 
org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:868)
           at 
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:164)
           at org.apache.catalina.startup.Tomcat.start(Tomcat.java:436)
           at 
org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:128)
           at 
org.springframework.boot.web.embedded.tomcat.TomcatWebServer.<init>(TomcatWebServer.java:107)
           at 
org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getTomcatWebServer(TomcatServletWebServerFactory.java:517)
           at 
org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:219)
           at 
org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:193)
           at 
org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:167)
           at 
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:622)
           at 
org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146)
           at 
org.springframework.boot.SpringApplication.refresh(SpringApplication.java:752)
           at 
org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:439)
           at 
org.springframework.boot.SpringApplication.run(SpringApplication.java:318)
           at grails.boot.GrailsApp.run(GrailsApp.groovy:100)
           at grails.boot.GrailsApp.run(GrailsApp.groovy:394)
           at grails.boot.GrailsApp.run(GrailsApp.groovy:383)
           at pixoto.Application.main(Application.groovy:62)
           at 
java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
           at java.base/java.lang.reflect.Method.invoke(Method.java:565)
           at 
org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:50)
   ```
   
   ### Actual Behaviour
   
   _No response_
   
   ### Steps To Reproduce
   
   _No response_
   
   ### Environment Information
   
   _No response_
   
   ### Example Application
   
   _No response_
   
   ### Version
   
   7.0.0


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to