Greengrass Lambda Permission Denied Error

0

I published a new version of my deployment and out of a sudden the Lambde stopped working. It worked before though.

This is the output of the core logs:

2021-02-15T17:38:38.964Z INFO (pool-2-thread-138) octopus-greengrass-sap-odata-service: shell-runner-start. {scriptName=services.octopus-greengrass-sap-odata-service.lifecycle.shutdown.script, serviceInstance=10, serviceName=octopus-greengrass-sap-odata-service, currentState=STOPPING, command=["/greengrass/v2/packages/artifacts/aws.greengrass.LambdaLauncher/2.0.3/lambda-l..."]}
2021-02-15T17:59:14.242Z INFO (pool-2-thread-140) octopus-greengrass-sap-odata-service: shell-runner-start. {scriptName=services.octopus-greengrass-sap-odata-service.lifecycle.startup.script, serviceInstance=11, serviceName=octopus-greengrass-sap-odata-service, currentState=STARTING, command=["/greengrass/v2/packages/artifacts/aws.greengrass.LambdaLauncher/2.0.3/lambda-l..."]}
2021-02-15T17:59:14.265Z INFO (pool-2-thread-146) octopus-greengrass-sap-odata-service: Finding mounted cgroups.. {serviceInstance=11, serviceName=octopus-greengrass-sap-odata-service, currentState=STARTING}
2021-02-15T17:59:14.304Z INFO (Copier) octopus-greengrass-sap-odata-service: stdout. Started process: 28808. {scriptName=services.octopus-greengrass-sap-odata-service.lifecycle.startup.script, serviceInstance=11, serviceName=octopus-greengrass-sap-odata-service, currentState=STARTING}
2021-02-15T17:59:14.307Z INFO (Copier) octopus-greengrass-sap-odata-service: Startup script exited. {exitCode=0, serviceInstance=11, serviceName=octopus-greengrass-sap-odata-service, currentState=STARTING}
2021-02-15T17:59:14.417Z INFO (pool-2-thread-146) octopus-greengrass-sap-odata-service: lambda_runtime.py:403,Status thread started. {serviceInstance=11, serviceName=octopus-greengrass-sap-odata-service, currentState=RUNNING}
2021-02-15T17:59:14.423Z ERROR (pool-2-thread-142) octopus-greengrass-sap-odata-service: FATAL: lambda_runtime.py:147,Failed to import handler function "app.lambda_handler" due to exception: Errno 13 Permission denied: '/lambda/requests/__init__.py'. {serviceInstance=11, serviceName=octopus-greengrass-sap-odata-service, currentState=RUNNING}
2021-02-15T17:59:14.424Z ERROR (pool-2-thread-142) octopus-greengrass-sap-odata-service: FATAL: lambda_runtime.py:428,Failed to initialize Lambda runtime due to exception: Errno 13 Permission denied: '/lambda/requests/__init__.py'. {serviceInstance=11, serviceName=octopus-greengrass-sap-odata-service, currentState=RUNNING}

I created a user during installation (in a root shell):

java -Droot="/greengrass/v2" -Dlog.store=FILE -jar ./GreengrassCore/lib/Greengrass.jar --aws-region eu-central-1 --thing-name aws-octopus-core --thing-group-name aws-octopus-group --component-default-user my_ggc_user:my_ggc_group --provision true --setup-system-service true --deploy-dev-tools true

Permission on folder:

maschine:/greengrass/v2/logs # ll /greengrass/
total 4
drwxr-xr-x 12 root root 4096 Feb 12 22:10 v2

maschine:/greengrass/v2/logs # ll /greengrass/v2/
total 52
drwx------ 3 root root 4096 Feb 12 22:10 alts
drwxr-xr-x 2 root root 4096 Feb 15 18:35 bin
drwxr-xr-x 2 root root 4096 Feb 15 18:35 cli_ipc_info
drwx------ 2 root root 4096 Feb 12 22:10 config
drwx------ 3 root root 4096 Feb 15 18:35 deployments
srw-rw-rw- 1 root root    0 Feb 12 22:10 ipc.socket
drwx------ 2 root root 4096 Feb 15 19:00 logs
drwxr-xr-x 5 root root 4096 Feb 12 17:12 packages
drwx------ 4 root root 4096 Feb 12 22:09 plugins
-rw-r--r-- 1 root root 1675 Feb 12 22:09 privKey.key
-rw-r--r-- 1 root root 1188 Feb 12 22:09 rootCA.pem
drwxr-xr-x 2 root root 4096 Feb 15 18:10 telemetry
-rw-r--r-- 1 root root 1220 Feb 12 22:09 thingCert.crt
drwxr-xr-x 4 root root 4096 Feb 14 11:20 work

maschine:/greengrass/v2/logs # ll /
total 104
drwxr-xr-x   3 root     root       4096 Feb 12 17:12 greengrass

Component runs in GreengrassContainer.

Thanks in advance

Edited by: bnjmn on Feb 15, 2021 10:11 AM

Edited by: bnjmn on Feb 15, 2021 10:12 AM

Edited by: bnjmn on Feb 15, 2021 10:13 AM

Edited by: bnjmn on Feb 15, 2021 10:13 AM

Edited by: bnjmn on Feb 15, 2021 10:13 AM

Edited by: bnjmn on Feb 15, 2021 10:14 AM

Edited by: bnjmn on Feb 15, 2021 10:15 AM

bnjmn
asked 3 years ago336 views
1 Answer
0

I guess I found a solution. Restart the systemd service worked for me:

systemctl restart greengrass.service

bnjmn
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