palindromed / Bot-HandOff

MIT License
102 stars 79 forks source link

could not get response from bot and it is giving error as cant set headers after they are sent. #32

Open ajaykumar1452 opened 6 years ago

ajaykumar1452 commented 6 years ago

please find the Error message below in azure

Error: Can't set headers after they are sent. at ServerResponse.OutgoingMessage.setHeader (_http_outgoing.js:356:11) at applyHeaders (D:\home\site\wwwroot\node_modules\cors\lib\index.js:153:15) at applyHeaders (D:\home\site\wwwroot\node_modules\cors\lib\index.js:149:11) at applyHeaders (D:\home\site\wwwroot\node_modules\cors\lib\index.js:149:11) at cors (D:\home\site\wwwroot\node_modules\cors\lib\index.js:184:7) at D:\home\site\wwwroot\node_modules\cors\lib\index.js:221:17 at originCallback (D:\home\site\wwwroot\node_modules\cors\lib\index.js:211:15) at D:\home\site\wwwroot\node_modules\cors\lib\index.js:216:13 at optionsCallback (D:\home\site\wwwroot\node_modules\cors\lib\index.js:196:9) at corsMiddleware (D:\home\site\wwwroot\node_modules\cors\lib\index.js:201:7) at Layer.handle [as handle_request] (D:\home\site\wwwroot\node_modules\express\lib\router\layer.js:95:5) at trim_prefix (D:\home\site\wwwroot\node_modules\express\lib\router\index.js:317:13) at D:\home\site\wwwroot\node_modules\express\lib\router\index.js:284:7 at Function.process_params (D:\home\site\wwwroot\node_modules\express\lib\router\index.js:335:12) at next (D:\home\site\wwwroot\node_modules\express\lib\router\index.js:275:10) at next (D:\home\site\wwwroot\node_modules\express\lib\router\route.js:127:14) at D:\home\site\wwwroot\node_modules\botbuilder\lib\bots\ChatConnector.js:481:21 at ChatConnector.onDispatchEvents (D:\home\site\wwwroot\node_modules\botbuilder\lib\bots\ChatConnector.js:458:17) at ChatConnector.dispatch (D:\home\site\wwwroot\node_modules\botbuilder\lib\bots\ChatConnector.js:466:18) at D:\home\site\wwwroot\node_modules\botbuilder\lib\bots\ChatConnector.js:149:27 at OpenIdMetadata.getKey (D:\home\site\wwwroot\node_modules\botbuilder\lib\bots\OpenIdMetadata.js:26:13) at ChatConnector.verifyBotFramework (D:\home\site\wwwroot\node_modules\botbuilder\lib\bots\ChatConnector.js:123:28) The Bot State API is deprecated. Please refer to https://aka.ms/I6swrh for details on how to replace with your own storage.

ayush1074 commented 6 years ago

Hey was your issue resolved?

AlainDaccache98 commented 6 years ago

anyone has found the solution?

MercyPrasanna commented 5 years ago

I am facing the same issue now. Can we have support for this please?

Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client at ServerResponse.setHeader (_http_outgoing.js:471:11) at applyHeaders (C:\Work\BotFramework\example\node_modules\cors\lib\index.js:153:15) at applyHeaders (C:\Work\BotFramework\example\node_modules\cors\lib\index.js:149:11) at applyHeaders (C:\Work\BotFramework\example\node_modules\cors\lib\index.js:149:11) at cors (C:\Work\BotFramework\example\node_modules\cors\lib\index.js:184:7) at C:\Work\BotFramework\example\node_modules\cors\lib\index.js:221:17 at originCallback (C:\Work\BotFramework\example\node_modules\cors\lib\index.js:211:15) at C:\Work\BotFramework\example\node_modules\cors\lib\index.js:216:13 at optionsCallback (C:\Work\BotFramework\example\node_modules\cors\lib\index.js:196:9) at corsMiddleware (C:\Work\BotFramework\example\node_modules\cors\lib\index.js:201:7) at Layer.handle [as handle_request] (C:\Work\BotFramework\example\node_modules\express\lib\router\layer.js:95:5) at trim_prefix (C:\Work\BotFramework\example\node_modules\express\lib\router\index.js:317:13) at C:\Work\BotFramework\example\node_modules\express\lib\router\index.js:284:7 at Function.process_params (C:\Work\BotFramework\example\node_modules\express\lib\router\index.js:335:12) at next (C:\Work\BotFramework\example\node_modules\express\lib\router\index.js:275:10) at next (C:\Work\BotFramework\example\node_modules\express\lib\router\route.js:127:14) at C:\Work\BotFramework\example\node_modules\botbuilder\lib\bots\ChatConnector.js:569:21 at ChatConnector.onDispatchEvents (C:\Work\BotFramework\example\node_modules\botbuilder\lib\bots\ChatConnector.js:546:17) at ChatConnector.dispatch (C:\Work\BotFramework\example\node_modules\botbuilder\lib\bots\ChatConnector.js:554:18) at C:\Work\BotFramework\example\node_modules\botbuilder\lib\bots\ChatConnector.js:150:27 at OpenIdMetadata.getKey (C:\Work\BotFramework\example\node_modules\botbuilder\lib\bots\OpenIdMetadata.js:26:13) at ChatConnector.verifyBotFramework (C:\Work\BotFramework\example\node_modules\botbuilder\lib\bots\ChatConnector.js:124:28) Error: GET to 'https://state.botframework.com/v3/botstate/directline/users/Agent01' failed: [405] Method Not Allowed at AppInsightsAsyncCorrelatedErrorWrapper.ZoneAwareError (C:\Work\BotFramework\example\node_modules\zone.js\dist\zone-node.js:811:33) at new AppInsightsAsyncCorrelatedErrorWrapper (C:\Work\BotFramework\example\node_modules\applicationinsights\out\AutoCollection\CorrelationContextManager.js:173:18) at Request._callback (C:\Work\BotFramework\example\node_modules\botbuilder\lib\bots\ChatConnector.js:647:46) at Request.self.callback (C:\Work\BotFramework\example\node_modules\request\request.js:185:22) at ZoneDelegate.invokeTask (C:\Work\BotFramework\example\node_modules\zone.js\dist\zone-node.js:275:35) at Zone.runTask (C:\Work\BotFramework\example\node_modules\zone.js\dist\zone-node.js:151:47) at Request.ZoneTask.invoke (C:\Work\BotFramework\example\node_modules\zone.js\dist\zone-node.js:345:33) at Request.emit (events.js:182:13) at Request. (C:\Work\BotFramework\example\node_modules\request\request.js:1161:10) at ZoneDelegate.invokeTask (C:\Work\BotFramework\example\node_modules\zone.js\dist\zone-node.js:275:35) at Zone.runTask (C:\Work\BotFramework\example\node_modules\zone.js\dist\zone-node.js:151:47) at Request.ZoneTask.invoke (C:\Work\BotFramework\example\node_modules\zone.js\dist\zone-node.js:345:33) at Request.emit (events.js:182:13) at IncomingMessage. (C:\Work\BotFramework\example\node_modules\request\request.js:1083:12) at Object.onceWrapper (events.js:273:13) at ZoneDelegate.invokeTask (C:\Work\BotFramework\example\node_modules\zone.js\dist\zone-node.js:275:35) at Zone.runTask (C:\Work\BotFramework\example\node_modules\zone.js\dist\zone-node.js:151:47) at IncomingMessage.ZoneTask.invoke (C:\Work\BotFramework\example\node_modules\zone.js\dist\zone-node.js:345:33) at IncomingMessage.emit (events.js:187:15) at endReadableNT (_stream_readable.js:1090:12) at ZoneDelegate.invokeTask (C:\Work\BotFramework\example\node_modules\zone.js\dist\zone-node.js:275:35) at Zone.runTask (C:\Work\BotFramework\example\node_modules\zone.js\dist\zone-node.js:151:47)

vinayak99999 commented 5 years ago

Any solutions ?? I am also facing same issue