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

Fix CSVExport bulk action parameters handling

    XMLWordPrintable

    Details

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

      Description

      This is still reproducible when calling an action with an invalid parameter. As an example, one can try to call the csvExport action with the schemas parameter set to "*" or a string with comma separated values "dublincore, uid" (instead of an array of strings ["dublincore", "uid"]), which will throw the following error:

      java.lang.ClassCastException: java.lang.String cannot be cast to java.util.List
      	at org.nuxeo.ecm.platform.csv.export.computation.CSVProjection.compute(CSVProjection.java:78) ~[nuxeo-platform-csv-export-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.ecm.core.bulk.action.computation.AbstractBulkComputation.lambda$processBatchOfDocuments$0(AbstractBulkComputation.java:156) ~[nuxeo-core-bulk-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.runtime.transaction.TransactionHelper.lambda$runInTransaction$3(TransactionHelper.java:569) ~[nuxeo-runtime-jtajca-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.runtime.transaction.TransactionHelper.runInTransaction(TransactionHelper.java:589) ~[nuxeo-runtime-jtajca-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.runtime.transaction.TransactionHelper.runInTransaction(TransactionHelper.java:569) ~[nuxeo-runtime-jtajca-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.ecm.core.bulk.action.computation.AbstractBulkComputation.processBatchOfDocuments(AbstractBulkComputation.java:151) ~[nuxeo-core-bulk-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.ecm.core.bulk.action.computation.AbstractBulkComputation.processRecord(AbstractBulkComputation.java:109) ~[nuxeo-core-bulk-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.lib.stream.computation.log.ComputationRunner.lambda$processRecordWithRetry$10(ComputationRunner.java:326) ~[nuxeo-stream-10.3-SNAPSHOT.jar:?]
      	at net.jodah.failsafe.Functions$10.call(Functions.java:252) ~[failsafe-1.1.0.jar:1.1.0]
      	at net.jodah.failsafe.SyncFailsafe.call(SyncFailsafe.java:145) [failsafe-1.1.0.jar:1.1.0]
      	at net.jodah.failsafe.SyncFailsafe.run(SyncFailsafe.java:81) [failsafe-1.1.0.jar:1.1.0]
      	at org.nuxeo.lib.stream.computation.log.ComputationRunner.processRecordWithRetry(ComputationRunner.java:326) [nuxeo-stream-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.lib.stream.computation.log.ComputationRunner.processRecord(ComputationRunner.java:307) [nuxeo-stream-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.lib.stream.computation.log.ComputationRunner.processLoop(ComputationRunner.java:204) [nuxeo-stream-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.lib.stream.computation.log.ComputationRunner.run(ComputationRunner.java:162) [nuxeo-stream-10.3-SNAPSHOT.jar:?]
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_162]
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_162]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_162]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_162]
      	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_162]
      

      From then on, any subsequent actions hang, never moving from the RUNNING state. Restarting the server won't fix the problem, and displays the following error:

      2018-11-06T15:39:20,784 ERROR [AbstractBulkComputation] Stopping processing, unknown command: 0085312f-22f3-42bf-b504-1d54c73dcad8, offset: csvExport-01:+76626511527937, record: Record{watermark=202049931323899904, wmDate=2018-11-06 15:37:21.082, flags=[DEFAULT], key='0085312f-22f3-42bf-b504-1d54c73dcad8:1', data.length=160, data="....%'..Y.H0085312f-22f3-42bf-b504-1d54c73dcad8.H85722ea6-6cf5-46f3-87fd-6e8775b61c02H8d326934-e19d-41bc-af5c-bf5a946b2f0eH2093"}.
      

      Here's a curl to reproduce the problem:

      curl -u Administrator:Administrator -X POST 'http://localhost:8080/nuxeo/api/v1/search/pp/advanced_document_content/bulk/csvExport' -H 'Content-Type: application/json' --data-binary '{"schemas":"dublincore,common,uid,file"}'
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                6 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 - 3 days
                  3d