Intermittent Unexpected end of JSON input error

When using the node library, I get this error periodically (usually shortly after the server restarts) when trying to query a namespaced index using

await index.namespace(pineconeNameSpace).query({
                    topK: k,
                    vector: queryEmbedding,
                    includeMetadata: true,
            });

Error below

499 |             var _a;
500 |             return __generator(this, function (_b) {
501 |                 switch (_b.label) {
502 |                     case 0:
503 |                         _a = this.transformer;
504 |                         return [4 /*yield*/, this.raw.json()];
                                                   ^

Trace

SyntaxError: Unexpected end of JSON input
      /node_modules/@pinecone-database/pinecone/dist/pinecone-generated-ts-fetch/runtime.js:504:46
      at step (/node_modules/@pinecone-database/pinecone/dist/pinecone-generated-ts-fetch/runtime.js:72:18)
      at /node_modules/@pinecone-database/pinecone/dist/pinecone-generated-ts-fetch/runtime.js:53:53
      at /node_modules/@pinecone-database/pinecone/dist/pinecone-generated-ts-fetch/runtime.js:47:9
      at new Promise (:1:21)
      at /node_modules/@pinecone-database/pinecone/dist/pinecone-generated-ts-fetch/runtime.js:43:12
      at /node_modules/@pinecone-database/pinecone/dist/pinecone-generated-ts-fetch/runtime.js:498:16
      at /node_modules/@pinecone-database/pinecone/dist/pinecone-generated-ts-fetch/apis/ManageIndexesApi.js:451:46
      at step (node_modules/@pinecone-database/pinecone/dist/pinecone-generated-ts-fetch/apis/ManageIndexesApi.js:84:18)
      at /node_modules/@pinecone-database/pinecone/dist/pinecone-generated-ts-fetch/apis/ManageIndexesApi.js:65:53
      at fulfilled (/node_modules/@pinecone-database/pinecone/dist/pinecone-generated-ts-fetch/apis/ManageIndexesApi.js:56

Hi @waelsahhar – are you using bun? we’ve encountered something similar in bun so that would help us debug.

Hi,

We are using Bun (v1.1.22) and just encountered this issue. It’s not all the time, but frequent enough to be problematic.