From d71e112c1100ac2d517ea52effe50368e6a1f0c1 Mon Sep 17 00:00:00 2001 From: dangmaul-amazon Date: Mon, 12 Apr 2021 12:07:42 -0700 Subject: [PATCH] Add log message to add AmazonCodeGuruProfilerAgentAccess policy to the Lambda's execution role. Add log message to add AmazonCodeGuruProfilerAgentAccess policy to the Lambda's execution role. This is to guide customers if they repeatedly get RFNE. --- codeguru_profiler_agent/sdk_reporter/sdk_reporter.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/codeguru_profiler_agent/sdk_reporter/sdk_reporter.py b/codeguru_profiler_agent/sdk_reporter/sdk_reporter.py index a3fb6bf..5df5e01 100644 --- a/codeguru_profiler_agent/sdk_reporter/sdk_reporter.py +++ b/codeguru_profiler_agent/sdk_reporter/sdk_reporter.py @@ -82,7 +82,8 @@ def refresh_configuration(self): if self.should_auto_create_profiling_group(): logger.info( "Profiling group not found. Will try to create a profiling group " - "with name = {} and compute platform = {} and retry calling configure agent after 5 minutes" + "with name = {} and compute platform = {} and retry calling configure agent after 5 minutes. " + "Make sure that Lambda's execution role has AmazonCodeGuruProfilerAgentAccess policy added." .format(self.profiling_group_name, 'AWSLambda')) self.create_profiling_group() else: @@ -118,7 +119,9 @@ def report(self, profile): self.__class__.is_create_pg_called_during_submit_profile = True logger.info( "Profiling group not found. Will try to create a profiling group " - "with name = {} and compute platform = {}".format(self.profiling_group_name, 'AWSLambda')) + "with name = {} and compute platform = {} and retry reporting during next invocation. " + "Make sure that Lambda's execution role has AmazonCodeGuruProfilerAgentAccess policy added." + .format(self.profiling_group_name, 'AWSLambda')) self.create_profiling_group() return False except Exception as e: