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

BulkMigrator must check the Bulk Command completion ends without error

    XMLWordPrintable

    Details

    • Release Notes Summary:
      Failing bulk migration remains in its initial state and reports error message and code.
    • Release Notes Description:
      Hide

      In case of failing bulk migration, the status queried with:

      curl -u <username>:<password> https://<hostname>/nuxeo/api/v1/management/migration/blob-keys-migration
      

      will now return

      {
       "entity-type": "migration",
       "id": "blob-keys-migration",
       "description": "Populate ecm:blobKeys property",
       "descriptionLabel": "migration.dbs.blob.keys",
       "status": {
       "state": "empty",
       "step": null,
       "startTime": 0,
       "pingTime": 0,
       "progressMessage": null,
       "progressNum": 0,
       "progressTotal": 0,
       "errorMessage": "Invalid command produces an empty document set:  ...",
       "errorCode": 400,
       "running": false
       },
       "steps": []
      }
      
      Show
      In case of failing bulk migration, the status queried with: curl -u <username>:<password> https: //<hostname>/nuxeo/api/v1/management/migration/blob-keys-migration will now return { "entity-type" : "migration" , "id" : "blob-keys-migration" , "description" : "Populate ecm:blobKeys property" , "descriptionLabel" : "migration.dbs.blob.keys" , "status" : { "state" : "empty" , "step" : null , "startTime" : 0, "pingTime" : 0, "progressMessage" : null , "progressNum" : 0, "progressTotal" : 0, "errorMessage" : "Invalid command produces an empty document set: ..." , "errorCode" : 400, "running" : false }, "steps" : [] }
    • Tags:
    • Sprint:
      nxplatform #97
    • Story Points:
      3

      Description

      Steps to reproduce with Blob Keys migrator

      The blob keys migration was run against a repository with 1,512,813,308 documents.  Exceptions are seen in the logs and the progress output indicates 0 documents processed, however the capabilities check post-run shows "queryBlobKeys" as true - see below for details.

      Command #1 - Ran prior to running the blob keys migration

      curl -u <username>:<password> https://<hostname>/nuxeo/api/v1/capabilities
      {
       "entity-type": "capabilities",
       "server": {
       "distributionName": "lts",
       "distributionVersion": "2021.40.11",
       "distributionServer": "tomcat"
       },
       "cluster": {
       "enabled": true,
       "nodeId": "<hostname>"
       },
       "repository": {
       "default": {
       "queryBlobKeys": false
       }
       }
      }

      Command #2 - Perform blob keys migration

      curl -X POST -u <username>:<password> https://<hostname>/nuxeo/api/v1/management/migration/blob-keys-migration/run

      Error seen in logs after running Command #2

      Invalid command produces an empty document set: org.nuxeo.ecm.core.bulk.message.BulkCommand@358fbbd2[action=migration,batchSize=25,batchTransactionTimeout=0,bucketSize=100,externalScroller=false,genericScroller=false,id=f269aaff-5a23-4869-bcd5-0b8cbe357399,params={migrationId=blob-keys-migration, migrationStep=empty-to-populated},query=SELECT * FROM Document, Relation WHERE ecm:blobKeys IS NULL,queryLimit=<null>,repository=default,scroller=<null>,username=system]

      The above is caused by a MongoSocketReadTimeoutException:

       

      com.mongodb.MongoSocketReadTimeoutException: Timeout while receiving messageom.mongodb.MongoSocketReadTimeoutException: Timeout while receiving message at com.mongodb.internal.connection.InternalStreamConnection.translateReadException(InternalStreamConnection.java:696) ~[mongodb-driver-core-4.7.2.jar:?] at com.mongodb.internal.connection.InternalStreamConnection.receiveMessageWithAdditionalTimeout(InternalStreamConnection.java:574) ~[mongodb-driver-core-4.7.2.jar:?] at com.mongodb.internal.connection.InternalStreamConnection.receiveCommandMessageResponse(InternalStreamConnection.java:410) ~[mongodb-driver-core-4.7.2.jar:?] at com.mongodb.internal.connection.InternalStreamConnection.sendAndReceive(InternalStreamConnection.java:337) ~[mongodb-driver-core-4.7.2.jar:?] at com.mongodb.internal.connection.UsageTrackingInternalConnection.sendAndReceive(UsageTrackingInternalConnection.java:116) ~[mongodb-driver-core-4.7.2.jar:?] at com.mongodb.internal.connection.DefaultConnectionPool$PooledConnection.sendAndReceive(DefaultConnectionPool.java:643) ~[mongodb-driver-core-4.7.2.jar:?] at com.mongodb.internal.connection.CommandProtocolImpl.execute(CommandProtocolImpl.java:71) ~[mongodb-driver-core-4.7.2.jar:?] at com.mongodb.internal.connection.DefaultServer$DefaultServerProtocolExecutor.execute(DefaultServer.java:240) ~[mongodb-driver-core-4.7.2.jar:?] at com.mongodb.internal.connection.DefaultServerConnection.executeProtocol(DefaultServerConnection.java:226) ~[mongodb-driver-core-4.7.2.jar:?] at com.mongodb.internal.connection.DefaultServerConnection.command(DefaultServerConnection.java:126) ~[mongodb-driver-core-4.7.2.jar:?] at com.mongodb.internal.connection.DefaultServerConnection.command(DefaultServerConnection.java:116) ~[mongodb-driver-core-4.7.2.jar:?] at com.mongodb.internal.connection.DefaultServer$OperationCountTrackingConnection.command(DefaultServer.java:345) ~[mongodb-driver-core-4.7.2.jar:?] at com.mongodb.internal.operation.QueryBatchCursor.lambda$getMore$1(QueryBatchCursor.java:290) ~[mongodb-driver-core-4.7.2.jar:?] at com.mongodb.internal.operation.QueryBatchCursor$ResourceManager.executeWithConnection(QueryBatchCursor.java:532) ~[mongodb-driver-core-4.7.2.jar:?] at com.mongodb.internal.operation.QueryBatchCursor.getMore(QueryBatchCursor.java:286) ~[mongodb-driver-core-4.7.2.jar:?] at com.mongodb.internal.operation.QueryBatchCursor.doHasNext(QueryBatchCursor.java:167) ~[mongodb-driver-core-4.7.2.jar:?] at com.mongodb.internal.operation.QueryBatchCursor$ResourceManager.execute(QueryBatchCursor.java:417) ~[mongodb-driver-core-4.7.2.jar:?] at com.mongodb.internal.operation.QueryBatchCursor.hasNext(QueryBatchCursor.java:154) ~[mongodb-driver-core-4.7.2.jar:?] at com.mongodb.client.internal.MongoBatchCursorAdapter.hasNext(MongoBatchCursorAdapter.java:54) ~[mongodb-driver-sync-4.7.2.jar:?] at org.nuxeo.ecm.core.api.CursorResult.hasNext(CursorResult.java:71) ~[nuxeo-core-api-2021.40.11.jar:?] at org.nuxeo.ecm.core.api.CursorService.scroll(CursorService.java:137) ~[nuxeo-core-api-2021.40.11.jar:?] at org.nuxeo.ecm.core.storage.mongodb.MongoDBConnection.scroll(MongoDBConnection.java:908) ~[nuxeo-core-storage-mongodb-2021.40.11.jar:?]Caused by: java.net.SocketTimeoutException: Read timed out
      

      Command #3 - Check status of blob keys migration after above error - shows blob keys as populated

      curl -u <username>:<password> https://<hostname>/nuxeo/api/v1/management/migration/blob-keys-migration

      {
       "entity-type": "migration",
       "id": "blob-keys-migration",
       "description": "Populate ecm:blobKeys property",
       "descriptionLabel": "migration.dbs.blob.keys",
       "status": {
       "state": "populated",
       "step": null,
       "startTime": 0,
       "pingTime": 0,
       "progressMessage": null,
       "progressNum": 0,
       "progressTotal": 0,
       "running": false
       },
       "steps": []
      }

      curl -u <username>:<password> https://<hostname>/nuxeo/api/v1/capabilities

      {
       "entity-type": "capabilities",
       "server": {
       "distributionName": "lts",
       "distributionVersion": "2021.40.11",
       "distributionServer": "tomcat"
       },
       "cluster": {
       "nodeId": "<hostname>",
       "enabled": true
       },
       "repository": {
       "default": {
       "queryBlobKeys": true
       }
       }
      }

      Given the error in logs and how quick the process ran, highly unlikely that the repo does indeed have the queryBlobKeys as reported.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: