CPM may accidently remove an instance from a policy

CPM may accidently remove an instance from a policy

If a policy does not contain an instance which is expected to be associated with it, please download and search the logs for the following print in cpm_agent logs:

      ERROR: get_account_credentials(.\cpmagent\agent.py:<line number>) Can't find mapping for account <account name> (user <user name>)
Followed by:
      ERROR: get_list(connection.py:<line number>) <?xml version="1.0" encoding="UTF-8"?>
      <Response><Errors><Error><Code>InvalidInstanceID.NotFound</Code><Message>The instance ID 'i-1ab23cd4' does not exist</Message></Error></Errors><RequestID><request id></RequestID></Response>

      WARNING: run_snapshots(.\cpmagent\agent.py:<line number>) instance i-1ab23cd4 doesn't exist anymore and will be removed from policy_
Please also search the following print in cpm_server logs:
      WARNING: remove_resources_from_policy(.\cpmserver\cpm\agentapi\handlers.py:<line number>) Auto removing instance i-1ab23cd4 from policy <policy name>
INFO: remove_resources_from_policy(.\cpmserver\cpm\agentapi\handlers.py:<line number>) No instance with same ID (i-1ab23cd4), removing agent_


If you face this issue, please upgrade to latest 2.X.X version
Reference defect number – N2WS-503, fixed in v2.2.0