How to clear topic with malformed JSON payload?

0

I made a silly mistake and triggered a lambda on my core device with an malformed JSON payload.

Now greengrass is stuck in a loop, It tries to trigger the lambda, but the JSON payload cannot be loaded, so it fails and the lambda is not called, and, therefore, the message is never ack'ed... so it wait for timeout an tries again.

Now, reboot (restarting Greengrass probably too) will clear the situation, but is there a better way?

Cheers,
François

已提问 3 年前297 查看次数
3 回答
0

Hello François,

Is it failing to even call your lambda function handler?
In V2, the lambda manager logs into greengrass.log as it is a plugin into the Nucleus.
Can you provide an excerpt from the log showing the error?
If there is an error in your lambda's log file that would also be helpful to investigate.

Edited by: rob-aws on Sep 14, 2021 9:17 AM

AWS
Rob
已回答 3 年前
0

Hi Rob,
Thanks for answering.

I no longer have those logs. I reflashed that device.

From the logs I saw, this is what I understand was happening
- The lambda manager picks up a message with a triggering topic
- The lambda manager tries to decode the payload as JSON.
- An exception is raised because the JSON is not correct
- The lambda manager bails out without calling the lambda
- The lambda not being called, the message remains on the queue
- After some timeout, the same message is picked up and the process starts again.

There was an error message about JSON being invalid in the greengrass.log file

Cheers

已回答 3 年前
0

Closing this thing

Just make sure the JSON is correct ;)

已回答 3 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则