- Newest
- Most votes
- Most comments
The issue you're experiencing with the AWS IoT Greengrass Token Exchange Service (TES) component appears to be related to credential retrieval failures, despite the component showing as "RUNNING".
Based on the error logs, the token exchange service was unable to fetch credentials from AWS IoT Core. The specific error "Received fatal alert: bad_certificate" in the SSL handshake suggests there was an issue with the device's certificate when trying to authenticate with AWS IoT Core to retrieve credentials.
This can happen for several reasons:
- The device's certificate might have been temporarily invalid or expired
- There might have been network connectivity issues affecting the SSL handshake
- The role alias configuration might have changed during the deployment
- The AWS IoT credentials provider might have been temporarily unavailable
Greengrass core devices store AWS credentials in memory, and these credentials expire after an hour by default. If the token exchange service can't refresh these credentials, components that depend on AWS credentials will start failing, even though the token exchange service itself might still appear to be running.
For monitoring and recovery:
- Implement health checks that periodically test if the token exchange service is responding correctly (similar to your curl test)
- Set up automated recovery procedures that restart the token exchange service component if it fails health checks
- Consider implementing a watchdog that can trigger a system reboot if multiple recovery attempts fail
- Monitor the Greengrass logs for credential-related errors
- Ensure your device has a stable network connection to AWS IoT Core
Since a system reboot resolved your issue, it suggests that restarting the Greengrass services is an effective recovery mechanism. You could implement a less disruptive solution by creating a script that specifically restarts just the token exchange service component when it detects failures.
Sources
Troubleshooting AWS IoT Greengrass V2 - AWS IoT Greengrass
Token exchange service - AWS IoT Greengrass
Interact with AWS services - AWS IoT Greengrass
answered a year ago
The TokenExchangeService can appear “RUNNING” while failing to respond if its local IPC or role alias credential flow becomes stuck. This usually happens when the device loses a valid IoT Core MQTT session or when cached credentials expire but the service cannot refresh them through the role alias endpoint. Greengrass continues showing connected status because the nucleus maintains connectivity with IoT Core independently of TES, but the CredentialRequestHandler fails when IoT authentication breaks or the TES container’s network stack stalls. —Taz
answered a year ago
Relevant content
asked 5 years ago
asked 5 years ago

TES component stays in RUNNING state because the local server that vends credentials is still up and running even when credential fetching from the iot credential service failed due to invalid device certificates at the time. Restarting Greengrass would not fix this until the TES role or the certificates are updated to valid ones.