microsoft / BotFramework-Hubot

Hubot adapter for botframework
MIT License
111 stars 40 forks source link

/api/messages return 404 and HPE_INVALID_METHOD #53

Open dove-young opened 4 years ago

dove-young commented 4 years ago

I am trying to integrate BotFramework-Hubot with StackStorm 3.2.0.

I always get Cannot GET /api/messages from /api/messages.

curl http://localhost:8081/api/messages
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot GET /api/messages</pre>
</body>
</html>

Then I added export NODE_DEBUG='*', export DEBUG='*' before start hubot via bin/hubot -a botframework , then I found these error messages

STREAM 9762: do read
NET 9762: _read
NET 9762: Socket._read readStart
HTTP 9762: SERVER new http connection
TIMER 9762: no 863 list was found in insert, creating a new one
STREAM 9762: resume
STREAM 9762: resume true
STREAM 9762: flow true
STREAM 9762: read undefined
STREAM 9762: need readable true
STREAM 9762: length less than watermark true
STREAM 9762: reading or ended false
HTTP 9762: SERVER socketOnParserExecute NaN
HTTP 9762: parse error { [Error: Parse Error

]
  bytesParsed: 0,
  code: 'HPE_INVALID_METHOD',
  rawPacket:
   <Buffer 16 03 01 02 00 01 00 01 fc 03 03 b1 36 da a8 68 6d df 11 37 43 46 e4 a7 ea 2e da c5 6d d5 ba 62 d3 de de 07 ab 7a 0a da c0 3e f9 20 19 f2 fd 16 bd 21 ... > }
NET 9762: destroy
NET 9762: close
NET 9762: close handle
NET 9762: has server
NET 9762: SERVER _emitCloseIfDrained
NET 9762: SERVER handle? true   connections? 0
NET 9762: emit close
HTTP 9762: server socket close
TIMER 9762: timeout callback 5000

and also

STREAM 9762: length less than watermark true
STREAM 9762: reading or ended false
Tue, 14 Jul 2020 07:42:56 GMT express:router dispatching GET /api/messages
Tue, 14 Jul 2020 07:42:56 GMT express:router query  : /api/messages
Tue, 14 Jul 2020 07:42:56 GMT express:router expressInit  : /api/messages
Tue, 14 Jul 2020 07:42:56 GMT express:router <anonymous>  : /api/messages
Tue, 14 Jul 2020 07:42:56 GMT express:router query  : /api/messages
Tue, 14 Jul 2020 07:42:56 GMT express:router jsonParser  : /api/messages
Tue, 14 Jul 2020 07:42:56 GMT body-parser:json skip empty body
Tue, 14 Jul 2020 07:42:56 GMT express:router urlencodedParser  : /api/messages
Tue, 14 Jul 2020 07:42:56 GMT body-parser:urlencoded skip empty body
Tue, 14 Jul 2020 07:42:56 GMT express:router multipart  : /api/messages
Tue, 14 Jul 2020 07:42:56 GMT finalhandler default 404
STREAM 9762: resume
STREAM 9762: readableAddChunk null