Uploaded image for project: 'PHP Driver: Extension'
  1. PHP Driver: Extension
  2. PHPC-1419

Error label from server error is not exposed in ServerException

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.6.0, 1.6.0-RC1
    • Labels:
      None

      Description

      While investigating PHPLIB-461, I realised that the ServerException for a failing getMore call doesn't expose the errorLabels property of the server error. The response to the getMore command is as follows:

      {
      	"ok" : 0,
      	"errmsg" : "Encountered an event whose _id field, which contains the resume token, was modified by the pipeline. Modifying the _id field of an event makes it impossible to resume the stream from that point. Only transformations that retain the unmodified _id field are allowed. Expected: { _id: { _data: \"825D4413A3000000022B022C0100296E5A100490D142D8D37F42D8958D13185F66D4E346645F696400645D4413A3A64A5AACF876FDFB0004\" } } but found: {}",
      	"code" : 280,
      	"codeName" : "ChangeStreamFatalError",
      	"operationTime" : Timestamp(1564742565, 2),
      	"$clusterTime" : {
      		"clusterTime" : Timestamp(1564742565, 6),
      		"signature" : {
      			"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
      			"keyId" : NumberLong(0)
      		}
      	},
      	"errorLabels" : [
      		"NonResumableChangeStreamError"
      	]
      } 

      However, the following check on ServerException::hasErrorLabel() fails, as the errorLabels property of the server exception is empty.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: