Core as Cloud9 Instance - Problem with v2.x

0

Hello,

I am working through the Getting Started tutorial, except I am using a Cloud 9 instance rather than a Rasberry Pi as my GGCore. I can attach the recipe and artifacts just fine, but when attempting to run artifacts/com.example.HelloWorld/1.0.0/hello_world.py, it comes up with a permissions error. When looking at com.example.HelloWorld.log, I view the following error:

2020-12-18T17:26:38.435Z [WARN] (Copier) com.example.HelloWorld: stderr. Sorry, user root is not allowed to execute '/bin/sh -c python3 /greengrass/v2/packages/artifacts/com.example.HelloWorld/1.0.0/hello_world.py 'world'. {scriptName=services.com.example.HelloWorld.lifecycle.Run, serviceName=com.example.HelloWorld, currentState=RUNNING}

I also see this error on greengrass.log:

2020-12-18T17:27:09.606Z [ERROR] (com.example.HelloWorld-lifecycle) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-broken. service is broken. Deployment is needed. {serviceName=com.example.HelloWorld, currentState=BROKEN}
2020-12-18T17:27:09.619Z [INFO] (Thread-5) software.amazon.awssdk.eventstreamrpc.RpcServer: Server connection closed code [socket is closed.]: [Id 29, Class ServerConnection, Refs 1](2020-12-18T17:27:09.436Z) - <null>. {}

How can this be fixed?

Edited by: rakibk on Dec 18, 2020 9:47 AM

rakibk
asked 3 years ago342 views
3 Answers
0
Accepted Answer

Hi, I tried Greengrass v2 on cloud 9 and here's what worked for me: I made sure that my etc/sudoers file had root with ALL:ALL permissions, as it says in the requirements: https://docs.aws.amazon.com/greengrass/v2/developerguide/setting-up.html#greengrass-v2-requirements . I installed greengrass in the root directory so as to not have permissions issues with ec2-user directory. I changed the permissions on the greengrass folder to chmod 755, because I saw in a github commit that they needed to be 755 instead of what they are now. Then it worked for me, running on the greengrass core.

kenzie
answered 3 years ago
0

Hi rakibk,

Thanks for using Greengrass!

I have a few questions about your setup.

  1. Did you specify --component-default-user ggc_user:ggc_group in the installer command? Did you change the posix user of the HelloWorld component?
  2. Can you check the permission of file /greengrass/v2/packages/artifacts/com.example.HelloWorld/1.0.0/hello_world.py?
  3. Are you able to run sudo -u ggc_user echo hello on the Cloud9 instance?
answered 3 years ago
0

Hello!

  1. Yes I put that exact command as stated in the tutorial process. I did not change the ggc_user:ggc_group
  2. This the permissions I get for the file that you specified:

-rwxr-xr-- 1 ggc_user ggc_group 277 Dec 18 20:16 hello_world.py

  1. Yes, it outputs 'hello' without issue
rakibk
answered 3 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions