-
Notifications
You must be signed in to change notification settings - Fork 289
Description
Describe the bug
The Lambda function is running this code:
try:
self.client.create_log_stream(
logGroupName=self._log_group, logStreamName=self._log_stream
)
except self.client.exceptions.ResourceAlreadyExistsException:
pass
This code is located in the file named "logger.py" which is in the "instance_scheduler" and then "util" folder in the Lambda function. Based on this logic, the function will try to create the log stream without checking if it exists and throwing tens of thousands of event failures stating that the log stream already exists.
To Reproduce
Each time the scheduler service runs it will throw the failed api call.
Expected behavior
The Lambda API call will only create the log stream if it does not exist. Suggest the code be updated with;
logGroupName=self._log_group, logStreamNamePrefix=self._log_stream
)
if len(result["logStreams"]) == 0:
self.client.create_log_stream(
logGroupName=self._log_group, logStreamName=self._log_stream
)
- Version: v3.03
To get the version of the solution, you can look at the description of the created CloudFormation stack. For example,
"(SO0030) instance-scheduler-on-aws v1.5.1". You can also find the version from
releases
- Region: ap-southeast-2
- Was the solution modified from the version published on this repository? No
- If the answer to the previous question was yes, are the changes available on GitHub?
- Have you checked your service quotas for
the sevices this solution uses? - Were there any errors in the CloudWatch Logs?
Troubleshooting
Screenshots
If applicable, add screenshots to help explain your problem (please DO NOT include sensitive information).
Additional context
Logged an AWS support case and they suggested raising an issue here.