Permission denied trying to import from another component

0

I have a python component that is depended on another component. I set the path of the dependent in an environment variable in my recipe. At the beginning of my script, I add the path to my sys.path so I can find and import the module I needed. This all works fine during local deployment. But when I tried to deploy to another device (raspberry pi) from IoT console, the deployment failed. I get "PermissionError: [Errno 13] Permission denied: ..." on the file I am trying to import. I checked the files inside /greengrass/v2/packages, they are all under root with only read permissions (444). On my local machine, the files are also under root and with permission 644. It seems that this should not make any difference. Any idea this is not working? Thank you in advance!

jcai
已提問 3 年前檢視次數 616 次
2 個答案
0

Hi,
Different components won't have permission to read each others artifacts because they might be running as different users. When deploying a component you get to select what user each components runs as, and if they aren't the same then it won't have permissions to read it. You can address this by setting the permissions on the artifact within the recipe file such that everyone is allowed to read it. https://docs.aws.amazon.com/greengrass/v2/developerguide/component-recipe-reference.html

Cheers,
Michael Dombrowski

AWS
專家
已回答 3 年前
0

Yeah, that was it. Thank you very much!

jcai
已回答 3 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南