aws-cloudformation / aws-cloudformation/custom-resource-helper
Receiving Error AttributeError: 'dict' object has no attribute 'get_remaining_time_in_millis'
- Dominant language
- Python
- Stars
- 383
- Forks
- 61
- PR merge metrics
- No merged PRs in 30d
Description
As I run my custom resource, it is successful but I receive a failure any way with
[ERROR] 2024-05-01T14:16:41.163Z 9407e51d-128f-4e7e-8295-24ef4980e717 'dict' object has no attribute 'get_remaining_time_in_millis'
Traceback (most recent call last):
File "/var/task/crhelper/resource_helper.py", line 76, in __call__
if not self._crhelper_init(event, context):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/task/crhelper/resource_helper.py", line 137, in _crhelper_init
self._set_timeout()
File "/var/task/crhelper/resource_helper.py", line 215, in _set_timeout
self._timer = threading.Timer((self._context.get_remaining_time_in_millis() / 1000.00) - 0.5,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'dict' object has no attribute 'get_remaining_time_in_millis'
I am using python 3.12
Contributor guide
Research direction
Start in resource_helper.py at _crhelper_init() and _set_timeout(), where the traceback shows the failure, and inspect how the context is supplied for Python 3.12 custom resources. Reproduce the error with the reported setup and determine why the context is a dict; done means the custom resource completes without the AttributeError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cloud, infrastructure
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 45/100