N2WS-19169 - Cleanup may fail because of "Can't find mapping for account "

N2WS-19169 - Cleanup may fail because of "Can't find mapping for account "

Issue:

Cleanup process may fail because server fails to clean cross-region AMI DR:
ERROR: get_account_dict(account_utils.py:114) account PolicyName(user root) not found in account map, even after refresh.
ERROR: execute_collection_api_call(init_.py:116) Failed calling ec2.describe_images (region: us-west-1, account: 
PolicyName, user: root). Exception: AWS was not able to validate the provided access credentials (AuthFailure)
ERROR: append_records_to_dr_amis_deleted_list(agent.py:3976) Could not delete DR AMI ami-1234567 in policy 
PolicyName.Reason: AWS was not able to validate the provided access credentials (code: AuthFailure)
ERROR: get_account_number(account_utils.py:175) Can't find mapping for account PolicyName(user root)

And 
2021-08-08 01:33:18,619:[140291944212224][----------] ERROR:  cleanup_function(agent.py:3623)  cleanup failed, aborting cleanup
Traceback (most recent call last):
 File "/opt/n2wsoftware/python/lib/python3.7/site-packages/django/db/backends/mysql/base.py", line 307, in _set_autocommit
   self.connection.autocommit(autocommit)
 File "/opt/n2wsoftware/python/lib/python3.7/site-packages/MySQLdb/connections.py", line 209, in autocommit
   _mysql.connection.autocommit(self, on)
MySQLdb._exceptions.OperationalError: (2006, 'MySQL server has gone away')


Solution:
  1. Patch for v4.0.0a available and attached to this KB

Click here to go back to the Release notes: Release notes for the latest v4.0.x CPM release