amazon-redshift-monitoring icon indicating copy to clipboard operation
amazon-redshift-monitoring copied to clipboard

No module named enum

Open niraj8241 opened this issue 6 years ago • 3 comments

I deployed the v1.5 zip which had the fix for pgpass library and it seems like i am seeing another module being missing.

17:15:47 global debug  17:15:47 START RequestId: 51a926fe-5e2d-43a0-adfd-4e8e022e016b Version: $LATEST  17:15:47 Unable to import module 'lambda_function': No module named enum  17:15:47 END RequestId: 51a926fe-5e2d-43a0-adfd-4e8e022e016b  17:15:47 REPORT RequestId: 51a926fe-5e2d-43a0-adfd-4e8e022e016b Duration: 0.50 ms Billed Duration: 100 ms Memory Size: 192 MB Max Memory Used: 32 MB  17:16:44 START RequestId: 51a926fe-5e2d-43a0-adfd-4e8e022e016b Version: $LATEST  17:16:44 Unable to import module 'lambda_function': No module named enum  17:16:44 END RequestId: 51a926fe-5e2d-43a0-adfd-4e8e022e016b  17:16:44 REPORT RequestId: 51a926fe-5e2d-43a0-adfd-4e8e022e016b Duration: 0.68 ms Billed Duration: 100 ms Memory Size: 192 MB Max Memory Used: 32 MB  17:18:35 START RequestId: 51a926fe-5e2d-43a0-adfd-4e8e022e016b Version: $LATEST  17:18:35 Unable to import module 'lambda_function': No module named enum  17:18:35 END RequestId: 51a926fe-5e2d-43a0-adfd-4e8e022e016b  17:18:35 REPORT RequestId: 51a926fe-5e2d-43a0-adfd-4e8e022e016b Duration: 0.52 ms Billed Duration: 100 ms Memory Size: 192 MB Max Memory Used: 32 MB

niraj8241 avatar Aug 06 '19 17:08 niraj8241

What's the runtime you are using? I think Enum was added in Python 3.4 but the template says 2.7 so I'd recommend trying with a py version >=3.4 . This can be changed in the template. This would only work if the code is Python 3 compatible but I guess it's worth a try.

pvbouwel avatar Aug 06 '19 18:08 pvbouwel

Ive updated the SAM templates to reference the correct runtime (python3).

IanMeyers avatar Aug 07 '19 12:08 IanMeyers

So i updated my runtime to 3.6 and now i get this

START RequestId: 33147bdf-38c3-40f4-909c-d92c8affd618 Version: $LATEST Syntax error in module 'lambda_function': name 'debug' is used prior to global declaration (redshift_monitoring.py, line 265)

END RequestId: 33147bdf-38c3-40f4-909c-d92c8affd618 REPORT RequestId: 33147bdf-38c3-40f4-909c-d92c8affd618 Duration: 0.54 ms Billed Duration: 100 ms Memory Size: 192 MB Max Memory Used: 22 MB

niraj8241 avatar Aug 08 '19 16:08 niraj8241