sTywin / dyndns53

Implementation of dyndns2 dynamic DNS protocol for AWS Lambda, API Gateway, and Route 53
MIT License
66 stars 25 forks source link

Python 3.8 + ipv6 support #11

Open thomascury opened 3 years ago

thomascury commented 3 years ago

Migrated to python 3.8 Added ipv6 support PEP8 refactoring

lukasmalkmus commented 11 months ago

Since Python 2.7 is gone for Lambdas, I went with your changes but seeing this error when testing:

[ERROR] TypeError: BotoCoreError.__init__() takes 1 positional argument but 2 were given
Traceback (most recent call last):
  File "/var/task/lambda_function.py", line 222, in lambda_handler
    raise type(exc)(type(exc)(json.dumps(json_exc_status))).with_traceback(sys.exc_info()[2])

The last successful log message before that is Old IP was: 255.255.255.255. So it is seeing my placeholder A record and the error seems to occur later.

thomascury commented 11 months ago

Retested today (23/10/2023) with Lambda runtime py-3.8 and API Gateway invocation without any issue. Seems like your Lambda is catching an Exception from the boto3 lib, for which I have no visibility, you could try something like this to fire the original Exception if the raise in line 223 is failing:

        finally:
            try:
                raise type(exc)(type(exc)(json.dumps(json_exc_status))).with_traceback(sys.exc_info()[2])
            except:
                raise exc