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

Can not delete api with too many events #9439

Closed
exalate-issue-sync bot opened this issue Dec 20, 2023 · 1 comment
Closed

Can not delete api with too many events #9439

exalate-issue-sync bot opened this issue Dec 20, 2023 · 1 comment

Comments

@exalate-issue-sync
Copy link

exalate-issue-sync bot commented Dec 20, 2023

Describe the bug :

Api can not be deleted if it has too many events. The query is taking up the memory of mongodb resulting in the query not being run.

Expected behaviour :

The query needs to be optimized to be able to delete any amount of events when it removes APIs.

Current behaviour :

Too many events stop the query from execution making it impossible to remove an API.

Useful information :

2023-12-19 11:24:06.698 <span class="error"><span class="error">[gravitee-listener-107]</span></span> ERROR i.g.r.a.m.v.r.e.ThrowableMapper - Internal error org.springframework.data.mongodb.UncategorizedMongoDbException: Query failed with error code 292 with name 'QueryExceededMemoryLimitNoDiskUseAllowed' and error message 'error while multiplanner was selecting best plan :: caused by :: Sort exceeded memory limit of 33554432 bytes, but did not opt in to external sorting.' on server ac-gcitviv-shard-00-01.fy2sik3.mongodb.net:27017  at org.springframework.data.mongodb.core.MongoExceptionTranslator.translateExceptionIfPossible(MongoExceptionTranslator.java:140)  at org.springframework.data.mongodb.core.MongoTemplate.potentiallyConvertRuntimeException(MongoTemplate.java:3029)  at org.springframework.data.mongodb.core.MongoTemplate.executeFindMultiInternal(MongoTemplate.java:2965)  at org.springframework.data.mongodb.core.MongoTemplate.doFind(MongoTemplate.java:2651)  at org.springframework.data.mongodb.core.MongoTemplate.doFind(MongoTemplate.java:2633)  at org.springframework.data.mongodb.core.MongoTemplate.find(MongoTemplate.java:883)  at org.springframework.data.mongodb.core.MongoTemplate.find(MongoTemplate.java:869)  at io.gravitee.repository.mongodb.management.internal.event.EventMongoRepositoryImpl.search(EventMongoRepositoryImpl.java:66)  at jdk.internal.reflect.GeneratedMethodAccessor165.invoke(Unknown Source)  at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)  at java.base/java.lang.reflect.Method.invoke(Unknown Source)  at org.springframework.data.repository.core.support.RepositoryMethodInvoker$RepositoryFragmentMethodInvoker.lambda$new$0(RepositoryMethodInvoker.java:289)  at org.springframework.data.repository.core.support.RepositoryMethodInvoker.doInvoke(RepositoryMethodInvoker.java:137)  at org.springframework.data.repository.core.support.RepositoryMethodInvoker.invoke(RepositoryMethodInvoker.java:121)  at org.springframework.data.repository.core.support.RepositoryComposition$RepositoryFragments.invoke(RepositoryComposition.java:530)  at org.springframework.data.repository.core.support.RepositoryComposition.invoke(RepositoryComposition.java:286)  at org.springframework.data.repository.core.support.RepositoryFactorySupport$ImplementationMethodExecutionInterceptor.invoke(RepositoryFactorySupport.java:640)  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)  at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.doInvoke(QueryExecutorMethodInterceptor.java:164)  at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.invoke(QueryExecutorMethodInterceptor.java:139)  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)  at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:81)  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)  at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)  at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:244)  at jdk.proxy5/jdk.proxy5.$Proxy234.search(Unknown Source)  at io.gravitee.repository.mongodb.management.MongoEventRepository.search(MongoEventRepository.java:135)  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)  at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)  at java.base/java.lang.reflect.Method.invoke(Unknown Source)  at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)  at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:237)  at jdk.proxy3/jdk.proxy3.$Proxy106.search(Unknown Source)  at io.gravitee.rest.api.service.impl.EventServiceImpl.search(EventServiceImpl.java:356)  at io.gravitee.rest.api.service.impl.EventServiceImpl.deleteApiEvents(EventServiceImpl.java:295)  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)  at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)  at java.base/java.lang.reflect.Method.invoke(Unknown Source)  at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)  at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:196)  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)  at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)  at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:391)  at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)  at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:244)  at jdk.proxy3/jdk.proxy3.$Proxy125.deleteApiEvents(Unknown Source)  at io.gravitee.rest.api.service.v4.impl.ApiServiceImpl.delete(ApiServiceImpl.java:608)  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)  at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)  at java.base/java.lang.reflect.Method.invoke(Unknown Source)  at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)  at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:196)  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)  at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)  at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:391)  at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)  at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:244)  at jdk.proxy3/jdk.proxy3.$Proxy197.delete(Unknown Source)  at io.gravitee.rest.api.management.v2.rest.resource.api.ApiResource.deleteApi(ApiResource.java:271)  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)  at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)  at java.base/java.lang.reflect.Method.invoke(Unknown Source)  at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52)  at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:146)  at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:189)

Desktop :

  • Environment: [4.1.4]
Copy link
Author

This issue will be fixed in versions 4.0.15, 4.2.0, 3.20.26, 4.1.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

0 participants