Athou / commafeed

Google Reader inspired self-hosted personal RSS reader.
https://www.commafeed.com
Apache License 2.0
2.72k stars 370 forks source link

Feeds not updating #313

Closed vipere closed 11 years ago

vipere commented 11 years ago

This has been brought up before, and I've tried the suggestions but none helped. Running the latest version of commafeed, the feeds stopped updating.

The values in the table hibernate_sequences are set as required, but I noticed that after running commafeed the rows FEEDENTRIES/FEEDENTRYCONTENTS/FEEDENTRYSTATUSES get incremented from say X to 1000+X for some reason.

The log is full of errors like below:

EJB Invocation failed on component FeedUpdateService for method public void com.commafeed.backend.services.FeedUpdateService.updateEntry(com.commafeed.backend.model.Feed,com.commafeed.backend.model.FeedEntry,java.util.List): javax.ejb.EJBTransactionRolledbackException: Transaction rolled back
    at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleEndTransactionException(CMTTxInterceptor.java:114) [jboss-as-ejb3.jar:7.2.0.Final-redhat-8]
    at org.jboss.as.ejb3.tx.CMTTxInterceptor.endTransaction(CMTTxInterceptor.java:94) [jboss-as-ejb3.jar:7.2.0.Final-redhat-8]
    at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:252) [jboss-as-ejb3.jar:7.2.0.Final-redhat-8]
    at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:315) [jboss-as-ejb3.jar:7.2.0.Final-redhat-8]
    at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:214) [jboss-as-ejb3.jar:7.2.0.Final-redhat-8]
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation.jar:1.1.1.Final-redhat-2]
    at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [jboss-as-ejb3.jar:7.2.0.Final-redhat-8]
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation.jar:1.1.1.Final-redhat-2]
    at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64) [jboss-as-ejb3.jar:7.2.0.Final-redhat-8]
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation.jar:1.1.1.Final-redhat-2]
    at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59) [jboss-as-ejb3.jar:7.2.0.Final-redhat-8]
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation.jar:1.1.1.Final-redhat-2]
    at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50) [jboss-as-ee.jar:7.2.0.Final-redhat-8]
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation.jar:1.1.1.Final-redhat-2]
    at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:55) [jboss-as-ejb3.jar:7.2.0.Final-redhat-8]
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation.jar:1.1.1.Final-redhat-2]
    at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45) [jboss-as-ee.jar:7.2.0.Final-redhat-8]
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation.jar:1.1.1.Final-redhat-2]
    at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation.jar:1.1.1.Final-redhat-2]
    at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:165) [jboss-as-ee.jar:7.2.0.Final-redhat-8]
    at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:182) [jboss-as-ee.jar:7.2.0.Final-redhat-8]
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation.jar:1.1.1.Final-redhat-2]
    at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation.jar:1.1.1.Final-redhat-2]
    at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:72) [jboss-as-ee.jar:7.2.0.Final-redhat-8]
    at com.commafeed.backend.services.FeedUpdateService$$$view12.updateEntry(Unknown Source) [classes:]
    at sun.reflect.GeneratedMethodAccessor46.invoke(Unknown Source) [:1.7.0_19]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_19]
    at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_19]
    at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:267) [weld-core.jar:1.1.13.Final-redhat-1]
    at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52) [weld-core.jar:1.1.13.Final-redhat-1]
    at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137) [weld-core.jar:1.1.13.Final-redhat-1]
    at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:263) [weld-core.jar:1.1.13.Final-redhat-1]
    at org.jboss.weld.bean.proxy.EnterpriseBeanProxyMethodHandler.invoke(EnterpriseBeanProxyMethodHandler.java:115) [weld-core.jar:1.1.13.Final-redhat-1]
    at org.jboss.weld.bean.proxy.EnterpriseTargetBeanInstance.invoke(EnterpriseTargetBeanInstance.java:56) [weld-core.jar:1.1.13.Final-redhat-1]
    at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:105) [weld-core.jar:1.1.13.Final-redhat-1]
    at com.commafeed.backend.services.FeedUpdateService$Proxy$_$$_Weld$Proxy$.updateEntry(FeedUpdateService$Proxy$_$$_Weld$Proxy$.java) [classes:]
    at com.commafeed.backend.feeds.FeedRefreshUpdater.updateEntry(FeedRefreshUpdater.java:151) [classes:]
    at com.commafeed.backend.feeds.FeedRefreshUpdater.access$000(FeedRefreshUpdater.java:38) [classes:]
    at com.commafeed.backend.feeds.FeedRefreshUpdater$Task.run(FeedRefreshUpdater.java:126) [classes:]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_19]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_19]
    at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_19]
Caused by: javax.transaction.RollbackException: ARJUNA016053: Could not commit transaction.
    at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1177)
    at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:126)
    at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:75)
    at org.jboss.as.ejb3.tx.CMTTxInterceptor.endTransaction(CMTTxInterceptor.java:91) [jboss-as-ejb3.jar:7.2.0.Final-redhat-8]
    ... 40 more
Caused by: javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not perform addBatch
    at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1387) [hibernate-entitymanager.jar:4.2.0.Final-redhat-1]
    at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1310) [hibernate-entitymanager.jar:4.2.0.Final-redhat-1]
    at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1316) [hibernate-entitymanager.jar:4.2.0.Final-redhat-1]
    at org.hibernate.ejb.AbstractEntityManagerImpl$CallbackExceptionMapperImpl.mapManagedFlushFailure(AbstractEntityManagerImpl.java:1510) [hibernate-entitymanager.jar:4.2.0.Final-redhat-1]
    at org.hibernate.engine.transaction.synchronization.internal.SynchronizationCallbackCoordinatorImpl.beforeCompletion(SynchronizationCallbackCoordinatorImpl.java:117) [hibernate-core.jar:4.2.0.Final-redhat-1]
    at org.hibernate.engine.transaction.synchronization.internal.RegisteredSynchronization.beforeCompletion(RegisteredSynchronization.java:53) [hibernate-core.jar:4.2.0.Final-redhat-1]
    at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:76)
    at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:273)
    at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:93)
    at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:162)
    at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1165)
    ... 43 more
Caused by: org.hibernate.exception.ConstraintViolationException: could not perform addBatch
    at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:128) [hibernate-core.jar:4.2.0.Final-redhat-1]
    at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49) [hibernate-core.jar:4.2.0.Final-redhat-1]
    at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125) [hibernate-core.jar:4.2.0.Final-redhat-1]
    at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.performExecution(BatchingBatch.java:114) [hibernate-core.jar:4.2.0.Final-redhat-1]
    at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.doExecuteBatch(BatchingBatch.java:101) [hibernate-core.jar:4.2.0.Final-redhat-1]
    at org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl.execute(AbstractBatchImpl.java:149) [hibernate-core.jar:4.2.0.Final-redhat-1]
    at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.getBatch(JdbcCoordinatorImpl.java:187) [hibernate-core.jar:4.2.0.Final-redhat-1]
    at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3036) [hibernate-core.jar:4.2.0.Final-redhat-1]
    at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3499) [hibernate-core.jar:4.2.0.Final-redhat-1]
    at org.hibernate.action.internal.EntityInsertAction.execute(EntityInsertAction.java:88) [hibernate-core.jar:4.2.0.Final-redhat-1]
    at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:362) [hibernate-core.jar:4.2.0.Final-redhat-1]
    at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:354) [hibernate-core.jar:4.2.0.Final-redhat-1]
    at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:275) [hibernate-core.jar:4.2.0.Final-redhat-1]
    at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:328) [hibernate-core.jar:4.2.0.Final-redhat-1]
    at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:52) [hibernate-core.jar:4.2.0.Final-redhat-1]
    at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1233) [hibernate-core.jar:4.2.0.Final-redhat-1]
    at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:403) [hibernate-core.jar:4.2.0.Final-redhat-1]
    at org.hibernate.engine.transaction.synchronization.internal.SynchronizationCallbackCoordinatorImpl.beforeCompletion(SynchronizationCallbackCoordinatorImpl.java:112) [hibernate-core.jar:4.2.0.Final-redhat-1]
    ... 49 more
Caused by: java.sql.BatchUpdateException: Duplicate entry '-983' for key 'PRIMARY'
    at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:2028)
    at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1451)
    at org.jboss.jca.adapters.jdbc.WrappedStatement.executeBatch(WrappedStatement.java:1077)
    at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.performExecution(BatchingBatch.java:110) [hibernate-core.jar:4.2.0.Final-redhat-1]
    ... 63 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '-983' for key 'PRIMARY'
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.7.0_19]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) [rt.jar:1.7.0_19]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [rt.jar:1.7.0_19]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:525) [rt.jar:1.7.0_19]
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
    at com.mysql.jdbc.Util.getInstance(Util.java:386)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1039)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3609)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3541)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2002)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2163)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2624)
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2127)
    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2427)
    at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:1980)
    ... 66 more
Athou commented 11 years ago
Caused by: java.sql.BatchUpdateException: Duplicate entry '-983' for key 'PRIMARY'

That negative number is worrisome. Are you sure the values in the table hibernate_sequences are correct? What is the type of the next_hi_value column?

vipere commented 11 years ago

sequence_next_hi_value is of type int(11) I've set the values using COALESCE(ceil(max(id) / 1000 + 2), 1) so should be good. The values in hibernate_sequences are positive, though the tables themselves have keys ranging from about -1000 to 4000

Feeds started updating again, like in the previous issue #301, and even though the sequence_next_hi_value of FEEDENTRIES was changed from 6 to 1006, new entries are inserted to the FEEDENTRIES table with negative ID's of about -700.

vipere commented 11 years ago

And the error is back, at least now its for a positive value

Caused by: java.sql.BatchUpdateException: Duplicate entry '6' for key 'PRIMARY'

The values were incremented again by 1000. Here's the table:

+---------------------+------------------------+
| sequence_name       | sequence_next_hi_value |
+---------------------+------------------------+
| APPLICATIONSETTINGS |                      3 |
| FEEDCATEGORIES      |                      4 |
| FEEDENTRIES         |                   2006 |
| FEEDENTRYCONTENTS   |                   2006 |
| FEEDENTRYSTATUSES   |                   2007 |
| FEEDS               |                      3 |
| FEEDSUBSCRIPTIONS   |                      4 |
| USERROLES           |                      3 |
| USERS               |                      3 |
| USERSETTINGS        |                      3 |
+---------------------+------------------------+

I didn't reset 1006 to the correct value since it would just change again..

rhazegh commented 11 years ago

Having the same issue. Some of my feeds do not update. I am using commafeed.com

mrcrislainez commented 11 years ago

Same here.. can we manually update it? :(