Duplicate Records in member table.
tiokim opened this issue · comments
Describe the bug
When a new user logs in through the frontend webpage, two duplicate records are inserted.
As a result, the user can not log in.
To Reproduce
Steps to reproduce the behavior:
- Go to http://localhost:3000
- Click on login
- login with Google
- See the error logs from lpvs container
Logs from lpvs container
lpvs-lpvs-1 | 2023-09-15 00:56:58.047 ERROR 1 --- [nio-7896-exec-7] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.IncorrectResultSizeDataAccessException: query did not return a unique result: 2; nested exception is javax.persistence.NonUniqueResultException: query did not return a unique result: 2] with root cause
lpvs-lpvs-1 |
lpvs-lpvs-1 | javax.persistence.NonUniqueResultException: query did not return a unique result: 2
lpvs-lpvs-1 | at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:128) ~[hibernate-core-5.6.15.Final.jar!/:5.6.15.Final]
lpvs-lpvs-1 | at org.hibernate.query.internal.AbstractProducedQuery.getSingleResult(AbstractProducedQuery.java:1672) ~[hibernate-core-5.6.15.Final.jar!/:5.6.15.Final]
lpvs-lpvs-1 | at org.hibernate.query.criteria.internal.compile.CriteriaQueryTypeQueryAdapter.getSingleResult(CriteriaQueryTypeQueryAdapter.java:111) ~[hibernate-core-5.6.15.Final.jar!/:5.6.15.Final]
lpvs-lpvs-1 | at org.springframework.data.jpa.repository.query.JpaQueryExecution$SingleEntityExecution.doExecute(JpaQueryExecution.java:198) ~[spring-data-jpa-2.7.15.jar!/:2.7.15]
lpvs-lpvs-1 | at org.springframework.data.jpa.repository.query.JpaQueryExecution.execute(JpaQueryExecution.java:90) ~[spring-data-jpa-2.7.15.jar!/:2.7.15]
lpvs-lpvs-1 | at org.springframework.data.jpa.repository.query.AbstractJpaQuery.doExecute(AbstractJpaQuery.java:156) ~[spring-data-jpa-2.7.15.jar!/:2.7.15]
lpvs-lpvs-1 | at org.springframework.data.jpa.repository.query.AbstractJpaQuery.execute(AbstractJpaQuery.java:144) ~[spring-data-jpa-2.7.15.jar!/:2.7.15]
lpvs-lpvs-1 | at org.springframework.data.repository.core.support.RepositoryMethodInvoker.doInvoke(RepositoryMethodInvoker.java:137) ~[spring-data-commons-2.7.15.jar!/:2.7.15]
lpvs-lpvs-1 | at org.springframework.data.repository.core.support.RepositoryMethodInvoker.invoke(RepositoryMethodInvoker.java:121) ~[spring-data-commons-2.7.15.jar!/:2.7.15]
lpvs-lpvs-1 | at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.doInvoke(QueryExecutorMethodInterceptor.java:160) ~[spring-data-commons-2.7.15.jar!/:2.7.15]
lpvs-lpvs-1 | at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.invoke(QueryExecutorMethodInterceptor.java:139) ~[spring-data-commons-2.7.15.jar!/:2.7.15]
lpvs-lpvs-1 | at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.29.jar!/:5.3.29]
lpvs-lpvs-1 | at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:76) ~[spring-data-commons-2.7.15.jar!/:2.7.15]
lpvs-lpvs-1 | at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.29.jar!/:5.3.29]
lpvs-lpvs-1 | at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123) ~[spring-tx-5.3.29.jar!/:5.3.29]
lpvs-lpvs-1 | at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388) ~[spring-tx-5.3.29.jar!/:5.3.29]
lpvs-lpvs-1 | at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119) ~[spring-tx-5.3.29.jar!/:5.3.29]
lpvs-lpvs-1 | at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.29.jar!/:5.3.29]
lpvs-lpvs-1 | at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:137) ~[spring-tx-5.3.29.jar!/:5.3.29]
lpvs-lpvs-1 | at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.29.jar!/:5.3.29]
lpvs-lpvs-1 | at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:145) ~[spring-data-jpa-2.7.15.jar!/:2.7.15]
lpvs-lpvs-1 | at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.29.jar!/:5.3.29]
lpvs-lpvs-1 | at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97) ~[spring-aop-5.3.29.jar!/:5.3.29]
lpvs-lpvs-1 | at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.29.jar!/:5.3.29]
lpvs-lpvs-1 | at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:241) ~[spring-aop-5.3.29.jar!/:5.3.29]
lpvs-lpvs-1 | at com.sun.proxy.$Proxy117.findByEmailAndProvider(Unknown Source) ~[na:na]
lpvs-lpvs-1 | at com.lpvs.service.LPVSLoginCheckService.getMemberFromMemberMap(LPVSLoginCheckService.java:56) ~[classes!/:1.1.0]
lpvs-lpvs-1 | at com.lpvs.service.LPVSLoginCheckService$$FastClassBySpringCGLIB$$cb08147c.invoke(<generated>) ~[classes!/:1.1.0]
Test environment configuration (please complete the following information):
- Java: v11
- LPVS Release: 1.1.0