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

Fix Silent failure in automation Bulk.RunAction/@async when using invalid action parameter



    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.10
    • Fix Version/s: 10.10-HF27, 11.1, 2021.0
    • Component/s: Bulk
    • Release Notes Summary:
      A failure with Bulk.RunAction/@async will return an error.
    • Backlog priority:
    • Team:
    • Sprint:
      nxplatform 11.1.33, nxplatform 11.1.34, nxplatform 11.1.35
    • Story Points:


      When invoking a Bulk Action using the automation Bulk.RunAction/@async with invalid parameters no error is returned in the status nor in the logs.

      For instance, when cvsExport is configured to use an ES scroller and its validation fails:

      How to reproduce:

      • configure bulk action cvsExport to use an ES scroller with the following XML extension:
          <extension point="actions" target="org.nuxeo.ecm.core.bulk" >
            <action name="csvExport" bucketSize="100" batchSize="50" httpEnabled="true" validationClass="org.nuxeo.ecm.platform.csv.export.validation.CSVExportValidation" defaultScroller="elastic"/>
      • deploy/restart
      • retrieve the UUID of a folderish document
      • run the bulk action cvsExport on the folderish document (replace the UUID in the request payload) with a faulty schemas parameter (* being an invalid value):
        curl -isu Administrator:Administrator -H 'content-type: application/json' \
        'http://localhost:8080/nuxeo/api/v1/automation/Bulk.RunAction/@async' \
        -d '
      • it produces the following output:
        HTTP/1.1 202 
        X-Frame-Options: SAMEORIGIN
        X-UA-Compatible: IE=10; IE=11
        Cache-Control: no-cache
        X-Content-Type-Options: nosniff
        Content-Security-Policy: img-src data: blob: *; default-src blob: *; script-src 'unsafe-inline' 'unsafe-eval' data: *; style-src 'unsafe-inline' *; font-src data: *
        X-XSS-Protection: 1; mode=block
        Location: http://localhost:8080/nuxeo/site/api/v1/automation/Bulk.RunAction/@async/b783ff2a-0941-49be-98ec-849296ea3585/status
        Content-Type: application/json
        Content-Length: 0
        Date: Wed, 26 Feb 2020 02:57:13 GMT
      • extract the status URL from the response header Location and request the status of the bulk action's execution:
        curl -su Administrator:Administrator http://localhost:8080/nuxeo/site/api/v1/automation/Bulk.RunAction/@async/b783ff2a-0941-49be-98ec-849296ea3585/status |jq
      • it produces an output similar to this:
          "entity-type": "bulkStatus",
          "value": {
            "entity-type": "bulkStatus",
            "commandId": null,
            "state": "UNKNOWN",
            "processed": 0,
            "error": false,
            "errorCount": 0,
            "total": 0,
            "action": null,
            "username": null,
            "submitted": null,
            "scrollStart": null,
            "scrollEnd": null,
            "processingStart": null,
            "processingEnd": null,
            "completed": null,
            "processingMillis": 0

      Actual result: state value is UNKNOWN and no error is reported in the logs

      Expected result: an error must be returned

      Note that from the Bulk Service point of view it is normal to return a bulk status UNKNOWN because invalid commands are rejected and never processed.


          Issue Links



              • Votes:
                0 Vote for this issue
                4 Start watching this issue


                • Created:

                  Time Tracking

                  Original Estimate - Not Specified
                  Not Specified
                  Remaining Estimate - 0 minutes
                  Time Spent - 3 days, 1 hour
                  3d 1h