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

    XMLWordPrintable

    Details

    • 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:
      700
    • Team:
      PLATFORM
    • Sprint:
      nxplatform 11.1.33, nxplatform 11.1.34, nxplatform 11.1.35
    • Story Points:
      2

      Description

      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:
          <require>org.nuxeo.ecm.platform.csv.export.config</require>
        
          <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"/>
          </extension>
        
      • 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 '
        {
          "params":{
            "action":"csvExport",
            "parameters":"{\"schemas\":[\"*\"]}",
            "providerName":"advanced_document_content",
            "namedParameters":{"advanced_content:ecm_parentId":"2a246f9b-7a85-497b-b809-d5fd8e38cbc1"}
          },
          "context":{}
        }'
        
      • 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.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 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, 1 hour
                  3d 1h