Skip to content

TypeError: argument of type 'NoneType' is not iterable #225

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
suwat-netprom opened this issue Apr 20, 2022 · 4 comments · Fixed by #233
Closed

TypeError: argument of type 'NoneType' is not iterable #225

suwat-netprom opened this issue Apr 20, 2022 · 4 comments · Fixed by #233

Comments

@suwat-netprom
Copy link

suwat-netprom commented Apr 20, 2022

Expected Behavior

can show log not have issue

Actual Behavior

[ERROR] TypeError: argument of type 'NoneType' is not iterable Traceback (most recent call last): File "/opt/python/lib/python3.8/site-packages/datadog_lambda/wrapper.py", line 142, in __call__ self.response = self.func(event, context, **kwargs) File "/var/task/wsgi_handler.py", line 59, in handler if "_serverless-wsgi" in event:

Steps to Reproduce the Problem

  1. test call api with postman to api-gateway
  2. goto lambda -> cloudwatch

Specifications

  • aws lambda
  • python flask framework
  • python flask_restful
  • serverless-python-requirements plugin
  • serverless-wsgi plugin
  • serverless-plugin-datadog plugin
  • Datadog Lambda Layer version: datadog-python38_3.57.0
  • Python version: 3.8

Stacktrace

image

image

image

thany you

Paste here

@zARODz11z
Copy link
Contributor

Hello, it seems the cause of the error is that the lambda event is empty (None). Any ideas why it might be set to None?

@suwat-netprom
Copy link
Author

suwat-netprom commented Apr 20, 2022

hello, I just started And I can't figure it out. I had never encountered an incident like this before.

@astuyve
Copy link
Contributor

astuyve commented Apr 20, 2022

Hi @suwat-netprom - looking at your report I suspect this library doesn't work with serverless-wsgi. This is because serverless-wsgi converts the incoming lambda event into a standard WSGI event.

We can of course fix this logic to not cause an error, but this library is effectively predicated on having the event object accessible, so without that I'm not sure we'll able to fundamentally help. We can consider this a feature request for now.

@suwat-netprom
Copy link
Author

hello, Thanks for checking if it's compatible. will be very helpful.

ps. My English isn’t good.

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

Successfully merging a pull request may close this issue.

3 participants