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

System trying to add a second index entry for a given project to the database #4987

Open
reckart opened this issue Aug 13, 2024 · 0 comments
Labels
🐛Bug Something isn't working Module: Project Search
Milestone

Comments

@reckart
Copy link
Member

reckart commented Aug 13, 2024

Describe the bug
Index metadata is kept in the database. It seems to be possible that situations could occur when the system tries to add a second index metadata entry for a project.

To Reproduce
Not sure. Looks like a race condition.

Expected behavior
Only a single index metadata item for a project should ever be added to a DB. If one already exists, no other one should be added.

Screenshots

2024-08-13 23:07:29 ERROR [inception-worker-1] [SYSTEM] SqlExceptionHelper - (conn=104) Duplicate entry '144' for key 'UK_index_project'
2024-08-13 23:07:29 ERROR [inception-worker-1] [SYSTEM] Task - Task [Rebuilding index...] failed (trigger: [onLayerConfigurationChanged])
javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not execute statement
	at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:154) ~[hibernate-core-5.6.15.Final.jar:5.6.15.Final]
	at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:181) ~[hibernate-core-5.6.15.Final.jar:5.6.15.Final]
	at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:188) ~[hibernate-core-5.6.15.Final.jar:5.6.15.Final]
	at org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:762) ~[hibernate-core-5.6.15.Final.jar:5.6.15.Final]
	at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:742) ~[hibernate-core-5.6.15.Final.jar:5.6.15.Final]
	at jdk.internal.reflect.GeneratedMethodAccessor292.invoke(Unknown Source) ~[?:?]
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
	at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:316) ~[spring-orm-5.3.37.jar:5.3.37]
	at jdk.proxy2/jdk.proxy2.$Proxy193.persist(Unknown Source) ~[?:?]
	at de.tudarmstadt.ukp.inception.search.SearchServiceImpl.loadIndex(SearchServiceImpl.java:264) ~[classes/:?]
	at de.tudarmstadt.ukp.inception.search.SearchServiceImpl.acquireIndex(SearchServiceImpl.java:373) ~[classes/:?]
	at de.tudarmstadt.ukp.inception.search.SearchServiceImpl.reindex(SearchServiceImpl.java:651) ~[classes/:?]
	at de.tudarmstadt.ukp.inception.search.SearchServiceImpl$$FastClassBySpringCGLIB$$d6146f50.invoke(<generated>) ~[classes/:?]
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.37.jar:5.3.37]
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:792) ~[spring-aop-5.3.37.jar:5.3.37]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.3.37.jar:5.3.37]
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:762) ~[spring-aop-5.3.37.jar:5.3.37]
	at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123) ~[spring-tx-5.3.37.jar:5.3.37]
	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388) ~[spring-tx-5.3.37.jar:5.3.37]
	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119) ~[spring-tx-5.3.37.jar:5.3.37]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.37.jar:5.3.37]
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:762) ~[spring-aop-5.3.37.jar:5.3.37]
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:707) ~[spring-aop-5.3.37.jar:5.3.37]
	at de.tudarmstadt.ukp.inception.search.SearchServiceImpl$$EnhancerBySpringCGLIB$$4fefb718.reindex(<generated>) ~[classes/:?]
	at de.tudarmstadt.ukp.inception.search.scheduling.tasks.ReindexTask.execute(ReindexTask.java:71) ~[classes/:?]
	at de.tudarmstadt.ukp.inception.scheduling.Task.runSync(Task.java:203) [classes/:?]
	at de.tudarmstadt.ukp.inception.scheduling.Task.run(Task.java:190) [classes/:?]
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
	at java.base/java.lang.Thread.run(Thread.java:833) [?:?]

Please complete the following information:

  • Version and build ID: [see bottom of the browser screen]
  • OS: [e.g. Windows, Linux, OS X]
  • Browser: [e.g. chrome, safari]

Additional context
Add any other context about the problem here.

@reckart reckart added 🐛Bug Something isn't working Module: Project Search labels Aug 13, 2024
@reckart reckart modified the milestones: 33.5, 33.6 Aug 13, 2024
@reckart reckart modified the milestones: 33.6, 33.7 Sep 1, 2024
@reckart reckart modified the milestones: 33.7, 35.1 Sep 18, 2024
@reckart reckart modified the milestones: 34.1, 34.2 Oct 14, 2024
@reckart reckart modified the milestones: 34.2, 34.3 Oct 29, 2024
@reckart reckart modified the milestones: 34.3, 34.4 Nov 12, 2024
@reckart reckart modified the milestones: 34.4, 34.5 Nov 26, 2024
@reckart reckart modified the milestones: 34.5, 34.6 Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛Bug Something isn't working Module: Project Search
Projects
None yet
Development

No branches or pull requests

1 participant