-
Type:
Build Failure
-
Resolution: Gone away
-
Priority:
Unknown
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Python Drivers
-
None
-
None
-
None
-
None
-
None
-
None
Name of Failure:
test.asynchronous.test_crud_unified.TestUnifiedClientBulkWriteReplaceOneSort.test_client_bulkWrite_replaceOne_with_sort_option
test.asynchronous.test_crud_unified.TestUnifiedClientBulkWriteUpdateOneSort.test_client_bulkWrite_updateOne_with_sort_option
test.asynchronous.test_crud_unified.TestUnifiedCreateNullIds.test_inserting__id_with_type_null_via_clientBulkWrite
test.test_crud_unified.TestUnifiedClientBulkWriteReplaceOneSort.test_client_bulkWrite_replaceOne_with_sort_option
test.test_crud_unified.TestUnifiedClientBulkWriteUpdateOneSort.test_client_bulkWrite_updateOne_with_sort_option
test.test_crud_unified.TestUnifiedCreateNullIds.test_inserting__id_with_type_null_via_clientBulkWrite
Link to task:
Context of when and why the failure occurred:
Unknown
Stack trace:
[2024/11/11 09:46:11.455] FAILURE: pymongo.errors.ClientBulkWriteException: batch op errors occurred, full error: {'anySuccessful': False, 'error': OperationFailure('(Unauthorized) not authorized on admin to execute command { bulkWrite: 1, errorsOnly: true, ordered: true, lsid: { id: {4 [194 141 87 18 29 228 71 22 179 16 122 167 82 61 72 15]} }, txnNumber: 1.000000, $db: "admin" }, full error: {\'ok\': 0, \'errmsg\': \'(Unauthorized) not authorized on admin to execute command { bulkWrite: 1, errorsOnly: true, ordered: true, lsid: { id: {4 [194 141 87 18 29 228 71 22 179 16 122 167 82 61 72 15]} }, txnNumber: 1.000000, $db: "admin" }\', \'code\': 8000, \'codeName\': \'AtlasError\'}'), 'writeErrors': [], 'writeConcernErrors': [], 'nInserted': 0, 'nUpserted': 0, 'nMatched': 0, 'nModified': 0, 'nDeleted': 0, 'insertResults': {}, 'updateResults': {}, 'deleteResults': {}} ()
[2024/11/11 09:46:11.455] self = <pymongo.asynchronous.client_bulk._AsyncClientBulk object at 0x7f3884db56a0>
[2024/11/11 09:46:11.455] bwc = <pymongo.message._ClientBulkWriteContext object at 0x7f387cf1d9c0>
[2024/11/11 09:46:11.455] cmd = {'$db': 'admin', 'bulkWrite': 1, 'errorsOnly': True, 'lsid': {'id': Binary(b'\xc2\x8dW\x12\x1d\xe4G\x16\xb3\x10z\xa7R=H\x0f', 4)}, ...}
[2024/11/11 09:46:11.455] request_id = -1355612817
[2024/11/11 09:46:11.455] msg = b'\x1e\x01\x00\x00o\xfd2\xaf\x00\x00\x00\x00\xdd\x07\x00\x00\x00\x00\x00\x00\x00q\x00\x00\x00\x10bulkWrite\x00\x01\x00...0\xff\xff\xff\xff\x00\x00\x01)\x00\x00\x00nsInfo\x00\x1e\x00\x00\x00\x02ns\x00\x11\x00\x00\x00crud-tests.coll0\x00\x00'
[2024/11/11 09:46:11.455] op_docs = [{'filter': {'_id': {'$gt': 1}}, 'multi': False, 'sort': {'_id': -1}, 'update': 0, ...}]
[2024/11/11 09:46:11.455] ns_docs = [{'ns': 'crud-tests.coll0'}]
[2024/11/11 09:46:11.455] client = AsyncMongoClient(host=['13480-drivertest-lb.3x79d.mongodb-dev.net:27017'], document_class=dict, tz_aware=False, connec...pressors=['zlib'], tls=True, event_listeners=[<test.unified_format_shared.EventListenerUtil object at 0x7f387d298dd0>])
[2024/11/11 09:46:11.455] @_handle_reauth
[2024/11/11 09:46:11.455] async def write_command(
[2024/11/11 09:46:11.455] self,
[2024/11/11 09:46:11.455] bwc: _ClientBulkWriteContext,
[2024/11/11 09:46:11.455] cmd: MutableMapping[str, Any],
[2024/11/11 09:46:11.455] request_id: int,
[2024/11/11 09:46:11.455] msg: Union[bytes, dict[str, Any]],
[2024/11/11 09:46:11.455] op_docs: list[Mapping[str, Any]],
[2024/11/11 09:46:11.455] ns_docs: list[Mapping[str, Any]],
[2024/11/11 09:46:11.455] client: AsyncMongoClient,
[2024/11/11 09:46:11.455] ) -> dict[str, Any]:
[2024/11/11 09:46:11.455] """A proxy for AsyncConnection.write_command that handles event publishing."""
[2024/11/11 09:46:11.455] cmd["ops"] = op_docs
[2024/11/11 09:46:11.455] cmd["nsInfo"] = ns_docs
[2024/11/11 09:46:11.455] if _COMMAND_LOGGER.isEnabledFor(logging.DEBUG):
[2024/11/11 09:46:11.455] _debug_log(
[2024/11/11 09:46:11.455] _COMMAND_LOGGER,
[2024/11/11 09:46:11.455] clientId=client._topology_settings._topology_id,
[2024/11/11 09:46:11.455] message=_CommandStatusMessage.STARTED,
[2024/11/11 09:46:11.455] command=cmd,
[2024/11/11 09:46:11.455] commandName=next(iter(cmd)),
[2024/11/11 09:46:11.455] databaseName=bwc.db_name,
[2024/11/11 09:46:11.455] requestId=request_id,
[2024/11/11 09:46:11.455] operationId=request_id,
[2024/11/11 09:46:11.455] driverConnectionId=bwc.conn.id,
[2024/11/11 09:46:11.455] serverConnectionId=bwc.conn.server_connection_id,
[2024/11/11 09:46:11.455] serverHost=bwc.conn.address[0],
[2024/11/11 09:46:11.455] serverPort=bwc.conn.address[1],
[2024/11/11 09:46:11.455] serviceId=bwc.conn.service_id,
[2024/11/11 09:46:11.455] )
[2024/11/11 09:46:11.455] if bwc.publish:
[2024/11/11 09:46:11.455] bwc._start(cmd, request_id, op_docs, ns_docs)
[2024/11/11 09:46:11.455] try:
[2024/11/11 09:46:11.455] > reply = await bwc.conn.write_command(request_id, msg, bwc.codec) # type: ignore[misc, arg-type]
[2024/11/11 09:46:11.455] pymongo/asynchronous/client_bulk.py:260:
[2024/11/11 09:46:11.455] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[2024/11/11 09:46:11.455] pymongo/asynchronous/pool.py:628: in write_command
[2024/11/11 09:46:11.455] helpers_shared._check_command_response(result, self.max_wire_version)
[2024/11/11 09:46:11.455] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[2024/11/11 09:46:11.455] response = {'code': 8000, 'codeName': 'AtlasError', 'errmsg': '(Unauthorized) not authorized on admin to execute command { bulkWr...id: { id: {4 [194 141 87 18 29 228 71 22 179 16 122 167 82 61 72 15]} }, txnNumber: 1.000000, $db: "admin" }', 'ok': 0}
[2024/11/11 09:46:11.455] max_wire_version = 25, allowable_errors = None
[2024/11/11 09:46:11.455] parse_write_concern_error = False
[2024/11/11 09:46:11.455] def _check_command_response(
[2024/11/11 09:46:11.455] response: _DocumentOut,
[2024/11/11 09:46:11.455] max_wire_version: Optional[int],
[2024/11/11 09:46:11.455] allowable_errors: Optional[Container[Union[int, str]]] = None,
[2024/11/11 09:46:11.455] parse_write_concern_error: bool = False,
[2024/11/11 09:46:11.455] ) -> None:
[2024/11/11 09:46:11.455] """Check the response to a command for errors."""
[2024/11/11 09:46:11.455] if "ok" not in response:
[2024/11/11 09:46:11.455] # Server didn't recognize our message as a command.
[2024/11/11 09:46:11.455] raise OperationFailure(
[2024/11/11 09:46:11.455] response.get("$err"), # type: ignore[arg-type]
[2024/11/11 09:46:11.455] response.get("code"),
[2024/11/11 09:46:11.455] response,
[2024/11/11 09:46:11.455] max_wire_version,
[2024/11/11 09:46:11.455] )
[2024/11/11 09:46:11.455]
[2024/11/11 09:46:11.455] if parse_write_concern_error and "writeConcernError" in response:
[2024/11/11 09:46:11.455] _error = response["writeConcernError"]
[2024/11/11 09:46:11.455] _labels = response.get("errorLabels")
[2024/11/11 09:46:11.455] if _labels:
[2024/11/11 09:46:11.455] _error.update({"errorLabels": _labels})
[2024/11/11 09:46:11.455] _raise_write_concern_error(_error)
[2024/11/11 09:46:11.455]
[2024/11/11 09:46:11.455] if response["ok"]:
[2024/11/11 09:46:11.455] return
[2024/11/11 09:46:11.455]
[2024/11/11 09:46:11.455] details = response
[2024/11/11 09:46:11.455] # Mongos returns the error details in a 'raw' object
[2024/11/11 09:46:11.455] # for some errors.
[2024/11/11 09:46:11.455] if "raw" in response:
[2024/11/11 09:46:11.455] for shard in response["raw"].values():
[2024/11/11 09:46:11.455] # Grab the first non-empty raw error from a shard.
[2024/11/11 09:46:11.455] if shard.get("errmsg") and not shard.get("ok"):
[2024/11/11 09:46:11.455] details = shard
[2024/11/11 09:46:11.455] break
[2024/11/11 09:46:11.455]
[2024/11/11 09:46:11.455] errmsg = details["errmsg"]
[2024/11/11 09:46:11.455] code = details.get("code")
[2024/11/11 09:46:11.455]
[2024/11/11 09:46:11.455] # For allowable errors, only check for error messages when the code is not
[2024/11/11 09:46:11.455] # included.
[2024/11/11 09:46:11.455] if allowable_errors:
[2024/11/11 09:46:11.455] if code is not None:
[2024/11/11 09:46:11.455] if code in allowable_errors:
[2024/11/11 09:46:11.455] return
[2024/11/11 09:46:11.455] elif errmsg in allowable_errors:
[2024/11/11 09:46:11.455] return
[2024/11/11 09:46:11.455]
[2024/11/11 09:46:11.455] # Server is "not primary" or "recovering"
[2024/11/11 09:46:11.455] if code is not None:
[2024/11/11 09:46:11.455] if code in _NOT_PRIMARY_CODES:
[2024/11/11 09:46:11.455] raise NotPrimaryError(errmsg, response)
[2024/11/11 09:46:11.455] elif HelloCompat.LEGACY_ERROR in errmsg or "node is recovering" in errmsg:
[2024/11/11 09:46:11.455] raise NotPrimaryError(errmsg, response)
[2024/11/11 09:46:11.455]
[2024/11/11 09:46:11.455] # Other errors
[2024/11/11 09:46:11.455] # findAndModify with upsert can raise duplicate key error
[2024/11/11 09:46:11.455] if code in (11000, 11001, 12582):
[2024/11/11 09:46:11.455] raise DuplicateKeyError(errmsg, code, response, max_wire_version)
[2024/11/11 09:46:11.455] elif code == 50:
[2024/11/11 09:46:11.455] raise ExecutionTimeout(errmsg, code, response, max_wire_version)
[2024/11/11 09:46:11.455] elif code == 43:
[2024/11/11 09:46:11.455] raise CursorNotFound(errmsg, code, response, max_wire_version)
[2024/11/11 09:46:11.455]
[2024/11/11 09:46:11.455] > raise OperationFailure(errmsg, code, response, max_wire_version)
[2024/11/11 09:46:11.455] E pymongo.errors.OperationFailure: (Unauthorized) not authorized on admin to execute command { bulkWrite: 1, errorsOnly: true, ordered: true, lsid: { id: {4 [194 141 87 18 29 228 71 22 179 16 122 167 82 61 72 15]} }, txnNumber: 1.000000, $db: "admin" }, full error: {'ok': 0, 'errmsg': '(Unauthorized) not authorized on admin to execute command { bulkWrite: 1, errorsOnly: true, ordered: true, lsid: { id: {4 [194 141 87 18 29 228 71 22 179 16 122 167 82 61 72 15]} }, txnNumber: 1.000000, $db: "admin" }', 'code': 8000, 'codeName': 'AtlasError'}
[2024/11/11 09:46:11.455] pymongo/helpers_shared.py:247: OperationFailure
[2024/11/11 09:46:11.455] The above exception was the direct cause of the following exception:
[2024/11/11 09:46:11.455] self = <test.asynchronous.test_crud_unified.TestUnifiedClientBulkWriteReplaceOneSort testMethod=test_client_bulkWrite_replaceOne_with_sort_option>
[2024/11/11 09:46:11.455] async def test_case(self):
[2024/11/11 09:46:11.455] > await self.run_scenario(spec)
[2024/11/11 09:46:11.455] test/asynchronous/unified_format.py:1482:
[2024/11/11 09:46:11.455] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[2024/11/11 09:46:11.455] test/asynchronous/unified_format.py:1424: in run_scenario
[2024/11/11 09:46:11.455] await self._run_scenario(spec, uri)
[2024/11/11 09:46:11.455] test/asynchronous/unified_format.py:1459: in _run_scenario
[2024/11/11 09:46:11.455] await self.run_operations(spec["operations"])
[2024/11/11 09:46:11.455] test/asynchronous/unified_format.py:1264: in run_operations
[2024/11/11 09:46:11.455] await self.run_entity_operation(op)
[2024/11/11 09:46:11.455] test/asynchronous/unified_format.py:994: in run_entity_operation
[2024/11/11 09:46:11.455] result = await cmd(**dict(arguments))
[2024/11/11 09:46:11.455] pymongo/_csot.py:109: in csot_wrapper
[2024/11/11 09:46:11.455] return await func(self, *args, **kwargs)
[2024/11/11 09:46:11.455] pymongo/asynchronous/mongo_client.py:2381: in bulk_write
[2024/11/11 09:46:11.455] return await blk.execute(session, _Op.BULK_WRITE)
[2024/11/11 09:46:11.455] pymongo/asynchronous/client_bulk.py:751: in execute
[2024/11/11 09:46:11.455] result = await self.execute_command(session, operation)
[2024/11/11 09:46:11.455] pymongo/asynchronous/client_bulk.py:657: in execute_command
[2024/11/11 09:46:11.455] await self.client._retryable_write(
[2024/11/11 09:46:11.455] pymongo/asynchronous/mongo_client.py:1896: in _retryable_write
[2024/11/11 09:46:11.455] return await self._retry_with_session(retryable, func, s, bulk, operation, operation_id)
[2024/11/11 09:46:11.455] pymongo/asynchronous/mongo_client.py:1782: in _retry_with_session
[2024/11/11 09:46:11.455] return await self._retry_internal(
[2024/11/11 09:46:11.455] pymongo/_csot.py:109: in csot_wrapper
[2024/11/11 09:46:11.455] return await func(self, *args, **kwargs)
[2024/11/11 09:46:11.455] pymongo/asynchronous/mongo_client.py:1817: in _retry_internal
[2024/11/11 09:46:11.455] return await _ClientConnectionRetryable(
[2024/11/11 09:46:11.455] pymongo/asynchronous/mongo_client.py:2567: in run
[2024/11/11 09:46:11.455] return await self._read() if self._is_read else await self._write()
[2024/11/11 09:46:11.455] pymongo/asynchronous/mongo_client.py:2689: in _write
[2024/11/11 09:46:11.455] return await self._func(self._session, conn, self._retryable) # type: ignore
[2024/11/11 09:46:11.455] pymongo/asynchronous/client_bulk.py:648: in retryable_bulk
[2024/11/11 09:46:11.455] await self._execute_command(
[2024/11/11 09:46:11.455] pymongo/asynchronous/client_bulk.py:574: in _execute_command
[2024/11/11 09:46:11.455] _throw_client_bulk_write_exception(full_result, self.verbose_results)
[2024/11/11 09:46:11.455] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[2024/11/11 09:46:11.455] full_result = {'anySuccessful': False, 'deleteResults': {}, 'error': OperationFailure('(Unauthorized) not authorized on admin to exe...]} }, txnNumber: 1.000000, $db: "admin" }\', \'code\': 8000, \'codeName\': \'AtlasError\'}'), 'insertResults': {}, ...}
[2024/11/11 09:46:11.455] verbose_results = False
[2024/11/11 09:46:11.455] def _throw_client_bulk_write_exception(
[2024/11/11 09:46:11.455] full_result: _DocumentOut, verbose_results: bool
[2024/11/11 09:46:11.455] ) -> NoReturn:
[2024/11/11 09:46:11.455] """Raise a ClientBulkWriteException from the full result."""
[2024/11/11 09:46:11.455] # retryWrites on MMAPv1 should raise an actionable error.
[2024/11/11 09:46:11.455] if full_result["writeErrors"]:
[2024/11/11 09:46:11.455] full_result["writeErrors"].sort(key=lambda error: error["idx"])
[2024/11/11 09:46:11.455] err = full_result["writeErrors"][0]
[2024/11/11 09:46:11.455] code = err["code"]
[2024/11/11 09:46:11.455] msg = err["errmsg"]
[2024/11/11 09:46:11.455] if code == 20 and msg.startswith("Transaction numbers"):
[2024/11/11 09:46:11.455] errmsg = (
[2024/11/11 09:46:11.455] "This MongoDB deployment does not support "
[2024/11/11 09:46:11.455] "retryable writes. Please add retryWrites=false "
[2024/11/11 09:46:11.455] "to your connection string."
[2024/11/11 09:46:11.455] )
[2024/11/11 09:46:11.455] raise OperationFailure(errmsg, code, full_result)
[2024/11/11 09:46:11.455] if isinstance(full_result["error"], BaseException):
[2024/11/11 09:46:11.455] > raise ClientBulkWriteException(full_result, verbose_results) from full_result["error"]
[2024/11/11 09:46:11.455] E pymongo.errors.ClientBulkWriteException: batch op errors occurred, full error: {'anySuccessful': False, 'error': OperationFailure('(Unauthorized) not authorized on admin to execute command { bulkWrite: 1, errorsOnly: true, ordered: true, lsid: { id: {4 [194 141 87 18 29 228 71 22 179 16 122 167 82 61 72 15]} }, txnNumber: 1.000000, $db: "admin" }, full error: {\'ok\': 0, \'errmsg\': \'(Unauthorized) not authorized on admin to execute command { bulkWrite: 1, errorsOnly: true, ordered: true, lsid: { id: {4 [194 141 87 18 29 228 71 22 179 16 122 167 82 61 72 15]} }, txnNumber: 1.000000, $db: "admin" }\', \'code\': 8000, \'codeName\': \'AtlasError\'}'), 'writeErrors': [], 'writeConcernErrors': [], 'nInserted': 0, 'nUpserted': 0, 'nMatched': 0, 'nModified': 0, 'nDeleted': 0, 'insertResults': {}, 'updateResults': {}, 'deleteResults': {}}
[2024/11/11 09:46:11.455] pymongo/_client_bulk_shared.py:78: ClientBulkWriteException