Release 3.25.0 sandbox exceptions
Mirror issue:
[2021-04-08T07:08:03.051Z] | mongodb_mirror.mirror | ERROR - Critical error on trying to serialize entry - ["Failed to load 'bankAccounts' field, cause of {\"registrationFeeAccounts\": {\"accountType\": \"Value must be one of ['registrationFee', 'guarantee', 'securityDeposit', 'improvementCompensation', 'other', 'advancePayment', 'lease']\"}, \"guaranteeAccounts\": {\"accountType\": \"Value must be one of ['registrationFee', 'guarantee', 'securityDeposit', 'improvementCompensation', 'other', 'advancePayment', 'lease']\"}, \"advancePaymentAccounts\": {\"accountType\": \"Value must be one of ['registrationFee', 'guarantee', 'securityDeposit', 'improvementCompensation', 'other', 'advancePayment', 'lease']\"}, \"securityDepositAccounts\": {\"accountType\": \"Value must be one of ['registrationFee', 'guarantee', 'securityDeposit', 'improvementCompensation', 'other', 'advancePayment', 'lease']\"}, \"improvementsCompensationAccounts\": {\"accountType\": \"Value must be one of ['registrationFee', 'guarantee', 'securityDeposit', 'improvementCompensation', 'other', 'advancePayment', 'lease']\"}, \"otherAccounts\": {\"accountType\": \"Value must be one of ['registrationFee', 'guarantee', 'securityDeposit', 'improvementCompensation', 'other', 'advancePayment', 'lease']\"}}"] | X-Request-ID: 83c84dfd-08f0-49ab-bb0e-44c5dd93c2ce
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/schematics/models.py", line 134, in trusted_load
obj.__data[key] = obj.fields[key](val, context)
File "/usr/local/lib/python3.8/site-packages/schematics/types/base.py", line 226, in __call__
return self.convert(value, context)
File "/usr/local/lib/python3.8/site-packages/schematics/types/compound.py", line 51, in convert
return self._convert(value, context)
File "/usr/local/lib/python3.8/site-packages/prozorro_sale/procedure/models/types.py", line 128, in _convert
raise exceptions.CompoundError(errors)
schematics.exceptions.CompoundError: {"registrationFeeAccounts": {"accountType": "Value must be one of ['registrationFee', 'guarantee', 'securityDeposit', 'improvementCompensation', 'other', 'advancePayment', 'lease']"}, "guaranteeAccounts": {"accountType": "Value must be one of ['registrationFee', 'guarantee', 'securityDeposit', 'improvementCompensation', 'other', 'advancePayment', 'lease']"}, "advancePaymentAccounts": {"accountType": "Value must be one of ['registrationFee', 'guarantee', 'securityDeposit', 'improvementCompensation', 'other', 'advancePayment', 'lease']"}, "securityDepositAccounts": {"accountType": "Value must be one of ['registrationFee', 'guarantee', 'securityDeposit', 'improvementCompensation', 'other', 'advancePayment', 'lease']"}, "improvementsCompensationAccounts": {"accountType": "Value must be one of ['registrationFee', 'guarantee', 'securityDeposit', 'improvementCompensation', 'other', 'advancePayment', 'lease']"}, "otherAccounts": {"accountType": "Value must be one of ['registrationFee', 'guarantee', 'securityDeposit', 'improvementCompensation', 'other', 'advancePayment', 'lease']"}}
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/mongodb_mirror/mirror.py", line 101, in sync_client
data = self._serialize_document(data, collection)
File "/procedure_mirror/procedure_mirror/main.py", line 17, in _serialize_document
return load_procedure(migrated_data).to_primitive(app_data={'locale': '__all__'}, role='public')
File "/usr/local/lib/python3.8/site-packages/prozorro_sale/procedure/model_generator.py", line 64, in load_procedure
return get_procedure_type_from_data(data).trusted_load(data)
File "/usr/local/lib/python3.8/site-packages/schematics/models.py", line 136, in trusted_load
raise ConversionError(f"Failed to load '{key}' field, cause of {e}")
schematics.exceptions.ConversionError: ["Failed to load 'bankAccounts' field, cause of {\"registrationFeeAccounts\": {\"accountType\": \"Value must be one of ['registrationFee', 'guarantee', 'securityDeposit', 'improvementCompensation', 'other', 'advancePayment', 'lease']\"}, \"guaranteeAccounts\": {\"accountType\": \"Value must be one of ['registrationFee', 'guarantee', 'securityDeposit', 'improvementCompensation', 'other', 'advancePayment', 'lease']\"}, \"advancePaymentAccounts\": {\"accountType\": \"Value must be one of ['registrationFee', 'guarantee', 'securityDeposit', 'improvementCompensation', 'other', 'advancePayment', 'lease']\"}, \"securityDepositAccounts\": {\"accountType\": \"Value must be one of ['registrationFee', 'guarantee', 'securityDeposit', 'improvementCompensation', 'other', 'advancePayment', 'lease']\"}, \"improvementsCompensationAccounts\": {\"accountType\": \"Value must be one of ['registrationFee', 'guarantee', 'securityDeposit', 'improvementCompensation', 'other', 'advancePayment', 'lease']\"}, \"otherAccounts\": {\"accountType\": \"Value must be one of ['registrationFee', 'guarantee', 'securityDeposit', 'improvementCompensation', 'other', 'advancePayment', 'lease']\"}}"]
and procedure API issue:
ERROR - Unknown error caught in API - 'str' object has no attribute 'get' | X-Request-ID: ee9e1677-9b4a-4063-ab0a-6e22ccc7fc0d
Traceback (most recent call last):
File "/procedure/prozorro_sale/procedure/errors.py", line 76, in request_errors_middleware
return await handler(request)
File "/usr/local/lib/python3.9/site-packages/prozorro_sale/auth/__init__.py", line 107, in context_middleware
return await handler(request)
File "/usr/local/lib/python3.9/site-packages/prozorro_sale/auth/__init__.py", line 114, in access_middleware
return await check_access(handler)(request)
File "/usr/local/lib/python3.9/site-packages/prozorro_sale/auth/__init__.py", line 123, in handler
return await func(request, *args, **kwargs)
File "/procedure/prozorro_sale/procedure/utils.py", line 93, in accept_language_middleware
return await handler(request)
File "/usr/local/lib/python3.9/site-packages/prozorro_sale/tools/__init__.py", line 81, in retry_on_concurrency_error_middleware
return await handler(request)
File "/usr/local/lib/python3.9/site-packages/prozorro_sale/tools/__init__.py", line 67, in handler
return await func(request, *args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/prozorro_sale/tools/__init__.py", line 45, in request_unpack_params
return await handler(request, **request.match_info)
File "/usr/local/lib/python3.9/site-packages/prozorro_sale/tools/__init__.py", line 106, in handler
return await func(request, *args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/prozorro_sale/tools/__init__.py", line 67, in handler
return await func(request, *args, **kwargs)
File "/procedure/prozorro_sale/procedure/api.py", line 50, in create_procedure
procedure = model_generator.create_procedure(data, _id=blank._id, owner=user.name)
File "/procedure/prozorro_sale/procedure/model_generator.py", line 80, in create_procedure
proc = procType(data, **kwargs)
File "/procedure/prozorro_sale/procedure/models/base.py", line 60, in __init__
super().__init__(data, **kwargs)
File "/procedure/prozorro_sale/procedure/models/base.py", line 25, in __init__
super().__init__(data, **kwargs)
File "/usr/local/lib/python3.9/site-packages/schematics/models.py", line 112, in __init__
setattr(self, field, f_obj.validate(f_value, context))
File "/usr/local/lib/python3.9/site-packages/schematics/types/base.py", line 317, in validate
value = self.convert(value, context)
File "/usr/local/lib/python3.9/site-packages/schematics/types/compound.py", line 51, in convert
return self._convert(value, context)
File "/procedure/prozorro_sale/procedure/models/types.py", line 121, in _convert
data[key] = context.field_converter(self.field, item, context)
File "/usr/local/lib/python3.9/site-packages/schematics/transforms.py", line 388, in __call__
return self.func(*args)
File "/usr/local/lib/python3.9/site-packages/schematics/transforms.py", line 424, in validation_converter
return field.validate(value, context)
File "/usr/local/lib/python3.9/site-packages/schematics/types/base.py", line 317, in validate
value = self.convert(value, context)
File "/usr/local/lib/python3.9/site-packages/schematics/types/compound.py", line 51, in convert
return self._convert(value, context)
File "/usr/local/lib/python3.9/site-packages/schematics/types/compound.py", line 399, in _convert
model_class = self.find_model(value)
File "/usr/local/lib/python3.9/site-packages/schematics/types/compound.py", line 409, in find_model
kls = self.claim_function(self, data)
File "/procedure/prozorro_sale/procedure/packages/legitimatePropertyLease/utils.py", line 21, in legitimatePropertyLease_bankAccounts_claim_func
acc_type = data.get('accountType')
AttributeError: 'str' object has no attribute 'get'