Skip to content

Exception when lambda is triggered by EventBridge Scheduler #275

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
akbisw opened this issue Dec 5, 2022 · 3 comments
Closed

Exception when lambda is triggered by EventBridge Scheduler #275

akbisw opened this issue Dec 5, 2022 · 3 comments
Assignees

Comments

@akbisw
Copy link

akbisw commented Dec 5, 2022

Expected Behavior

No exceptions

Actual Behavior

Exception thrown

Steps to Reproduce the Problem

  1. Use the new EventBridge Scheduler to invoke lambda function

Specifications

  • Datadog Lambda Layer version: 4.64.0
  • Python version: 3.9

Stacktrace

Traceback (most recent call last):
File "/var/lang/lib/python3.9/site-packages/datadog_lambda/wrapper.py", line 165, in _before
self.trigger_tags = extract_trigger_tags(event, context)
File "/var/lang/lib/python3.9/site-packages/datadog_lambda/trigger.py", line 297, in extract_trigger_tags
event_source = parse_event_source(event)
File "/var/lang/lib/python3.9/site-packages/datadog_lambda/trigger.py", line 141, in parse_event_source
cw_event_categories = event_detail and event_detail.get("EventCategories")
AttributeError: 'str' object has no attribute 'get'

Traceback (most recent call last):
File "/var/lang/lib/python3.9/site-packages/datadog_lambda/wrapper.py", line 199, in _after
status_code = extract_http_status_code_tag(self.trigger_tags, self.response)
AttributeError: '_LambdaDecorator' object has no attribute 'trigger_tags'
@astuyve
Copy link
Contributor

astuyve commented Dec 5, 2022

Hi @akbisw - thanks for reaching out!!
As this is a brand new service, we'll look into it asap.
Thanks!

@astuyve
Copy link
Contributor

astuyve commented Dec 5, 2022

Hi @akbisw - I'm having a bit of trouble reproducing this, but I just realized I had tested with python 3.8:
image
Will test 3.9 and report.

@DylanLovesCoffee
Copy link
Contributor

@akbisw I believe I was able to reproduce by modifying my target payload

@astuyve astuyve closed this as completed Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants