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

TaskRepositoy.findByChainDealIdAndTaskIndex() returns non-unique result #423

Closed
zguesmi opened this issue Sep 20, 2021 · 0 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@zguesmi
Copy link
Member

zguesmi commented Sep 20, 2021

Error

Query { "$java" : Query: { "chainDealId" : "0x3795a95c341f4d60b829d7b5b37dc26d5f6bacd45b2ec26c4fadd498f25f03b8", "taskIndex" : 0 }, Fields: { }, Sort: { } } returned non unique result

Stacktrace:

Exception in thread "Scheduled-1" io.reactivex.exceptions.OnErrorNotImplementedException: The exception was not handled due to missing onError handler in the subscribe() method call. Further reading: https://github.com/ReactiveX/RxJava/wiki/Error-Handling | org.springframework.dao.IncorrectResultSizeDataAccessException: Query { "$java" : Query: { "chainDealId" : "0x3795a95c341f4d60b829d7b5b37dc26d5f6bacd45b2ec26c4fadd498f25f03b8", "taskIndex" : 0 }, Fields: { }, Sort: { } } returned non unique result.
	at io.reactivex.internal.functions.Functions$OnErrorMissingConsumer.accept(Functions.java:704)
    ...
	at io.reactivex.Flowable.subscribe(Flowable.java:14651)
	at com.iexec.core.chain.DealWatcherService.subscribeToDealEventInRange(DealWatcherService.java:176)
	at com.iexec.core.chain.DealWatcherService.replayDealEvent(DealWatcherService.java:160)
	at jdk.internal.reflect.GeneratedMethodAccessor166.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:198)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:752)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
	at com.iexec.core.chain.DealWatcherService$$EnhancerBySpringCGLIB$$6099193c.replayDealEvent(<generated>)
	at jdk.internal.reflect.GeneratedMethodAccessor166.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.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84)
	at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.runAndReset(Unknown Source)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: org.springframework.dao.IncorrectResultSizeDataAccessException: Query { "$java" : Query: { "chainDealId" : "0x3795a95c341f4d60b829d7b5b37dc26d5f6bacd45b2ec26c4fadd498f25f03b8", "taskIndex" : 0 }, Fields: { }, Sort: { } } returned non unique result.
	at org.springframework.data.mongodb.core.ExecutableFindOperationSupport$ExecutableFindSupport.oneValue(ExecutableFindOperationSupport.java:133)
	at org.springframework.data.mongodb.repository.query.AbstractMongoQuery.lambda$getExecution$4(AbstractMongoQuery.java:126)
	at org.springframework.data.mongodb.repository.query.AbstractMongoQuery.execute(AbstractMongoQuery.java:99)
	at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:605)
	at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.lambda$invoke$3(RepositoryFactorySupport.java:595)
	at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:595)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:59)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:93)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.data.repository.core.support.SurroundingTransactionDetectorMethodInterceptor.invoke(SurroundingTransactionDetectorMethodInterceptor.java:61)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
	at com.iexec.core.task.$Proxy132.findByChainDealIdAndTaskIndex(Unknown Source)
	at com.iexec.core.task.TaskService.addTask(TaskService.java:102)
	at com.iexec.core.chain.DealWatcherService.handleDeal(DealWatcherService.java:130)
	at com.iexec.core.chain.DealWatcherService.onDealEvent(DealWatcherService.java:101)
	at java.base/java.util.Optional.ifPresent(Unknown Source)
	at com.iexec.core.chain.DealWatcherService.lambda$subscribeToDealEventInRange$2(DealWatcherService.java:176)
	at io.reactivex.internal.subscribers.LambdaSubscriber.onNext(LambdaSubscriber.java:65)
	... 39 more

Fix:

Add @Document to Task entity.

@zguesmi zguesmi self-assigned this Sep 20, 2021
@zguesmi zguesmi added the bug Something isn't working label Sep 20, 2021
@zguesmi zguesmi closed this as completed Sep 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant