question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Trying to query documents results in a Parse Error: HPE_HEADER_OVERFLOW

See original GitHub issue

I am using the @azure/cosmos NPM package to query documents from CosmosDB and it results in the following error:

{ Error: Parse Error
    at TLSSocket.socketOnData (_http_client.js:442:20)
    at TLSSocket.emit (events.js:182:13)
    at addChunk (_stream_readable.js:283:12)
    at readableAddChunk (_stream_readable.js:264:11)
    at TLSSocket.Readable.push (_stream_readable.js:219:10)
    at TLSWrap.onStreamRead (internal/stream_base_commons.js:94:17)
  bytesParsed: 0,
  code: 'HPE_HEADER_OVERFLOW',
  headers:
   { 'x-ms-throttle-retry-count': 1,
     'x-ms-throttle-retry-wait-time-ms': 4059 } }

@azure/cosmos@2.1.1 Node.js 10.15.0

I’m using the following code:

const cosmos = require('@azure/cosmos');
const config = require('./local.settings.json');

const { CosmosClient } = cosmos;

const { endpoint, key } = config;
console.log(endpoint, key);
const client = new CosmosClient({ endpoint, auth: { key } });

const dbId = 'DB';
const containerId = 'Items';

async function getChats() {
  const querySpec =
    'SELECT * FROM c WHERE c.type = "ChatDefinition" AND c.roomId = "062db3be-339e-11e6-bebb-00163e75537f" AND c.lastEntry >= "2019-01-01"';
  const { result } = await client
    .database(dbId)
    .container(containerId)
    .items.query(querySpec)
    .toArray();
  return result;
}

async function run() {
  console.log('Gettings chats...');
  const chats = await getChats();
  console.log(chats.length);
}

run().catch(console.error);

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:22 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
southpolestevecommented, Jul 26, 2019

I’ve chatted with the backend team and determined we can safely default the header to 1kb. I’ve done this in #384 and exposed the option to make it larger. This should help significantly with header limit issues. It is still possible for collections with VERY large numbers of partitions to have a large session token, but continuation token is the main culprit.

2reactions
bertschneidercommented, Feb 28, 2019

FYI: We got around this issue adding the --max-http-header-size node flag.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Parse Error: Header overflow" During Node.js GET Request
I am trying to submit a form through Google forms programmatically through a GET request, but I am receiving the error Parse Error:...
Read more >
Parse Error: Header overflow · Issue #8656 - GitHub
I use Windows 10 and the version of Postman is 7.30.1 but this issue remains and I can not get the response of...
Read more >
How to resolve parse error when HTTP content-type header is ...
DataPower throws parse error with the following message: implied action Parse input as SOAP, attempt pipeline failed: illegal character 'n' ...
Read more >
WORKFLOW STOPPED: Parse Error: Header Overflow - Help
I made tests on different platforms postman, integromat, etc - everything works as it should, and no errors are received. Sometimes It goes...
Read more >
使用postman时报Error: Parse Error: Header overflow解决方法
产生原因:标头溢出,因响应的标头X-Subject-Token 超出postman默认的8k大小,这是Postman v7.2.5.1中引入的回归问题。 解决措施:添加一个变量即可, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found