- Newest
- Most votes
- Most comments
The "Connection reset by peer" error you're experiencing with your AWS IoT Core rule action to S3 is likely a temporary network issue. While the AWS IoT rules engine does have a built-in retry policy, it doesn't apply to all types of errors.
For S3 actions specifically, if a static key is used, AWS IoT overwrites a single file each time the rule is invoked. It's recommended to use a message timestamp or another unique identifier to save a new file for each message received, which could help mitigate some issues.
Regarding retries, the rules engine typically attempts to send a message at least once and retries at most twice, with a maximum of three tries. However, retries are not attempted in certain situations, including when the downstream service closes the TCP connection after the try. This could explain why you're not seeing retries for the "Connection reset by peer" error.
To address this issue, you could:
- Implement an error action, as you mentioned, to send the message to a Lambda function for handling.
- Use a unique key for each S3 object to avoid overwriting.
- Consider implementing application-level retry logic if the built-in retries are insufficient.
- Monitor and analyze the frequency and patterns of these errors to determine if they're related to specific timeframes or conditions.
If the issue persists or occurs frequently, it may be worth contacting AWS support for further investigation, as there could be underlying network or configuration issues specific to your setup.
Sources
S3 - AWS IoT Core
HTTP - AWS IoT Core
Network issue to S3: Timeouts in S3? | AWS re:Post
Relevant content
asked 3 years ago
asked 10 months ago
