Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-26138

Fix Bulk Action operation in listener

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 10.3-SNAPSHOT
    • Fix Version/s: 10.3
    • Component/s: Bulk
    • Tags:
    • Backlog priority:
      1,000
    • Sprint:
      nxcore 10.10.1
    • Story Points:
      5

      Description

      Steps to reproduce:

      • Create an event handler on Folderish documents triggered on the Document Modified event.
      • Create the following automation chain, to be launched when the event handler is fired:
        - Context.FetchDocument
        - Bulk.RunAction:
            action: setProperties
            query: expr:SELECT * FROM Document WHERE ecm:ancestorId = @{Document.id}
            parameters: expr:{"dc:description":"@{Document.description}"}
        

      Given a folder with thousands of documents in it:

      • Modify the description of the folder in Web UI.
        => When clicking Save on edit document dialog:
        • The document is not saved.
        • The edit document dialog remains open.
        • A document.saveError toast notification appears.
        • Errors appear in the server.log (see attached server.log for details).
      Caused by: com.fasterxml.jackson.databind.JsonMappingException: Infinite recursion (StackOverflowError)
      (through reference chain: org.nuxeo.ecm.core.api.model.impl.DocumentPartImpl["icon-expanded"]
      ->org.nuxeo.ecm.core.api.model.impl.primitives.StringProperty["parent"]
      ->org.nuxeo.ecm.core.api.model.impl.DocumentPartImpl["icon-expanded"]
      ->org.nuxeo.ecm.core.api.model.impl.primitives.StringProperty["parent"]
      ->org.nuxeo.ecm.core.api.model.impl.DocumentPartImpl["icon-expanded"]
      ->org.nuxeo.ecm.core.api.model.impl.primitives.StringProperty["parent"]
      etc.
      

        Attachments

          Issue Links

            Activity

            Hide
            ktouchie Karin Touchie added a comment -

            Reproduced with ecm:parentId instead of ecm:ancestoryId.

            Show
            ktouchie Karin Touchie added a comment - Reproduced with ecm:parentId instead of ecm:ancestoryId .
            Hide
            bdelbosc Benoit Delbosc added a comment -

            Can you please attach the studio jar to the ticket ?

            Show
            bdelbosc Benoit Delbosc added a comment - Can you please attach the studio jar to the ticket ?
            Hide
            bdelbosc Benoit Delbosc added a comment -

            For any reason a DocumentPart is added as a command params, this end up into an infinite loop when the params are serialized.

            >org.nuxeo.ecm.core.api.model.impl.primitives.StringProperty["parent"]->org.nuxeo.ecm.core.api.model.impl.DocumentPartImpl["icon-expanded"]->org.nuxeo.ecm.core.api.model.impl.primitives.StringProperty["parent"])
            	at org.nuxeo.lib.stream.codec.AvroMessageCodec.encode(AvroMessageCodec.java:71) ~[nuxeo-stream-10.3-I20181102_0125.jar:?]
            	at org.nuxeo.ecm.core.bulk.BulkServiceImpl.setCommand(BulkServiceImpl.java:196) ~[nuxeo-core-bulk-10.3-I20181102_0125.jar:?]
            	at org.nuxeo.ecm.core.bulk.BulkServiceImpl.submit(BulkServiceImpl.java:115) ~[nuxeo-core-bulk-10.3-I20181102_0125.jar:?]
            	at org.nuxeo.ecm.automation.core.operations.services.bulk.RunBulkAction.run(RunBulkAction.java:98) ~[nuxeo-automation-features-10.3-I20181102_0125.jar:?]
            
            Show
            bdelbosc Benoit Delbosc added a comment - For any reason a DocumentPart is added as a command params, this end up into an infinite loop when the params are serialized. >org.nuxeo.ecm.core.api.model.impl.primitives.StringProperty[ "parent" ]->org.nuxeo.ecm.core.api.model.impl.DocumentPartImpl[ "icon-expanded" ]->org.nuxeo.ecm.core.api.model.impl.primitives.StringProperty[ "parent" ]) at org.nuxeo.lib.stream.codec.AvroMessageCodec.encode(AvroMessageCodec.java:71) ~[nuxeo-stream-10.3-I20181102_0125.jar:?] at org.nuxeo.ecm.core.bulk.BulkServiceImpl.setCommand(BulkServiceImpl.java:196) ~[nuxeo-core-bulk-10.3-I20181102_0125.jar:?] at org.nuxeo.ecm.core.bulk.BulkServiceImpl.submit(BulkServiceImpl.java:115) ~[nuxeo-core-bulk-10.3-I20181102_0125.jar:?] at org.nuxeo.ecm.automation.core.operations.services.bulk.RunBulkAction.run(RunBulkAction.java:98) ~[nuxeo-automation-features-10.3-I20181102_0125.jar:?]
            Hide
            kleturc Kevin Leturc added a comment -

            It's possible that Map is not expressed correctly, see https://github.com/imona/tutorial/wiki/MVEL-Guide#maps

            Show
            kleturc Kevin Leturc added a comment - It's possible that Map is not expressed correctly, see https://github.com/imona/tutorial/wiki/MVEL-Guide#maps
            Hide
            fdavid Funsho David added a comment -

            Reopened because the event is also triggered when Nuxeo starts and that gives the following issue :

            2018-11-15T17:10:06,209 ERROR [main] [org.nuxeo.osgi.OSGiAdapter] Error during Framework Listener execution : class org.nuxeo.runtime.osgi.OSGiRuntimeService
            java.lang.IllegalArgumentException: The appender for Log command exists and expecting codec: org.nuxeo.lib.stream.codec.NoCodec@18c95fbb, cannot use a different codec: org.nuxeo.lib.stream.codec.AvroMessageCodec@69117714
                at org.nuxeo.lib.stream.log.internals.AbstractLogManager.getAppender(AbstractLogManager.java:157) ~[nuxeo-stream-10.3-SNAPSHOT.jar:?]
                at org.nuxeo.lib.stream.computation.log.LogStreamProcessor.lambda$initSourceAppenders$12(LogStreamProcessor.java:245) ~[nuxeo-stream-10.3-SNAPSHOT.jar:?]
                at java.lang.Iterable.forEach(Iterable.java:75) ~[?:1.8.0_191]
                at org.nuxeo.lib.stream.computation.log.LogStreamProcessor.initSourceAppenders(LogStreamProcessor.java:245) ~[nuxeo-stream-10.3-SNAPSHOT.jar:?]
                at org.nuxeo.lib.stream.computation.log.LogStreamProcessor.init(LogStreamProcessor.java:73) ~[nuxeo-stream-10.3-SNAPSHOT.jar:?]
                at org.nuxeo.ecm.core.bulk.BulkAdminServiceImpl.initProcessor(BulkAdminServiceImpl.java:155) ~[nuxeo-core-bulk-10.3-SNAPSHOT.jar:?]
                at org.nuxeo.ecm.core.bulk.BulkAdminServiceImpl.afterStart(BulkAdminServiceImpl.java:199) ~[nuxeo-core-bulk-10.3-SNAPSHOT.jar:?]
                at org.nuxeo.ecm.core.bulk.BulkComponent$ComponentListener.afterStart(BulkComponent.java:62) ~[nuxeo-core-bulk-10.3-SNAPSHOT.jar:?]
                at org.nuxeo.runtime.model.impl.ComponentManagerImpl$Listeners.afterStart(ComponentManagerImpl.java:1136) ~[nuxeo-runtime-10.3-SNAPSHOT.jar:?]
                at org.nuxeo.runtime.model.impl.ComponentManagerImpl.startComponents(ComponentManagerImpl.java:695) ~[nuxeo-runtime-10.3-SNAPSHOT.jar:?]
                at org.nuxeo.runtime.model.impl.ComponentManagerImpl.start(ComponentManagerImpl.java:792) ~[nuxeo-runtime-10.3-SNAPSHOT.jar:?]
                at org.nuxeo.runtime.osgi.OSGiRuntimeService.startComponents(OSGiRuntimeService.java:447) ~[nuxeo-runtime-10.3-SNAPSHOT.jar:?]
                at org.nuxeo.runtime.osgi.OSGiRuntimeService.frameworkEvent(OSGiRuntimeService.java:462) ~[nuxeo-runtime-10.3-SNAPSHOT.jar:?]
                at org.nuxeo.osgi.OSGiAdapter.fireFrameworkEvent(OSGiAdapter.java:223) [nuxeo-runtime-osgi-10.3-SNAPSHOT.jar:?]
                at org.nuxeo.osgi.application.loader.FrameworkLoader.doStart(FrameworkLoader.java:225) [nuxeo-runtime-osgi-10.3-SNAPSHOT.jar:?]
                at org.nuxeo.osgi.application.loader.FrameworkLoader.start(FrameworkLoader.java:124) [nuxeo-runtime-osgi-10.3-SNAPSHOT.jar:?]
                at org.nuxeo.runtime.deployment.NuxeoStarter.start(NuxeoStarter.java:124) [nuxeo-runtime-deploy-10.3-SNAPSHOT.jar:?]
                at org.nuxeo.runtime.deployment.NuxeoStarter.contextInitialized(NuxeoStarter.java:93) [nuxeo-runtime-deploy-10.3-SNAPSHOT.jar:?]
            

            Events are triggered before the stream is initialized.

            Show
            fdavid Funsho David added a comment - Reopened because the event is also triggered when Nuxeo starts and that gives the following issue : 2018-11-15T17:10:06,209 ERROR [main] [org.nuxeo.osgi.OSGiAdapter] Error during Framework Listener execution : class org.nuxeo.runtime.osgi.OSGiRuntimeService java.lang.IllegalArgumentException: The appender for Log command exists and expecting codec: org.nuxeo.lib.stream.codec.NoCodec@18c95fbb, cannot use a different codec: org.nuxeo.lib.stream.codec.AvroMessageCodec@69117714 at org.nuxeo.lib.stream.log.internals.AbstractLogManager.getAppender(AbstractLogManager.java:157) ~[nuxeo-stream-10.3-SNAPSHOT.jar:?] at org.nuxeo.lib.stream.computation.log.LogStreamProcessor.lambda$initSourceAppenders$12(LogStreamProcessor.java:245) ~[nuxeo-stream-10.3-SNAPSHOT.jar:?] at java.lang.Iterable.forEach(Iterable.java:75) ~[?:1.8.0_191] at org.nuxeo.lib.stream.computation.log.LogStreamProcessor.initSourceAppenders(LogStreamProcessor.java:245) ~[nuxeo-stream-10.3-SNAPSHOT.jar:?] at org.nuxeo.lib.stream.computation.log.LogStreamProcessor.init(LogStreamProcessor.java:73) ~[nuxeo-stream-10.3-SNAPSHOT.jar:?] at org.nuxeo.ecm.core.bulk.BulkAdminServiceImpl.initProcessor(BulkAdminServiceImpl.java:155) ~[nuxeo-core-bulk-10.3-SNAPSHOT.jar:?] at org.nuxeo.ecm.core.bulk.BulkAdminServiceImpl.afterStart(BulkAdminServiceImpl.java:199) ~[nuxeo-core-bulk-10.3-SNAPSHOT.jar:?] at org.nuxeo.ecm.core.bulk.BulkComponent$ComponentListener.afterStart(BulkComponent.java:62) ~[nuxeo-core-bulk-10.3-SNAPSHOT.jar:?] at org.nuxeo.runtime.model.impl.ComponentManagerImpl$Listeners.afterStart(ComponentManagerImpl.java:1136) ~[nuxeo-runtime-10.3-SNAPSHOT.jar:?] at org.nuxeo.runtime.model.impl.ComponentManagerImpl.startComponents(ComponentManagerImpl.java:695) ~[nuxeo-runtime-10.3-SNAPSHOT.jar:?] at org.nuxeo.runtime.model.impl.ComponentManagerImpl.start(ComponentManagerImpl.java:792) ~[nuxeo-runtime-10.3-SNAPSHOT.jar:?] at org.nuxeo.runtime.osgi.OSGiRuntimeService.startComponents(OSGiRuntimeService.java:447) ~[nuxeo-runtime-10.3-SNAPSHOT.jar:?] at org.nuxeo.runtime.osgi.OSGiRuntimeService.frameworkEvent(OSGiRuntimeService.java:462) ~[nuxeo-runtime-10.3-SNAPSHOT.jar:?] at org.nuxeo.osgi.OSGiAdapter.fireFrameworkEvent(OSGiAdapter.java:223) [nuxeo-runtime-osgi-10.3-SNAPSHOT.jar:?] at org.nuxeo.osgi.application.loader.FrameworkLoader.doStart(FrameworkLoader.java:225) [nuxeo-runtime-osgi-10.3-SNAPSHOT.jar:?] at org.nuxeo.osgi.application.loader.FrameworkLoader.start(FrameworkLoader.java:124) [nuxeo-runtime-osgi-10.3-SNAPSHOT.jar:?] at org.nuxeo.runtime.deployment.NuxeoStarter.start(NuxeoStarter.java:124) [nuxeo-runtime-deploy-10.3-SNAPSHOT.jar:?] at org.nuxeo.runtime.deployment.NuxeoStarter.contextInitialized(NuxeoStarter.java:93) [nuxeo-runtime-deploy-10.3-SNAPSHOT.jar:?] Events are triggered before the stream is initialized.
            Hide
            hudson Jenkins added a comment -

            SUCCESS: Integrated in master/nuxeo-master #2079
            NXP-26138: set action parameters in JSON format (funshodavid: 0f6df5b1cc048bd6335bc883fc835d36d2c57880)

            Show
            hudson Jenkins added a comment - SUCCESS: Integrated in master/nuxeo-master #2079 NXP-26138 : set action parameters in JSON format (funshodavid: 0f6df5b1cc048bd6335bc883fc835d36d2c57880 )
            Hide
            hudson Jenkins added a comment -

            SUCCESS: Integrated in master/nuxeo-master #2088
            NXP-26138: set codec when fetching appender (funshodavid: 260d3315b39e0ea42541564820faa942dfa44cd3)

            Show
            hudson Jenkins added a comment - SUCCESS: Integrated in master/nuxeo-master #2088 NXP-26138 : set codec when fetching appender (funshodavid: 260d3315b39e0ea42541564820faa942dfa44cd3 )
            Hide
            hudson Jenkins added a comment -
            Show
            hudson Jenkins added a comment - SUCCESS: Integrated in Private/nuxeo.com-jobs/update-jira-issues-nuxeo.com-content-master #677 NXP-26138 : update Bulk.RunAction documentation (manonlumeau: bc90a5d509248a7092d518c86d09c0befeb9e37c )

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 4 hours
                  4h