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 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则