Search code examples
node.jsbotframeworkchatbotmicrosoft-teamsadaptive-cards

MS Teams | Microsoft bot framework - Returns 502 error on task/fetch


I have an MS Teams adapter written using the botframeworks sdk v4 for node js which works perfectly for normal conversations. But when I try to do a task/fetch, it returns an error message "Unable to reach app. Please try again." on the task module popup

enter image description here

I can see from the inspector that it returns 502 response for the request to invoke the task module

enter image description here

The task module returns a simple adaptive card and I can see that I get a callback on my handleTeamsTaskModuleFetch function from the logs

enter image description here

The adapter runs on a docker container with an nginx proxy and the nginx logs shows that, it returns a 200 response whenever I click on the task module launch button

I have a similar setup in my dev and taskmodule works perfect there

Any help is highly appreciated

Update

I have tried hardcoding the adaptive card. That doesnt help either

enter image description here


Solution

  • Eventually it was found that there was a problem with one of the csp headers and microsoft was not happy about it.

    I removed the CSP headers and the taskmodule started working

    Thanks to @gousia-msft for your help in debugging the issue