Re-occurring error "cannot register synch handler in current tx"

We have the problem that in our Nuxeo installation an error that affects the whole installation occurs from time to time. Up to now I could not determine a pattern when exactly it is occurring. We are using CMIS to access Nuxeo from other applications, but the error does not occur exactly when we do this. Any help appriciated. You can find the full jstack and server error log on dropbox. The most important part of the exception can be found below. https://www.dropbox.com/sh/xrm2h1hn49xgw2h/AACUo22t09T8Q8Mhk4AKAFZla?dl=0

org.nuxeo.ecm.core.opencmis.bindings.DefaultErrorExtractor] Cannot register synch hand ler in current tx java.lang.RuntimeException: Cannot register synch handler in current tx

    at org.nuxeo.runtime.transaction.TransactionHelper.registerSynchronization(TransactionHelper.java:416)
    at org.nuxeo.ecm.core.api.local.LocalSession.createSession(LocalSession.java:117)
    at org.nuxeo.ecm.core.api.local.LocalSession.connect(LocalSession.java:82)
    at org.nuxeo.ecm.core.api.CoreInstance.acquireCoreSession(CoreInstance.java:184)
    at org.nuxeo.ecm.core.api.CoreInstance.openCoreSession(CoreInstance.java:179)
    at org.nuxeo.ecm.core.api.CoreInstance.openCoreSession(CoreInstance.java:93)
    at org.nuxeo.ecm.core.opencmis.impl.server.NuxeoCmisService.openCoreSession(NuxeoCmisService.java:297)
    at org.nuxeo.ecm.core.opencmis.impl.server.NuxeoCmisService.setCallContext(NuxeoCmisService.java:331)
    at org.apache.chemistry.opencmis.server.support.wrapper.AbstractCmisServiceWrapper.setCallContext(AbstractCmisServiceWrapper.java:97)
    at org.nuxeo.ecm.core.opencmis.bindings.NuxeoCmisServiceFactory.getService(NuxeoCmisServiceFactory.java:139)
    at org.apache.chemistry.opencmis.server.impl.atompub.CmisAtomPubServlet.dispatch(CmisAtomPubServlet.java:239)
    at org.apache.chemistry.opencmis.server.impl.atompub.CmisAtomPubServlet.service(CmisAtomPubServlet.java:198)
    at org.nuxeo.ecm.core.opencmis.bindings.NuxeoCmisAtomPubServlet.service(NuxeoCmisAtomPubServlet.java:60)
1 votes

0 answers

507 views

ANSWER

Seems as though it's happening because your transaction request is timing out for some reason, thus marking it to roll back. This happens because pushing the transaction further would prove useless, since the transaction has expired.

So, maybe the question to ask would be, what exactly is responsible for corrupting your transaction?

Anyone else have any ideas?

Source: org.nuxeo.runtime.transaction.TransactionHelper.java

/**
* Sets the current User Transaction as rollback only if it has timed out.
*
* @return {@code true} if the transaction was successfully marked rollback
*         only, {@code false} otherwise
* @since 7.1
*/
public static boolean setTransactionRollbackOnlyIfTimedOut() {
    if (isTransactionTimedOut()) {
       return setTransactionRollbackOnly();
     }
    return false;
 }

Source: org.apache.geronimo.transaction.manager.TransactionImpl.java

public synchronized void registerSynchronization(Synchronization synch) throws IllegalStateException, RollbackException, SystemException {
    if (synch == null) {
        throw new IllegalArgumentException("Synchronization is null");
     }
     switch (status) {
        case Status.STATUS_ACTIVE:
        case Status.STATUS_PREPARING:
            break;
         case Status.STATUS_MARKED_ROLLBACK:
            throw new RollbackException("Transaction is marked for rollback");
         default:
            throw new IllegalStateException("Status is " + getStateString(status));
     }
     syncList.add(synch);
 }
08/05/2016

Also you haven't stated what Nuxeo version you're using, nor provided the full stack trace including the "caused by".
08/05/2016

As written above the full stack trace can be found on Dropbox including the jstack result. The version can be found in the meta data of the post. I didn't know I have to be redundant. It is 7.10 HF13. Thank you Yousuf for your investigation. Can this be affected by the database? We are using Maria DB in a Galera Cluster. Is there a parameter in Nuxeo for controlling the timeout or is this a db parameter?
08/05/2016

Ah sorry I read too quickly. Also you should use the Comment field and not Answer if you just comment.
08/05/2016

I'm aware of that but the mobile version of quandary has no comment button. I just found out that I need to ask for the desktop version of the page to comment
08/05/2016



As written above the full stack trace can be found on Dropbox including the jstack result. The version can be found in the meta data of the post. I didn't know I have to be redundant. It is 7.10 HF13. Thank you Yousuf for your investigation. Can this be affected by the database? We are using Maria DB in a Galera Cluster. Is there a parameter in Nuxeo for controlling the timeout or is this a db parameter?

0 votes