How to use GreenGrass MQTT to trigger a script

0

My testing has hit a number of roadblocks:

  1. I often run into an issue where my GG device stops accepting any new component commands including deployments from the console. The console will report all is well, but the instance does not show the updated component list for example. This can be solved easily by restarting the instance and running the commands again or redeploying, although I do not know why this occurs, this will happen after about 1-2 hours of constant use on a t3.large Ubuntu Cloud9 instance. It seems to occur specifically with the Publisher and Subscriber components running but enough work with any components will cause logs to start failing to appear in the /greengrass/v2/logs file and new commands to be essentially ignored. This is hard to catch and harder to debug due to the lack of new log files.

  2. Just trying to test the Stream Manager component has proven to be almost impossible and my test case (which I've gotten to work just a week ago) no longer runs correctly and I have no idea how to fix it or if I'm looking at the incorrect logs. I've been running the Custom Component tutorial here: https://docs.aws.amazon.com/greengrass/v2/developerguide/use-stream-manager-in-custom-components.html This is under the "Define component recipes that use stream manager" > "Use the Stream Manager SDK for Python" > https://github.com/aws-greengrass/aws-greengrass-stream-manager-sdk-python/blob/main/samples/stream_manager_s3.py I will include the logs in a response below

  3. Finally, I don't see any documentation on how to trigger a component using MQTT. I've tried importing a Lambda which has the option to be triggered by the local topic but haven't been able to test it due to the above. Any documentation on how to subscribe to a topic and run a script on the GG Core device when a message comes through from a client device (similar to an SNS topic triggering a Lambda) would be helpful. PS. I did find some stuff for V1 of GG but I'm specifically looking for V2.

2 Answers
0

Logs from my component:

2022-11-11T15:23:56.878Z [INFO] (pool-2-thread-25) com.example.test_function: shell-runner-start. {scriptName=services.com.example.test_function.lifecycle.startup.script, serviceInstance=0, serviceName=com.example.test_function, currentState=STARTING, command=["/greengrass/v2/packages/artifacts/aws.greengrass.LambdaLauncher/2.0.10/lambda-..."]} 2022-11-11T15:23:57.484Z [INFO] (pool-2-thread-12) com.example.test_function: Setting up overlay tmpfs mounts. {serviceInstance=0, serviceName=com.example.test_function, currentState=STARTING} 2022-11-11T15:23:57.615Z [INFO] (pool-2-thread-12) com.example.test_function: Finding mounted cgroups.. {serviceInstance=0, serviceName=com.example.test_function, currentState=STARTING} 2022-11-11T15:23:57.954Z [INFO] (Copier) com.example.test_function: stdout. Started process: 3281. {scriptName=services.com.example.test_function.lifecycle.startup.script, serviceInstance=0, serviceName=com.example.test_function, currentState=STARTING} 2022-11-11T15:23:57.963Z [INFO] (Copier) com.example.test_function: Startup script exited. {exitCode=0, serviceInstance=0, serviceName=com.example.test_function, currentState=STARTING} 2022-11-11T15:23:59.617Z [INFO] (pool-2-thread-12) com.example.test_function: lambda_runtime.py:402,Status thread started. {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:24:03.417Z [ERROR] (pool-2-thread-37) com.example.test_function: streammanagerclient.py:158,Connection error while connecting to server: [Errno 111] Connect call failed ('127.0.0.1', 8088). {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:24:03.433Z [ERROR] (pool-2-thread-37) com.example.test_function: trigger_function.py:131,Exception while running. {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:24:03.433Z [ERROR] (pool-2-thread-37) com.example.test_function: Traceback (most recent call last):. {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:24:03.433Z [ERROR] (pool-2-thread-37) com.example.test_function: File "/lambda/trigger_function.py", line 44, in main. {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:24:03.434Z [ERROR] (pool-2-thread-37) com.example.test_function: client = StreamManagerClient(). {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:24:03.434Z [ERROR] (pool-2-thread-37) com.example.test_function: File "/lambda/stream_manager/streammanagerclient.py", line 114, in init. {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:24:03.434Z [ERROR] (pool-2-thread-37) com.example.test_function: UtilInternal.sync(self.__connect(), loop=self.__loop). {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:24:03.434Z [ERROR] (pool-2-thread-37) com.example.test_function: File "/lambda/stream_manager/utilinternal.py", line 39, in sync. {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:24:03.434Z [ERROR] (pool-2-thread-37) com.example.test_function: return asyncio.run_coroutine_threadsafe(coro, loop=loop).result(). {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:24:03.434Z [ERROR] (pool-2-thread-37) com.example.test_function: File "/usr/lib/python3.6/concurrent/futures/_base.py", line 432, in result. {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:24:03.434Z [ERROR] (pool-2-thread-37) com.example.test_function: return self.__get_result(). {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:24:03.435Z [ERROR] (pool-2-thread-37) com.example.test_function: File "/usr/lib/python3.6/concurrent/futures/_base.py", line 384, in __get_result. {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:24:03.435Z [ERROR] (pool-2-thread-37) com.example.test_function: raise self._exception. {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:24:03.436Z [ERROR] (pool-2-thread-37) com.example.test_function: File "/lambda/stream_manager/streammanagerclient.py", line 149, in __connect. {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:24:03.436Z [ERROR] (pool-2-thread-37) com.example.test_function: future, timeout=self.connect_timeout. {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:24:03.436Z [ERROR] (pool-2-thread-37) com.example.test_function: File "/usr/lib/python3.6/asyncio/tasks.py", line 358, in wait_for. {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:24:03.436Z [ERROR] (pool-2-thread-37) com.example.test_function: return fut.result(). {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:24:03.436Z [ERROR] (pool-2-thread-37) com.example.test_function: File "/usr/lib/python3.6/asyncio/streams.py", line 81, in open_connection. {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:24:03.436Z [ERROR] (pool-2-thread-37) com.example.test_function: lambda: protocol, host, port, **kwds). {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:24:03.436Z [ERROR] (pool-2-thread-37) com.example.test_function: File "/usr/lib/python3.6/asyncio/base_events.py", line 794, in create_connection. {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:24:03.436Z [ERROR] (pool-2-thread-37) com.example.test_function: raise exceptions[0]. {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:24:03.437Z [ERROR] (pool-2-thread-37) com.example.test_function: File "/usr/lib/python3.6/asyncio/base_events.py", line 781, in create_connection. {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:24:03.437Z [ERROR] (pool-2-thread-37) com.example.test_function: yield from self.sock_connect(sock, address). {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:24:03.437Z [ERROR] (pool-2-thread-37) com.example.test_function: File "/usr/lib/python3.6/asyncio/selector_events.py", line 439, in sock_connect. {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:24:03.437Z [ERROR] (pool-2-thread-37) com.example.test_function: return (yield from fut). {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:24:03.437Z [ERROR] (pool-2-thread-37) com.example.test_function: File "/usr/lib/python3.6/asyncio/selector_events.py", line 469, in _sock_connect_cb. {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:24:03.437Z [ERROR] (pool-2-thread-37) com.example.test_function: raise OSError(err, 'Connect call failed %s' % (address,)). {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:24:03.442Z [ERROR] (pool-2-thread-31) com.example.test_function: FATAL: lambda_runtime.py:147,Failed to import handler function "trigger_function.function_handler" due to exception: local variable 'client' referenced before assignment. {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:24:03.444Z [ERROR] (pool-2-thread-31) com.example.test_function: FATAL: lambda_runtime.py:427,Failed to initialize Lambda runtime due to exception: local variable 'client' referenced before assignment. {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:24:03.967Z [ERROR] (pool-2-thread-37) com.example.test_function: ConnectionRefusedError: [Errno 111] Connect call failed ('127.0.0.1', 8088). {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:26:02.694Z [INFO] (pool-2-thread-42) com.example.test_function: shell-runner-start. {scriptName=services.com.example.test_function.lifecycle.shutdown.script, serviceInstance=0, serviceName=com.example.test_function, currentState=STOPPING, command=["/greengrass/v2/packages/artifacts/aws.greengrass.LambdaLauncher/2.0.10/lambda-..."]} 2022-11-11T15:26:03.007Z [INFO] (pool-2-thread-12) com.example.test_function: Tearing down overlay tmpfs mounts. {serviceInstance=0, serviceName=com.example.test_function, currentState=STOPPING} 2022-11-11T15:26:03.067Z [INFO] (pool-2-thread-42) com.example.test_function: shell-runner-start. {scriptName=services.com.example.test_function.lifecycle.startup.script, serviceInstance=0, serviceName=com.example.test_function, currentState=STARTING, command=["/greengrass/v2/packages/artifacts/aws.greengrass.LambdaLauncher/2.0.10/lambda-..."]} 2022-11-11T15:26:03.097Z [INFO] (pool-2-thread-36) com.example.test_function: Setting up overlay tmpfs mounts. {serviceInstance=0, serviceName=com.example.test_function, currentState=STARTING} 2022-11-11T15:26:03.107Z [INFO] (pool-2-thread-36) com.example.test_function: Finding mounted cgroups.. {serviceInstance=0, serviceName=com.example.test_function, currentState=STARTING} 2022-11-11T15:26:03.171Z [INFO] (Copier) com.example.test_function: stdout. Started process: 4086. {scriptName=services.com.example.test_function.lifecycle.startup.script, serviceInstance=0, serviceName=com.example.test_function, currentState=STARTING} 2022-11-11T15:26:03.175Z [INFO] (Copier) com.example.test_function: Startup script exited. {exitCode=0, serviceInstance=0, serviceName=com.example.test_function, currentState=STARTING} 2022-11-11T15:26:03.284Z [INFO] (pool-2-thread-36) com.example.test_function: lambda_runtime.py:402,Status thread started. {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:26:04.178Z [INFO] (pool-2-thread-36) com.example.test_function: trigger_function.py:88,Successfully appended S3 Task Definition to stream with sequence number 0. {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:26:05.238Z [ERROR] (pool-2-thread-12) com.example.test_function: trigger_function.py:131,Exception while running. {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:26:05.238Z [ERROR] (pool-2-thread-12) com.example.test_function: Traceback (most recent call last):. {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:26:05.238Z [ERROR] (pool-2-thread-12) com.example.test_function: File "/lambda/trigger_function.py", line 99, in main. {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:26:05.238Z [ERROR] (pool-2-thread-12) com.example.test_function: desired_start_sequence_number=next_seq, min_message_count=1, read_timeout_millis=1000. {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:26:05.238Z [ERROR] (pool-2-thread-12) com.example.test_function: File "/lambda/stream_manager/streammanagerclient.py", line 468, in read_messages. {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:26:05.238Z [ERROR] (pool-2-thread-12) com.example.test_function: return UtilInternal.sync(self._read_messages(stream_name, options), loop=self.__loop). {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:26:05.238Z [ERROR] (pool-2-thread-12) com.example.test_function: File "/lambda/stream_manager/utilinternal.py", line 39, in sync. {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:26:05.239Z [ERROR] (pool-2-thread-12) com.example.test_function: return asyncio.run_coroutine_threadsafe(coro, loop=loop).result(). {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:26:05.239Z [ERROR] (pool-2-thread-12) com.example.test_function: File "/usr/lib/python3.6/concurrent/futures/_base.py", line 432, in result. {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:26:05.239Z [ERROR] (pool-2-thread-12) com.example.test_function: return self.__get_result(). {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:26:05.239Z [ERROR] (pool-2-thread-12) com.example.test_function: File "/usr/lib/python3.6/concurrent/futures/_base.py", line 384, in __get_result. {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:26:05.239Z [ERROR] (pool-2-thread-12) com.example.test_function: raise self._exception. {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:26:05.239Z [ERROR] (pool-2-thread-12) com.example.test_function: File "/lambda/stream_manager/streammanagerclient.py", line 423, in _read_messages. {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:26:05.239Z [ERROR] (pool-2-thread-12) com.example.test_function: UtilInternal.raise_on_error_response(read_messages_response). {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:26:05.239Z [ERROR] (pool-2-thread-12) com.example.test_function: File "/lambda/stream_manager/utilinternal.py", line 202, in raise_on_error_response. {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:26:05.239Z [ERROR] (pool-2-thread-12) com.example.test_function: raise NotEnoughMessagesException(response.error_message, response.status, response.request_id). {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:26:05.352Z [INFO] (pool-2-thread-36) com.example.test_function: trigger_function.py:135,Success!. {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} 2022-11-11T15:26:05.354Z [INFO] (pool-2-thread-36) com.example.test_function: lambda_runtime.py:154,Running [arn:aws:lambda:us-west-2:624555782877:function:GreenGrassTriggerFunction:2]. {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING}

AWS
answered a year ago
0

greengrass.log file from around that time:

2022-11-11T15:24:12.776Z [INFO] (Thread-5) software.amazon.awssdk.eventstreamrpc.RpcServer: New connection code [AWS_ERROR_SUCCESS] for Id 43, Class ServerConnection, Refs 1 - <null>. {} 2022-11-11T15:24:12.872Z [INFO] (Thread-5) software.amazon.awssdk.eventstreamrpc.ServiceOperationMappingContinuationHandler: aws.greengrass#GreengrassCoreIPC authenticated identity: aws.greengrass.clientdevices.mqtt.EMQX. {} 2022-11-11T15:24:12.873Z [INFO] (Thread-5) software.amazon.awssdk.eventstreamrpc.ServiceOperationMappingContinuationHandler: Connection accepted for aws.greengrass.clientdevices.mqtt.EMQX. {} 2022-11-11T15:24:12.875Z [INFO] (Thread-5) software.amazon.awssdk.eventstreamrpc.ServiceOperationMappingContinuationHandler: Sending connect response for aws.greengrass.clientdevices.mqtt.EMQX. {} 2022-11-11T15:24:12.975Z [INFO] (Thread-5) software.amazon.awssdk.eventstreamrpc.RpcServer: Server connection closed code [socket is closed.]: Id 43, Class ServerConnection, Refs 1 - <null>. {} 2022-11-11T15:24:13.563Z [INFO] (Thread-5) software.amazon.awssdk.eventstreamrpc.RpcServer: New connection code [AWS_ERROR_SUCCESS] for Id 46, Class ServerConnection, Refs 1 - <null>. {} 2022-11-11T15:24:14.296Z [INFO] (Thread-5) software.amazon.awssdk.eventstreamrpc.ServiceOperationMappingContinuationHandler: aws.greengrass#GreengrassCoreIPC authenticated identity: aws.greengrass.StreamManager. {} 2022-11-11T15:24:14.296Z [INFO] (Thread-5) software.amazon.awssdk.eventstreamrpc.ServiceOperationMappingContinuationHandler: Connection accepted for aws.greengrass.StreamManager. {} 2022-11-11T15:24:14.296Z [INFO] (Thread-5) software.amazon.awssdk.eventstreamrpc.ServiceOperationMappingContinuationHandler: Sending connect response for aws.greengrass.StreamManager. {} 2022-11-11T15:24:16.056Z [INFO] (com.example.Publisher-lifecycle) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-set-state. {serviceName=com.example.Publisher, currentState=NEW, newState=INSTALLED} 2022-11-11T15:24:16.057Z [INFO] (com.example.Publisher-lifecycle) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-set-state. {serviceName=com.example.Publisher, currentState=INSTALLED, newState=STARTING} 2022-11-11T15:24:16.156Z [INFO] (com.example.Publisher-lifecycle) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-set-state. {serviceName=com.example.Publisher, currentState=STARTING, newState=RUNNING} 2022-11-11T15:24:16.455Z [INFO] (com.example.Subscriber-lifecycle) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-set-state. {serviceName=com.example.Subscriber, currentState=NEW, newState=INSTALLED} 2022-11-11T15:24:16.456Z [INFO] (com.example.Subscriber-lifecycle) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-set-state. {serviceName=com.example.Subscriber, currentState=INSTALLED, newState=STARTING} 2022-11-11T15:24:16.526Z [INFO] (com.example.Subscriber-lifecycle) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-set-state. {serviceName=com.example.Subscriber, currentState=STARTING, newState=RUNNING} 2022-11-11T15:24:18.064Z [INFO] (Thread-5) software.amazon.awssdk.eventstreamrpc.RpcServer: New connection code [AWS_ERROR_SUCCESS] for Id 47, Class ServerConnection, Refs 1 - <null>. {} 2022-11-11T15:24:18.096Z [INFO] (Thread-5) software.amazon.awssdk.eventstreamrpc.ServiceOperationMappingContinuationHandler: aws.greengrass#GreengrassCoreIPC authenticated identity: com.example.Publisher. {} 2022-11-11T15:24:18.096Z [INFO] (Thread-5) software.amazon.awssdk.eventstreamrpc.ServiceOperationMappingContinuationHandler: Connection accepted for com.example.Publisher. {} 2022-11-11T15:24:18.096Z [INFO] (Thread-5) software.amazon.awssdk.eventstreamrpc.ServiceOperationMappingContinuationHandler: Sending connect response for com.example.Publisher. {} 2022-11-11T15:24:18.267Z [INFO] (Thread-5) software.amazon.awssdk.eventstreamrpc.RpcServer: New connection code [AWS_ERROR_SUCCESS] for Id 49, Class ServerConnection, Refs 1 - <null>. {} 2022-11-11T15:24:18.269Z [INFO] (Thread-5) software.amazon.awssdk.eventstreamrpc.ServiceOperationMappingContinuationHandler: aws.greengrass#GreengrassCoreIPC authenticated identity: com.example.Subscriber. {} 2022-11-11T15:24:18.269Z [INFO] (Thread-5) software.amazon.awssdk.eventstreamrpc.ServiceOperationMappingContinuationHandler: Connection accepted for com.example.Subscriber. {} 2022-11-11T15:24:18.269Z [INFO] (Thread-5) software.amazon.awssdk.eventstreamrpc.ServiceOperationMappingContinuationHandler: Sending connect response for com.example.Subscriber. {} 2022-11-11T15:24:25.879Z [INFO] (Thread-5) software.amazon.awssdk.eventstreamrpc.RpcServer: New connection code [AWS_ERROR_SUCCESS] for Id 51, Class ServerConnection, Refs 1 - <null>. {} 2022-11-11T15:24:25.879Z [INFO] (Thread-5) software.amazon.awssdk.eventstreamrpc.ServiceOperationMappingContinuationHandler: aws.greengrass#GreengrassCoreIPC authenticated identity: aws.greengrass.clientdevices.mqtt.EMQX. {} 2022-11-11T15:24:25.879Z [INFO] (Thread-5) software.amazon.awssdk.eventstreamrpc.ServiceOperationMappingContinuationHandler: Connection accepted for aws.greengrass.clientdevices.mqtt.EMQX. {} 2022-11-11T15:24:25.880Z [INFO] (Thread-5) software.amazon.awssdk.eventstreamrpc.ServiceOperationMappingContinuationHandler: Sending connect response for aws.greengrass.clientdevices.mqtt.EMQX. {} 2022-11-11T15:24:25.888Z [INFO] (aws.greengrass.clientdevices.mqtt.EMQX-lifecycle) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-set-state. {serviceName=aws.greengrass.clientdevices.mqtt.EMQX, currentState=STARTING, newState=RUNNING} 2022-11-11T15:24:26.270Z [INFO] (pool-2-thread-24) com.aws.greengrass.tes.CredentialRequestHandler: Received IAM credentials that will be cached until 2022-11-11T16:19:26Z. {iotCredentialsPath=/role-aliases/GreengrassV2TokenExchangeRoleAlias/credentials} 2022-11-11T15:24:28.725Z [INFO] (pool-2-thread-29) com.aws.greengrass.clientdevices.auth.certificate.ClientCertificateGenerator: New client certificate generated. {reason=initialization of client cert subscription, subject=C=US,O=Amazon.com Inc.,OU=Amazon Web Services,ST=Washington,L=Seattle,CN=aws.greengrass.clientdevices.mqtt.Bridge, certExpiry=2022-11-18T15:24:28Z} 2022-11-11T15:24:29.169Z [INFO] (pool-2-thread-29) com.aws.greengrass.mqtt.bridge.clients.MQTTClient: Connecting to broker. {clientId=mqtt-bridge-mcwybw0rw6r, brokerUri=ssl://localhost:8883} 2022-11-11T15:24:29.211Z [INFO] (aws.greengrass.clientdevices.mqtt.Bridge-lifecycle) com.aws.greengrass.mqtt.bridge.MQTTBridge: service-set-state. {serviceName=aws.greengrass.clientdevices.mqtt.Bridge, currentState=STARTING, newState=RUNNING} 2022-11-11T15:24:36.607Z [INFO] (Thread-5) com.aws.greengrass.clientdevices.auth.certificate.ServerCertificateGenerator: New server certificate generated. {reason=initialization of server cert subscription, subject=C=US,O=Amazon.com Inc.,OU=Amazon Web Services,ST=Washington,L=Seattle,CN=aws.greengrass.clientdevices.mqtt.EMQX, connectivityInfo=[localhost], certExpiry=2022-11-18T15:24:36Z} 2022-11-11T15:24:36.675Z [INFO] (aws.greengrass.StreamManager-lifecycle) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-set-state. {serviceName=aws.greengrass.StreamManager, currentState=STARTING, newState=RUNNING} 2022-11-11T15:24:36.676Z [INFO] (main-lifecycle) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-set-state. {serviceName=main, currentState=INSTALLED, newState=STARTING} 2022-11-11T15:24:36.676Z [INFO] (pool-2-thread-30) com.aws.greengrass.lifecyclemanager.GenericExternalService: generic-service-finished. Nothing done. {serviceName=main, currentState=STARTING} 2022-11-11T15:24:36.677Z [INFO] (main-lifecycle) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-set-state. {serviceName=main, currentState=STARTING, newState=FINISHED} 2022-11-11T15:24:36.677Z [INFO] (main-lifecycle) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-set-state. {serviceName=main, currentState=FINISHED, newState=STOPPING} 2022-11-11T15:24:36.677Z [INFO] (pool-2-thread-30) com.aws.greengrass.lifecyclemanager.GenericExternalService: Shutdown initiated. {serviceName=main, currentState=STOPPING} 2022-11-11T15:24:36.677Z [INFO] (pool-2-thread-30) com.aws.greengrass.lifecyclemanager.GenericExternalService: generic-service-shutdown. {serviceName=main, currentState=STOPPING} 2022-11-11T15:24:36.677Z [INFO] (main-lifecycle) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-set-state. {serviceName=main, currentState=STOPPING, newState=FINISHED} 2022-11-11T15:24:38.098Z [INFO] (pool-2-thread-24) com.aws.greengrass.mqtt.bridge.clients.MQTTClient: Connected to broker. {clientId=mqtt-bridge-mcwybw0rw6r, brokerUri=ssl://localhost:8883} 2022-11-11T15:26:02.681Z [WARN] (pool-1-thread-1) com.aws.greengrass.lambdamanager.Lambda: The lambda has not reported status within the specified timeout PT1M and will be restarted immediately. {lastUpdated=2022-11-11T15:24:03.019704Z, componentName=com.example.test_function} 2022-11-11T15:26:02.681Z [ERROR] (pool-1-thread-1) com.aws.greengrass.lambdamanager.UserLambdaService: service-errored. {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING} com.aws.greengrass.lambdamanager.StatusTimeoutException: Lambda status not received within timeout at com.aws.greengrass.lambdamanager.Lambda.lambda$createInstanceKeepAliveTask$5(Lambda.java:282) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829)

2022-11-11T15:26:02.683Z [INFO] (com.example.test_function-lifecycle) com.aws.greengrass.lambdamanager.UserLambdaService: service-set-state. {serviceInstance=0, serviceName=com.example.test_function, currentState=RUNNING, newState=ERRORED} 2022-11-11T15:26:02.688Z [INFO] (com.example.test_function-lifecycle) com.aws.greengrass.status.FleetStatusService: fss-status-update-published. Status update published to FSS. {trigger=ERRORED_COMPONENT, serviceName=FleetStatusService, currentState=RUNNING} 2022-11-11T15:26:02.690Z [INFO] (com.example.test_function-lifecycle) com.aws.greengrass.status.FleetStatusService: fss-status-update-published. Status update published to FSS. {trigger=ERRORED_COMPONENT, serviceName=FleetStatusService, currentState=RUNNING} 2022-11-11T15:26:02.691Z [INFO] (com.example.test_function-lifecycle) com.aws.greengrass.lambdamanager.UserLambdaService: service-set-state. {serviceInstance=0, serviceName=com.example.test_function, currentState=ERRORED, newState=STOPPING} 2022-11-11T15:26:02.694Z [INFO] (pool-2-thread-42) com.aws.greengrass.lambdamanager.UserLambdaService: Shutdown initiated. {serviceInstance=0, serviceName=com.example.test_function, currentState=STOPPING} 2022-11-11T15:26:03.027Z [INFO] (pool-2-thread-42) com.aws.greengrass.lambdamanager.UserLambdaService: generic-service-shutdown. {serviceInstance=0, serviceName=com.example.test_function, currentState=STOPPING} 2022-11-11T15:26:03.029Z [INFO] (com.example.test_function-lifecycle) com.aws.greengrass.lambdamanager.UserLambdaService: service-set-state. {serviceInstance=0, serviceName=com.example.test_function, currentState=STOPPING, newState=INSTALLED} 2022-11-11T15:26:03.030Z [INFO] (com.example.test_function-lifecycle) com.aws.greengrass.lambdamanager.UserLambdaService: service-set-state. {serviceInstance=0, serviceName=com.example.test_function, currentState=INSTALLED, newState=STARTING} 2022-11-11T15:26:03.174Z [INFO] (Copier) com.aws.greengrass.lambdamanager.UserLambdaService: Startup script exited. {exitCode=0, serviceInstance=0, serviceName=com.example.test_function, currentState=STARTING} 2022-11-11T15:26:03.175Z [INFO] (com.example.test_function-lifecycle) com.aws.greengrass.lambdamanager.UserLambdaService: service-set-state. {serviceInstance=0, serviceName=com.example.test_function, currentState=STARTING, newState=RUNNING}

AWS
answered a year 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