Search code examples
node.jsazurebotframework

Why is Activity body too large for storage error triggered in Bot framework?


I am using directline and using nodejs and sometime in between the conversation I am getting this error triggered in the onTurnError method. I am not sure why this is related to the activity. I am not using any attachment functionality.

Error: Activity body too large for storage. Try using attachments to reduce the activity size.
    at new RestError (D:\home\site\wwwroot\node_modules\@azure\ms-rest-js\dist\msRest.node.js:1397:28)
    at D:\home\site\wwwroot\node_modules\@azure\ms-rest-js\dist\msRest.node.js:1849:37
    at process._tickCallback (internal/process/next_tick.js:68:7)

Sometimes it is because of the content length too

Error: The request content length exceeded limit of 262144 bytes.
    at new RestError (D:\home\site\wwwroot\node_modules\@azure\ms-rest-js\dist\msRest.node.js:1397:28)
    at D:\home\site\wwwroot\node_modules\@azure\ms-rest-js\dist\msRest.node.js:1849:37
    at process._tickCallback (internal/process/next_tick.js:68:7)

Is it possible that if carousel cards have lot of the cards it returns in error ?


Solution

  • Yes, cards are attachments and they contribute to the size of the activity. It will be difficult to know how to help you reduce the size of your activities without seeing the activities, but if you have any embedded images then you should use URL's instead.

    Consider sending multiple activities instead of one. You can do this with multiple calls to sendActivity or with one call to sendActivities.