Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does HPE_INVALID_EOF_STATE mean

Using hapi.js with a winston logger the messages we get every now and then is:

data: {"bytesParsed":0,"code":"HPE_INVALID_EOF_STATE"}

What does it mean and where does it come from?

like image 221
Nal Avatar asked Nov 19 '15 23:11

Nal


2 Answers

It is an error from the nodejs http parser, see here for more details. I am no c expert as to why you are hitting this error but have never encountered with hapi or node. See this issue on an old version of node also for some more context.

like image 74
simon-p-r Avatar answered Nov 07 '22 17:11

simon-p-r


Within HPE_INVALID_EOF_STATE, HPE stands for HTTP PARSER ERROR and EOF is end of file. You could read this as an HTTP parser error that encountered an unexpected end-of-file (or string).

So let's look a bit deeper. When looking that particular line I see that the HPE_INVALID_EOF_STATE error happens when an HTTP packet of 0 bytes arrives.

It happens in the http_parser_execute() method and it's likely due to a malformed HTTP packet arriving. It looks like it's been resolved in this case which was for an older version of Node.js: https://github.com/nodejs/node-v0.x-archive/issues/5220

like image 39
psiphi75 Avatar answered Nov 07 '22 15:11

psiphi75