Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error when serving connection #159

Closed
hhbg9x opened this issue Aug 22, 2016 · 7 comments
Closed

error when serving connection #159

hhbg9x opened this issue Aug 22, 2016 · 7 comments

Comments

@hhbg9x
Copy link

hhbg9x commented Aug 22, 2016

hi team.

I have problem in many time. I used module "request" in nodejs and request to my server fasthttp, and have error.
Please check for me.

Thanks

2016/08/22 01:30:00 error when serving connection "xxx.xxx.xxx.xxx:8080"<->"yyy.yyy.yyy.yy:16622": error when reading request headers: need more data: cannot find trailing lf. buf="\x04\x01\x00\x16\u007f\x00\x00\x01root\x00"..."" 2016/08/22 01:29:55 error when serving connection "xxx.xxx.xxx.xxx:8080"<->"yyy.yyy.yyy.yy:16621": error when reading request headers: cannot find http request method in "\x05\x04\x00\x01\x02\x80\x05\x01\x00\x03\ngoogle.com\x00PGET / HTTP/1.0\r\n\r\n". buf="\x05\x04\x00\x01\x02\x80\x05\x01\x00\x03\ngoogle.com\x00PGET / HTTP/1.0\r\n\r\n"..."" 2016/08/22 01:30:10 error when serving connection "xxx.xxx.xxx.xxx:8080"<->"yyy.yyy.yyy.yy:16721": error when reading request headers: need more data: cannot find trailing lf. buf="\x80\x00\x00(r\xfe\x1d\x13\x00\x00\x00\x00\x00\x00\x00\x02\x00\x01\x86\xa0\x00\x01\x97|\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"..."" 2016/08/22 01:30:15 error when serving connection "xxx.xxx.xxx.xxx:8080"<->"yyy.yyy.yyy.yy:16742": error when reading request headers: need more data: cannot find trailing lf. buf="\x00\x1e\x00\x06\x01\x00\x00\x01\x00\x00\x00\x00\x00\x00\aversion\x04bind\x00\x00\x10\x00\x03"..."" 2016/08/22 01:30:20 error when serving connection "xxx.xxx.xxx.xxx:8080"<->"yyy.yyy.yyy.yy:16757": error when reading request headers: need more data: cannot find trailing lf. buf="\x00\f\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00"..."" 2016/08/22 01:30:20 error when serving connection "xxx.xxx.xxx.xxx:8080"<->"yyy.yyy.yyy.yy:16778": error when reading request headers: cannot find http request method in "HELP\r\n". buf="HELP\r\n"..."" 2016/08/22 01:30:20 error when serving connection "xxx.xxx.xxx.xxx:8080"<->"yyy.yyy.yyy.yy:16779": error when reading request headers: cannot find http request method in "\x16\x03\x00\x00S\x01\x00\x00O\x03\x00?G\xd7\xf7\xba,\xee\xea\xb2\xf3\x00\xfd\x82{\xb9?\xc8w\x9b\xe6\xc4\xdb<=\xdbo\xef\x10n\x00\x00(\x00\x16\x00\x13\x00\n\x00f\x00\x05\x00\x04\x00e\x00d\x00c\x00b\x00a\x00\x00\x15\x00\x12\x00\t\x00\x14\x00\x11\x00\b\x00\x06\x00\x03\x01\x00". buf="\x16\x03\x00\x00S\x01\x00\x00O\x03\x00?G\xd7\xf7\xba,\xee\xea\xb2\xf3\x00\xfd\x82{\xb9?\xc8w\x9b\xe6\xc4\xdb<=\xdbo\xef\x10n\x00\x00(\x00\x16\x00\x13\x00\n\x00f\x00\x05\x00\x04\x00e\x00d\x00c\x00b\x00a\x00\x00\x15\x00\x12\x00\t\x00\x14\x00\x11\x00\b\x00\x06\x00\x03\x01\x00"..."" 2016/08/22 01:30:20 error when serving connection "xxx.xxx.xxx.xxx:8080"<->"yyy.yyy.yyy.yy:16780": error when reading request headers: cannot find http request method in "\x16\x03\x00\x00i\x01\x00\x00e\x03\x03U\x1c\xa7\xe4random1random2random3random4\x00\x00\f\x00/\x00\n\x00\x13\x009\x00\x04\x00\xff\x01\x00\x000\x00\r\x00,\x00*\x00\x01\x00\x03\x00\x02\x06\x01\x06\x03\x06\x02\x02\x01\x02\x03\x02\x02\x03\x01\x03\x03\x03\x02\x04\x01\x04\x03\x04\x02\x01\x01\x01\x03\x01\x02\x05\x01\x05\x03\x05\x02". buf="\x16\x03\x00\x00i\x01\x00\x00e\x03\x03U\x1c\xa7\xe4random1random2random3random4\x00\x00\f\x00/\x00\n\x00\x13\x009\x00\x04\x00\xff\x01\x00\x000\x00\r\x00,\x00*\x00\x01\x00\x03\x00\x02\x06\x01\x06\x03\x06\x02\x02\x01\x02\x03\x02\x02\x03\x01\x03\x03\x03\x02\x04\x01\x04\x03\x04\x02\x01\x01\x01\x03\x01\x02\x05\x01\x05\x03\x05\x02"..."" 2016/08/22 01:30:20 error when serving connection "xxx.xxx.xxx.xxx:8080"<->"yyy.yyy.yyy.yy:16781": error when reading request headers: cannot find http request method in "\x00\x00\x00qj\x81n0\x81k\xa1\x03\x02\x01\x05\xa2\x03\x02\x01\n\xa4\x81^0\\\xa0\a\x03\x05\x00P\x80\x00\x10\xa2\x04\x1b\x02NM\xa3\x170\x15\xa0\x03\x02\x01\x00\xa1\x0e0\f\x1b\x06krbtgt\x1b\x02NM\xa5\x11\x18\x0f19700101000000Z\xa7\x06\x02\x04\x1f\x1e\xb9?\x170\x15\x02\x01\x12\x02\x01\x11\x02\x01\x10\x02\x01\x17\x02\x01\x01\x02\x01\x03\x02\x01\x02". buf="\x00\x00\x00qj\x81n0\x81k\xa1\x03\x02\x01\x05\xa2\x03\x02\x01\n\xa4\x81^0\\\xa0\a\x03\x05\x00P\x80\x00\x10\xa2\x04\x1b\x02NM\xa3\x170\x15\xa0\x03\x02\x01\x00\xa1\x0e0\f\x1b\x06krbtgt\x1b\x02NM\xa5\x11\x18\x0f19700101000000Z\xa7\x06\x02\x04\x1f\x1e\xb9?\x170\x15\x02\x01\x12\x02\x01\x11\x02\x01\x10\x02\x01\x17\x02\x01\x01\x02\x01\x03\x02\x01\x02"..."" 2016/08/22 01:30:35 error when serving connection "xxx.xxx.xxx.xxx:8080"<->"yyy.yyy.yyy.yy:16838": error when reading request headers: need more data: cannot find trailing lf. buf="0\f\x02\x01\x01\a\x02\x01\x02\x04\x00\x80\x00"...""
2016/08/22 01:30:40 error when serving connection "xxx.xxx.xxx.xxx:8080"<->"yyy.yyy.yyy.yy:16858": error when reading request headers: need more data: cannot find trailing lf. buf="TNMP\x04\x00\x00\x00TNME\x00\x00\x04\x00"...""
2016/08/22 01:30:45 error when serving connection "xxx.xxx.xxx.xxx:8080"<->"yyy.yyy.yyy.yy:16905": error when reading request headers: need more data: cannot find trailing lf. buf="\x03\x00\x00\v\x06\xe0\x00\x00\x00\x00\x00"...""
2016/08/22 01:30:50 error when serving connection "xxx.xxx.xxx.xxx:8080"<->"yyy.yyy.yyy.yy:16976": error when reading request headers: need more data: cannot find trailing lf. buf="DmdT\x00\x00\x00\x17\x00\x00\x00\x01\x00\x00\x00\x00\x11\x11\x00\xff\x01\xff\x13"...""
2016/08/22 01:30:55 error when serving connection "xxx.xxx.xxx.xxx:8080"<->"yyy.yyy.yyy.yy:25099": error when reading request headers: need more data: cannot find trailing lf. buf=":\x00\x00\x00/\x00\x00\x00\x02\x00\x00@\x02\x0f\x00\x01\x00=\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00/\x00\x00\x00\x00\x00\x00\x00\x00\x00@\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"...""
2016/08/22 01:31:00 error when serving connection "xxx.xxx.xxx.xxx:8080"<->"yyy.yyy.yyy.yy:25121": error when reading request headers: need more data: cannot find trailing lf. buf="\x01\x00\x00\xfd\xce\xfa\v\xb0\xa0\x00\x00\x00MMS\x14\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12\x00\x00\x00\x01\x00\x03\x00\xf0\xf0\xf0\xf0\v\x00\x04\x00\x1c\x00\x03\x00N\x00S\x00P\x00l\x00a\x00y\x00e\x00r\x00/\x009\x00.\x000\x00.\x000\x00.\x002\x009\x008\x000\x00;\x00 \x00{\x000\x000\x000\x000\x00A\x00A\x000\x000\x00-\x000\x00A\x000\x000\x00-\x000\x000\x00a\x000\x00-\x00A\x00A\x000\x00A\x00-\x000\x000\x000\x000\x00A\x000\x00A\x00A\x000\x00A\x00A\x000\x00}\x00\x00\x00\xe0m\xdf_"...""
2016/08/22 01:31:05 error when serving connection "xxx.xxx.xxx.xxx:8080"<->"yyy.yyy.yyy.yy:25128": error when reading request headers: need more data: cannot find trailing lf. buf="\x00Z\x00\x00\x01\x00\x00\x00\x016\x01,\x00\x00\b\x00\u007f\xff\u007f\b\x00\x00\x00\x01\x00 \x00:\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x004\xe6\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00(CONNECT_DATA=(COMMAND=version))"...""
2016/08/22 01:31:10 error when serving connection "xxx.xxx.xxx.xxx:8080"<->"yyy.yyy.yyy.yy:25167": error when reading request headers: need more data: cannot find trailing lf. buf="\x00\x03\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x0f\x00"...""
2016/08/22 01:31:15 error when serving connection "xxx.xxx.xxx.xxx:8080"<->"yyy.yyy.yyy.yy:25174": error when reading request headers: need more data: cannot find trailing lf. buf="\x94\x00\xcd\xef\xd1a\x91\x03"...""
2016/08/22 01:33:27 error when serving connection "xxx.xxx.xxx.xxx:8080"<->"yyy.yyy.yyy.yy:482": error when reading request headers: need more data: cannot find trailing lf. buf="\x80\x00\x00(\t;|\xe5\x00\x00\x00\x00\x00\x00\x00\x02\x00\x01\x86\xa0\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"...""

`

@oschwald
Copy link

We also are experiencing a similar issue when playing back recordings with JMeter. In our case, it appears to be happening while reading the content of a GET request:

2016/09/14 14:25:04 error when serving connection "10.124.47.138:13010"<->"10.100.56.204:35441": error when reading request headers: need more data: cannot find trailing lf. buf="\"41.227.129.86\""...""

Other HTTP servers were able to serve this request without error.

@oschwald
Copy link

oschwald commented Sep 14, 2016

After some further testing, it appears that fasthttp does not correctly handle a GET request with a body. The HTTP 1.1 specification states:

A server SHOULD read and forward a message-body on any request; if the request method does not include defined semantics for an entity-body, then the message-body SHOULD be ignored when handling the request.

I suspect this code is at fault.

oschwald added a commit to oschwald/fasthttp that referenced this issue Sep 14, 2016
Previously, GET/HEAD bodies were not read. The HTTP 1.1 specification
states:

"A server SHOULD read and forward a message-body on any request; if the
request method does not include defined semantics for an entity-body,
then the message-body SHOULD be ignored when handling the request.
I suspect this code is at fault."

This change reads the body on such request and continues the previous
behavior of returning a "Content-Length" of 0 to the application.

Closes valyala#159.
@hhbg9x
Copy link
Author

hhbg9x commented Sep 21, 2016

I will try new version.

Thank you :)

oschwald added a commit to oschwald/fasthttp that referenced this issue Oct 9, 2016
Previously, GET/HEAD bodies were not read. The HTTP 1.1 specification
states:

"A server SHOULD read and forward a message-body on any request; if the
request method does not include defined semantics for an entity-body,
then the message-body SHOULD be ignored when handling the request.
I suspect this code is at fault."

This change reads the body on such request and continues the previous
behavior of returning a "Content-Length" of 0 to the application.

Closes valyala#159.
oschwald added a commit to oschwald/fasthttp that referenced this issue Dec 16, 2016
Previously, GET/HEAD bodies were not read. The HTTP 1.1 specification
states:

"A server SHOULD read and forward a message-body on any request; if the
request method does not include defined semantics for an entity-body,
then the message-body SHOULD be ignored when handling the request.
I suspect this code is at fault."

This change reads the body on such request and continues the previous
behavior of returning a "Content-Length" of 0 to the application.

Closes valyala#159.
oschwald added a commit to oschwald/fasthttp that referenced this issue Feb 21, 2017
Previously, GET/HEAD bodies were not read. The HTTP 1.1 specification
states:

"A server SHOULD read and forward a message-body on any request; if the
request method does not include defined semantics for an entity-body,
then the message-body SHOULD be ignored when handling the request.
I suspect this code is at fault."

This change reads the body on such request and continues the previous
behavior of returning a "Content-Length" of 0 to the application.

Closes valyala#159.
oschwald added a commit to oschwald/fasthttp that referenced this issue Feb 21, 2017
Previously, GET/HEAD bodies were not read. The HTTP 1.1 specification
states:

"A server SHOULD read and forward a message-body on any request; if the
request method does not include defined semantics for an entity-body,
then the message-body SHOULD be ignored when handling the request.
I suspect this code is at fault."

This change reads the body on such request and continues the previous
behavior of returning a "Content-Length" of 0 to the application.

Closes valyala#159.
oschwald added a commit to oschwald/fasthttp that referenced this issue Mar 2, 2017
Previously, GET/HEAD bodies were not read. The HTTP 1.1 specification
states:

"A server SHOULD read and forward a message-body on any request; if the
request method does not include defined semantics for an entity-body,
then the message-body SHOULD be ignored when handling the request.
I suspect this code is at fault."

This change reads the body on such request and continues the previous
behavior of returning a "Content-Length" of 0 to the application.

Closes valyala#159.
@fiatjaf
Copy link

fiatjaf commented Mar 3, 2017

I've just seen this error and the problem, for anyone else in the same situation, is that I was trying to use https:// in a local server that only supported http://.

@theiostream
Copy link

Hey @oschwald. Why hasn't your solution been yet presented as a pull request?

@oschwald
Copy link

@theiostream, it has. See #171.

@theiostream
Copy link

Thanks for referencing it.

oschwald added a commit to oschwald/fasthttp that referenced this issue May 4, 2017
Previously, GET/HEAD bodies were not read. The HTTP 1.1 specification
states:

"A server SHOULD read and forward a message-body on any request; if the
request method does not include defined semantics for an entity-body,
then the message-body SHOULD be ignored when handling the request.
I suspect this code is at fault."

This change reads the body on such request and continues the previous
behavior of returning a "Content-Length" of 0 to the application.

Closes valyala#159.
oschwald added a commit to oschwald/fasthttp that referenced this issue Jun 5, 2017
Previously, GET/HEAD bodies were not read. The HTTP 1.1 specification
states:

"A server SHOULD read and forward a message-body on any request; if the
request method does not include defined semantics for an entity-body,
then the message-body SHOULD be ignored when handling the request.
I suspect this code is at fault."

This change reads the body on such request and continues the previous
behavior of returning a "Content-Length" of 0 to the application.

Closes valyala#159.
oschwald added a commit to oschwald/fasthttp that referenced this issue Jun 5, 2017
Previously, GET/HEAD bodies were not read. The HTTP 1.1 specification
states:

"A server SHOULD read and forward a message-body on any request; if the
request method does not include defined semantics for an entity-body,
then the message-body SHOULD be ignored when handling the request.
I suspect this code is at fault."

This change reads the body on such request and continues the previous
behavior of returning a "Content-Length" of 0 to the application.

Closes valyala#159.
erikdubbelboer pushed a commit to erikdubbelboer/fasthttp that referenced this issue Jul 31, 2017
Previously, GET/HEAD bodies were not read. The HTTP 1.1 specification
states:

"A server SHOULD read and forward a message-body on any request; if the
request method does not include defined semantics for an entity-body,
then the message-body SHOULD be ignored when handling the request.
I suspect this code is at fault."

This change reads the body on such request and continues the previous
behavior of returning a "Content-Length" of 0 to the application.

Closes valyala#159.
erikdubbelboer pushed a commit to erikdubbelboer/fasthttp that referenced this issue Nov 26, 2017
Previously, GET/HEAD bodies were not read. The HTTP 1.1 specification
states:

"A server SHOULD read and forward a message-body on any request; if the
request method does not include defined semantics for an entity-body,
then the message-body SHOULD be ignored when handling the request.
I suspect this code is at fault."

This change reads the body on such request and continues the previous
behavior of returning a "Content-Length" of 0 to the application.

Closes valyala#159.
erikdubbelboer added a commit to erikdubbelboer/fasthttp that referenced this issue Aug 17, 2018
Previously, GET/HEAD bodies were not read. The HTTP 1.1 specification
states:

"A server SHOULD read and forward a message-body on any request; if the
request method does not include defined semantics for an entity-body,
then the message-body SHOULD be ignored when handling the request.
I suspect this code is at fault."

This change reads the body on such request and continues the previous
behavior of returning a "Content-Length" of 0 to the application.

See: valyala#159
erikdubbelboer added a commit to erikdubbelboer/fasthttp that referenced this issue Aug 18, 2018
Previously, GET/HEAD bodies were not read. The HTTP 1.1 specification
states:

"A server SHOULD read and forward a message-body on any request; if the
request method does not include defined semantics for an entity-body,
then the message-body SHOULD be ignored when handling the request.
I suspect this code is at fault."

This change reads the body on such request and continues the previous
behavior of returning a "Content-Length" of 0 to the application.

See: valyala#159
erikdubbelboer added a commit to erikdubbelboer/fasthttp that referenced this issue Aug 18, 2018
Previously, GET/HEAD bodies were not read. The HTTP 1.1 specification
states:

"A server SHOULD read and forward a message-body on any request; if the
request method does not include defined semantics for an entity-body,
then the message-body SHOULD be ignored when handling the request.
I suspect this code is at fault."

This change reads the body on such request and continues the previous
behavior of returning a "Content-Length" of 0 to the application.

See: valyala#159
kirillDanshin pushed a commit that referenced this issue Aug 24, 2018
Previously, GET/HEAD bodies were not read. The HTTP 1.1 specification
states:

"A server SHOULD read and forward a message-body on any request; if the
request method does not include defined semantics for an entity-body,
then the message-body SHOULD be ignored when handling the request.
I suspect this code is at fault."

This change reads the body on such request and continues the previous
behavior of returning a "Content-Length" of 0 to the application.

See: #159
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants