Open lefjul opened 2 years ago
I get this error with the python 3.7 runtime as well :
[ERROR] JSONDecodeError: Expecting value: line 1 column 2385 (char 2384)
Traceback (most recent call last):
File "/var/task/union_python3.py", line 167, in lambda_handler
instance = get_item_from_dynamodb_table(dynamodb_client, 'DDNS', instance_id)
File "/var/task/union_python3.py", line 1069, in get_item_from_dynamodb_table
return json.loads(item)
File "/var/lang/lib/python3.7/json/__init__.py", line 348, in loads
return _default_decoder.decode(s)
File "/var/lang/lib/python3.7/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/var/lang/lib/python3.7/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
I have not dived into this, but are using a slightly modified version (no reverse lookup zones) of the v3-python-file. It works well with both python 3.6 and 3.9
To solve this issue I added these 2 lines of code after the line numbered 1067 :
# BEGIN FIX JSON DECODE
item = item.replace(" True}", ' "True"}')
item = item.replace(" False}", ' "False"}')
# END FIX JSON DECODE
Now it is OK.
@abjoerne : could please tell me how you modified the code to disable the reverse lookup zones ? I'm interested in as well,
Thanks, Lefjul
I just removed all code related to the reverse zones as well as some other adjustments to fit our needs.
I can confirm @lefjul solution works in Mar/2024 with Python 3.12.
With Python 3.9 I get this error when the lambda must remove a record from the hosted zone (when stopping a EC2 instance) :
I don't face any error with Python 3.6 runtime. Since Python 3.6 will be deprecated in AWS on 18/07/2022, could you please bring the support of Python 3.9 ?
Thanks