-
Notifications
You must be signed in to change notification settings - Fork 289
python3: retries fail due to incompatible code #133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
A downgrade to Python 2 does not resolve this. The scheduler won't work at all. However, we have a hotfix and we do now see the underlying error which is I plan to share the details of the hotfix as soon as I get to it. |
Other than discussing the hotfix, which is basically only applying the pattern of https://github.com/awslabs/aws-instance-scheduler/blob/6f86b91fd641a2526c4c0b1c78245e41f3406efb/source/code/boto_retry/ec2_service_retry.py#L40 to throttling in https://github.com/awslabs/aws-instance-scheduler/blob/6f86b91fd641a2526c4c0b1c78245e41f3406efb/source/code/boto_retry/aws_service_retry.py#L52 I'd love to discuss the need for Looking at throttling in botocore you may find different types of Taking it even further would be to leave retries solely in the hands of botocore. That is, however, beyond the scope of this bug. |
Hi @rseuchter Thanks for submitting the issue. We confirmed that the exception message property does not work with Python version 3. We will fix this issue and publish it here. Regarding the need for |
Thank you for taking this up. Let me clarify the point with Putting retries (and thereby handling of |
I just hit this bug again in another account using a pretty different setup. The bottom line is this: This bug masks all sorts of errors and often blocks people from debugging problems with using or setting up the instance scheduler. In the latest occurence I disabled |
+1 We're also being impacted by this because our Instance Scheduler is stopping but not starting instances. However we can't see the cause in the logs due to this error. |
This issue has been fixed in the release 1.3.1. Please deploy the latest template to get the updated code. |
Recently, we started using aws-instance-scheduler 1.3.0. This morning I found some instances have not been started despite the scheduler trying to start them.
In the log I found this:
Fast-forward a few hours of research and digging through the code (and first suspecting a problem in botocore): While I don't know what the exact underlying error I found what's wrong in handling this error.
In PEP 352 the
message
attribute of Python'sException
class was deprecated. In Python 3 exceptions no longer have amessage
. However, looking at boto_retry you'll findThis will fail using python3. As aws-instance-scheduler has been moved to python3 recently you start seeing this error.
My suggestion to fix this is handling the error in a way botocore suggests handling errors, see https://botocore.amazonaws.com/v1/documentation/api/latest/client_upgrades.html#error-handling (via https://stackoverflow.com/a/33663484)
Tomorrow, we'll try if downgrading the lambda function to python2 can be a workaround.
The text was updated successfully, but these errors were encountered: