Skip to content

SESEvent KeyError #208

@rprentyaws

Description

@rprentyaws

What were you trying to accomplish?

Expected Behavior

I am trying to process an SES event using Lambda powertools for python.

Current Behavior

Error using this snippet:

[ERROR] KeyError: 0
Traceback (most recent call last):
  File "/var/task/lambda_function.py", line 11, in lambda_handler
    common_headers = list(mail.common_headers)
  File "/opt/python/aws_lambda_powertools/utilities/data_classes/common.py", line 11, in __getitem__
    return self._data[key]

Possible Solution

Steps to Reproduce (for bugs)

  1. Use the code in this snippet with powertools
  2. Use a test event of SES email, or just process an inbound SES email as the trigger.
  3. Check CloudWatch logs.

Environment

  • Powertools version used: 1.7.0
  • Packaging format (Layers, PyPi): Layers
  • AWS Lambda function runtime: Python 3.4
  • Debugging logs

How to enable debug mode**

[ERROR] KeyError: 0
Traceback (most recent call last):
  File "/var/task/lambda_function.py", line 11, in lambda_handler
    common_headers = list(mail.common_headers)
  File "/opt/python/aws_lambda_powertools/utilities/data_classes/common.py", line 11, in __getitem__
    return self._data[key]

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentation

Type

No type

Projects

Status

Triage

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions