Page 1 of 1

There was an error while accessing the database

Posted: Sat Apr 21, 2018 4:14 pm
by denden
Hello!

Could somebody help me to fix the following bag?

I have changed the user's negative balance limit from default (-10 000 units) to custom (0 units).
Then tried to change it one more time (-1 000 units) but have got the following message from tne system: "There was an error while accessing the database"

The link: https://communities.cyclos.org/dos#user ... 4172737087

I read the problem might be in changing of translation key. Really, I have changed the translation of notification about balance limits change. But then I set up old virsion of this translation but the mistake didn't disappeared :cry:

Re: There was an error while accessing the database

Posted: Sat Apr 21, 2018 4:44 pm
by denden
This is error log:

org.cyclos.model.UnexpectedDataAccessException: javax.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.7.1.v20171221-bd47e8f): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: org.postgresql.util.PSQLException: ERROR: value too long for type character varying(255)
Error Code: 0
Call: INSERT INTO notifications (date, entity_id, html_text, location, mail_subject, is_processed, is_read, sms, user_type, related_user_id, user_id, subclass) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
bind => [12 parameters bound]
Query: InsertObjectQuery(UserNotification#null)
at org.cyclos.impl.utils.persistence.AbstractEntityManagerHandlerImpl.flush(AbstractEntityManagerHandlerImpl.java:186)
at org.cyclos.impl.utils.persistence.AbstractEntityManagerHandlerImpl.persist(AbstractEntityManagerHandlerImpl.java:129)
at org.cyclos.impl.utils.persistence.EntityManagerHandlerImpl.persist(EntityManagerHandlerImpl.java:291)
at org.cyclos.impl.utils.persistence.AbstractEntityManagerHandlerImpl.persist(AbstractEntityManagerHandlerImpl.java:121)
at org.cyclos.impl.AbstractServerComponent.persist(AbstractServerComponent.java:187)
at org.cyclos.impl.utils.notifications.NotificationHandlerImpl.persistAndSendPush(NotificationHandlerImpl.java:386)
at org.cyclos.impl.utils.notifications.NotificationHandlerImpl.notify(NotificationHandlerImpl.java:346)
at org.cyclos.impl.utils.notifications.NotificationHandlerImpl.notify(NotificationHandlerImpl.java:175)
at org.cyclos.impl.utils.notifications.NotificationsHandlerAccessorInvocationHandlerImpl.notify(NotificationsHandlerAccessorInvocationHandlerImpl.java:231)
at org.cyclos.impl.utils.notifications.NotificationsHandlerAccessorInvocationHandlerImpl.invoke(NotificationsHandlerAccessorInvocationHandlerImpl.java:106)
at com.sun.proxy.$Proxy304.limitChange(Unknown Source)
at org.cyclos.impl.banking.AccountServiceImpl.setBalanceLimit(AccountServiceImpl.java:3538)
at org.cyclos.impl.banking.AccountServiceImpl.setBalanceLimit(AccountServiceImpl.java:2287)
at org.cyclos.security.banking.AccountServiceSecurity.setBalanceLimit(AccountServiceSecurity.java:387)
at sun.reflect.GeneratedMethodAccessor5172.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.cyclos.impl.ServiceInvokerHandlerImpl$ServiceInvocationTransactionCallback.performInvocation(ServiceInvokerHandlerImpl.java:261)
at org.cyclos.impl.ServiceInvokerHandlerImpl$ServiceInvocationTransactionCallback.lambda$0(ServiceInvokerHandlerImpl.java:208)
at org.cyclos.impl.InvokerHandlerImpl.runAs(InvokerHandlerImpl.java:104)
at org.cyclos.impl.ServiceInvokerHandlerImpl$ServiceInvocationTransactionCallback.doInTransaction(ServiceInvokerHandlerImpl.java:208)
at org.cyclos.impl.ServiceInvokerHandlerImpl$ServiceInvocationTransactionCallback.doInTransaction(ServiceInvokerHandlerImpl.java:1)
at org.cyclos.impl.utils.transaction.TransactionHandlerImpl.runEnsuringInvocationContext(TransactionHandlerImpl.java:183)
at org.cyclos.impl.utils.transaction.TransactionHandlerImpl.doRun(TransactionHandlerImpl.java:109)
at org.cyclos.impl.utils.transaction.TransactionHandlerImpl.run(TransactionHandlerImpl.java:159)
at org.cyclos.impl.utils.transaction.TransactionHandlerImpl.run(TransactionHandlerImpl.java:80)
at sun.reflect.GeneratedMethodAccessor65.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:338)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:206)
at com.sun.proxy.$Proxy58.run(Unknown Source)
at org.cyclos.impl.InvokerHandlerImpl.performInTransaction(InvokerHandlerImpl.java:233)
at org.cyclos.impl.InvokerHandlerImpl.doRunAsInTransaction(InvokerHandlerImpl.java:182)
at org.cyclos.impl.InvokerHandlerImpl.runAsInTransaction(InvokerHandlerImpl.java:163)
at org.cyclos.impl.ServiceInvokerHandlerImpl.doInvoke(ServiceInvokerHandlerImpl.java:666)
at org.cyclos.impl.ServiceInvokerHandlerImpl.invoke(ServiceInvokerHandlerImpl.java:499)
at org.cyclos.impl.access.ServiceFacadeImpl.lambda$2(ServiceFacadeImpl.java:163)
at org.cyclos.impl.access.ServiceFacadeImpl.runInRequestContext(ServiceFacadeImpl.java:504)
at org.cyclos.impl.access.ServiceFacadeImpl.invoke(ServiceFacadeImpl.java:161)
at org.cyclos.server.spring.root.RequestServiceFactory$ServiceProxyInvocationHandler.invoke(RequestServiceFactory.java:74)
at com.sun.proxy.$Proxy164.setBalanceLimit(Unknown Source)
at sun.reflect.GeneratedMethodAccessor5146.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.cyclos.server.spring.webrpc.WebRpcRequestHandler.handleRequest(WebRpcRequestHandler.java:144)
at org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle(HttpRequestHandlerAdapter.java:53)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:991)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:978)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:881)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:855)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.cyclos.server.http.CORSFilter.doFilterInternal(CORSFilter.java:65)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:357)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:270)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:101)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:357)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:270)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:728)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:467)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:392)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:311)
at org.cyclos.server.http.RequestDataFilter.doFilterInternal(RequestDataFilter.java:208)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:357)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:270)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.cyclos.server.http.RequestContextFilter.doFilterInternal(RequestContextFilter.java:52)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:357)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:270)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
at org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:486)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
Caused by: javax.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.7.1.v20171221-bd47e8f): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: org.postgresql.util.PSQLException: ERROR: value too long for type character varying(255)
Error Code: 0
Call: INSERT INTO notifications (date, entity_id, html_text, location, mail_subject, is_processed, is_read, sms, user_type, related_user_id, user_id, subclass) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
bind => [12 parameters bound]
Query: InsertObjectQuery(UserNotification#null)
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.flush(EntityManagerImpl.java:972)
at org.cyclos.impl.utils.persistence.AbstractEntityManagerHandlerImpl.flush(AbstractEntityManagerHandlerImpl.java:182)
... 101 more
Caused by: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.7.1.v20171221-bd47e8f): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: org.postgresql.util.PSQLException: ERROR: value too long for type character varying(255)
Error Code: 0
Call: INSERT INTO notifications (date, entity_id, html_text, location, mail_subject, is_processed, is_read, sms, user_type, related_user_id, user_id, subclass) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
bind => [12 parameters bound]
Query: InsertObjectQuery(UserNotification#null)
at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:340)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.processExceptionForCommError(DatabaseAccessor.java:1645)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(DatabaseAccessor.java:903)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeNoSelect(DatabaseAccessor.java:967)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:637)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:564)
at org.eclipse.persistence.internal.sessions.AbstractSession.basicExecuteCall(AbstractSession.java:2093)
at org.eclipse.persistence.sessions.server.ClientSession.executeCall(ClientSession.java:309)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:270)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:256)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.insertObject(DatasourceCallQueryMechanism.java:405)
at org.eclipse.persistence.internal.queries.StatementQueryMechanism.insertObject(StatementQueryMechanism.java:165)
at org.eclipse.persistence.internal.queries.StatementQueryMechanism.insertObject(StatementQueryMechanism.java:180)
at org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.insertObjectForWrite(DatabaseQueryMechanism.java:502)
at org.eclipse.persistence.queries.InsertObjectQuery.executeCommit(InsertObjectQuery.java:80)
at org.eclipse.persistence.queries.InsertObjectQuery.executeCommitWithChangeSet(InsertObjectQuery.java:90)
at org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.executeWriteWithChangeSet(DatabaseQueryMechanism.java:314)
at org.eclipse.persistence.queries.WriteObjectQuery.executeDatabaseQuery(WriteObjectQuery.java:58)
at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:911)
at org.eclipse.persistence.queries.DatabaseQuery.executeInUnitOfWork(DatabaseQuery.java:810)
at org.eclipse.persistence.queries.ObjectLevelModifyQuery.executeInUnitOfWorkObjectLevelModifyQuery(ObjectLevelModifyQuery.java:108)
at org.eclipse.persistence.queries.ObjectLevelModifyQuery.executeInUnitOfWork(ObjectLevelModifyQuery.java:85)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2979)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1892)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1874)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1824)
at org.eclipse.persistence.internal.sessions.CommitManager.commitNewObjectsForClassWithChangeSet(CommitManager.java:227)
at org.eclipse.persistence.internal.sessions.CommitManager.commitAllObjectsWithChangeSet(CommitManager.java:126)
at org.eclipse.persistence.internal.sessions.AbstractSession.writeAllObjectsWithChangeSet(AbstractSession.java:4384)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabase(UnitOfWorkImpl.java:1491)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabaseWithPreBuiltChangeSet(UnitOfWorkImpl.java:1637)
at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.writeChanges(RepeatableWriteUnitOfWork.java:455)
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.flush(EntityManagerImpl.java:967)
... 102 more
Caused by: org.postgresql.util.PSQLException: ERROR: value too long for type character varying(255)
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2422)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2167)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:306)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:155)
at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:132)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:384)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(DatabaseAccessor.java:895)
... 132 more

Re: There was an error while accessing the database

Posted: Sat Apr 21, 2018 5:06 pm
by denden
When I disabled sending the notification about balance limit changing the error disappeared! But what's the reason? Why translation key influences on execution an operation?
And the reason is internal notification, not email (first of all I disabled the email message but the error still remained).

Re: There was an error while accessing the database

Posted: Sat Apr 21, 2018 5:29 pm
by denden
Oh, I found it!:-)

The mistake was in the translation of the text of the internal notification!

Re: There was an error while accessing the database

Posted: Sat Apr 21, 2018 5:30 pm
by denden
Thanks for all of you! :D