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

The header content contains invalid characters #868

Closed
virtser opened this issue Apr 16, 2017 · 5 comments · Fixed by #870 or dorbel-tech/dorbel-shared#73
Closed

The header content contains invalid characters #868

virtser opened this issue Apr 16, 2017 · 5 comments · Fixed by #870 or dorbel-tech/dorbel-shared#73
Assignees
Milestone

Comments

@virtser
Copy link
Contributor

virtser commented Apr 16, 2017

היי, מישהו כתב לנו באינטרקום שהוא מנסה להעלות דירה ולא מצליח
מתקבלת הועה בשלב 3 The header content contains invalid characters
מה זה יכול להיות לדעתך?

As couldn't reproduced myself but found few evidences of this issue in Internet, trying to fix the issue by upgrading related modules.

Some special Hebrew chars in header/cookies must be failing it.

As we saw it in our logs:

{
  "application": "front-gateway",
  "name": "error-handler.js",
  "hostname": "9efa69355168",
  "pid": 36,
  "level": "ERROR",
  "err": {
    "message": "The header content contains invalid characters",
    "name": "TypeError",
    "stack": "TypeError: The header content contains invalid characters\n    at ClientRequest.OutgoingMessage.setHeader (_http_outgoing.js:358:11)\n    at new ClientRequest (_http_client.js:86:14)\n    at Object.exports.request (http.js:31:10)\n    at makeRequest (/home/nodejs/app/node_modules/newrelic/lib/instrumentation/core/http.js:423:31)\n    at instrumentRequest (/home/nodejs/app/node_modules/newrelic/lib/transaction/tracer/instrumentation/outbound.js:28:19)\n    at wrapped (/home/nodejs/app/node_modules/newrelic/lib/transaction/tracer/index.js:183:28)\n    at Tracer.addSegment (/home/nodejs/app/node_modules/newrelic/lib/transaction/tracer/index.js:83:48)\n    at instrumentOutbound (/home/nodejs/app/node_modules/newrelic/lib/transaction/tracer/instrumentation/outbound.js:19:23)\n    at Object.wrappedRequest [as request] (/home/nodejs/app/node_modules/newrelic/lib/instrumentation/core/http.js:417:14)\n    at Request.start (/home/nodejs/app/node_modules/request/request.js:744:32)\n    at Request.write (/home/nodejs/app/node_modules/request/request.js:1421:10)\n    at IncomingMessage.ondata (_stream_readable.js:555:20)\n    at emitOne (events.js:96:13)\n    at IncomingMessage.emit (events.js:188:7)\n    at IncomingMessage.wrapped (/home/nodejs/app/node_modules/newrelic/lib/transaction/tracer/index.js:183:28)\n    at IncomingMessage.wrappedEmit [as emit] (/home/nodejs/app/node_modules/newrelic/lib/transaction/tracer/index.js:220:46)\n    at IncomingMessage.Readable.read (_stream_readable.js:381:10)\n    at flow (_stream_readable.js:761:34)\n    at resume_ (_stream_readable.js:743:3)\n    at wrapped (/home/nodejs/app/node_modules/newrelic/lib/transaction/tracer/index.js:183:28)\n    at _combinedTickCallback (internal/process/next_tick.js:74:11)\n    at process._tickDomainCallback [as _tickCallback] (internal/process/next_tick.js:122:9)"
  },
  "requestId": "b00673de-1859-4ba9-af72-b7296022dad1",
  "msg": "Server Error",
  "time": "2017-04-16T07:43:47.067Z",
  "v": 0
}
@virtser virtser added this to the 18/04 milestone Apr 16, 2017
@virtser virtser self-assigned this Apr 16, 2017
@virtser
Copy link
Contributor Author

virtser commented Apr 16, 2017

I've found related bug in request library that we are using: request/request#2120

@virtser
Copy link
Contributor Author

virtser commented Apr 16, 2017

Also in koajs: koajs/koa#897

@ghost ghost added review and removed in progress labels Apr 16, 2017
virtser added a commit to dorbel-tech/dorbel-shared that referenced this issue Apr 16, 2017
* The header content contains invalid characters dorbel-tech/dorbel-app#868

* The header content contains invalid characters #868
virtser added a commit that referenced this issue Apr 16, 2017
* The header content contains invalid characters #868

* The header content contains invalid characters #868
@virtser virtser removed the review label Apr 16, 2017
@virtser
Copy link
Contributor Author

virtser commented Apr 16, 2017

@avnersorek could you think of use cases how to reproduce it based on our usage of header/cookies in code?
How special chars could come into header/cookies?

@avnersorek
Copy link
Contributor

our header contains a lot of stuff so it's hard to say.
As this is happening a couple of times everyday - https://service.eu.sumologic.com/ui/#section/search/pyyG0pEDee1wSisH5t20semPKYT3unefx0JcZnaA

I think we should start by logging the headers when it happens - dorbel-tech/dorbel-shared#70

@virtser virtser reopened this Apr 19, 2017
@virtser
Copy link
Contributor Author

virtser commented Apr 19, 2017

We are still getting this error:

traced_error_for_typeerror_-front-gateway-prod-_new_relic

@ghost ghost added the in progress label Apr 19, 2017
virtser added a commit to dorbel-tech/dorbel-shared that referenced this issue Apr 19, 2017
* The header content contains invalid characters dorbel-tech/dorbel-app#868

* The header content contains invalid characters #868

* Add info to logs for better bug handling #70

* added comment

* fixing tests
@virtser virtser added ready and removed in progress labels Apr 19, 2017
virtser pushed a commit to dorbel-tech/dorbel-shared that referenced this issue Apr 24, 2017
@virtser virtser removed the ready label Apr 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment