aws / aws-iot-device-sdk-python-v2

Next generation AWS IoT Client SDK for Python using the AWS Common Runtime
Apache License 2.0
408 stars 213 forks source link

Lambda running with aws-iot-device-sdk-python-v2 silently failing due to import errors. #143

Closed Shwetabh1 closed 3 years ago

Shwetabh1 commented 3 years ago

Confirm by changing [ ] to [x] below:

Platform/OS/Device Ubuntu 18.04 Python 3.7

Describe the question I am using the sample code of publishing MQTT message using this SDK. The problem is Lambda starts and silently fails after hitting the line import awsiot.greengrasscoreipc.client as client on the ubuntu instance where greengrass nucleus is running.

The dependencies are there and It is packaged properly(Archive.zip) but as soon as it reaches that line lambda fails without any error msg. No logs appear. It is able to import all the other modules. I added logs inside awsiot.greengrasscoreipc.client and it fails at from . import model. I assumed it must be because of relative import so I added an absolute path as well but it keeps failing. The problem is no error is thrown so I can't debug what exactly goes wrong.

Simple Lambda without any aws-iot-device-sdk-python-v2 dependencies is running fine. I am looking for any guidance to find out at least the error due to which Lambda fails while importing.

paulhopkins11 commented 3 years ago

I am also seeing this while running Greengrass Core on an EC2 instance with an EC2 instance role with

AWSGreengrassFullAccess
AWSIoTFullAccess
AmazonS3FullAccess
IAMFullAccess
jmklix commented 3 years ago

Are you using greengrass v1 or v2?

paulhopkins11 commented 3 years ago

V2 for me

Shwetabh1 commented 3 years ago

I am using version 2 and this SDK.

hackaprende commented 3 years ago

Same problem here, I am using greengrass version 2 and it stops at import awsiot.greengrasscoreipc.client as client

From Raspberry pi 4

aarushi-mittal commented 3 years ago

any solutions or updates on this ?

aarushi-mittal commented 3 years ago

I found the solution the lib has been updated for greengrass v2

I added a line import awsiotsdk as awsiot

before import awsiot.greengrasscoreipc.client as client

Hope this helps.

Regards Aarushi

jmklix commented 3 years ago

Is anyone still encountering this error?

github-actions[bot] commented 3 years ago

Greetings! It looks like this issue hasn’t been active in longer than a week. We encourage you to check if this is still an issue in the latest release. Because it has been longer than a week since the last update on this, and in the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or add an upvote to prevent automatic closure, or if the issue is already closed, please feel free to open a new one.

github-actions[bot] commented 3 years ago

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.