Ingested the index, but can not fetch

keep getting this error [Error: PineconeClient: Error calling query: Error: PineconeClient: Error calling queryRaw: FetchError: The request failed and the interceptors did not return an alternative response]
what could be the problem? my side or pinecone’s
thank you

1 Like

Facing same issue, I don’t find any doc on Pinecone, can someone from Pinecone please explain/resolve ?

Hi @TextToSQL,

This error indicates that your fetch query is probably not formed properly. Can you share the code you’re using so we can debug further? Be sure not to share any API keys.

Hi,

Not TextToSQL, but I am receiving the same error

[ErrorWithoutStackTrace: PineconeClient: Error calling queryRaw: FetchError: The request failed and the interceptors did not return an alternative response]

Here’s my code:

    // Initialize pinecone client
    await pinecone.init({
        environment: process.env.PINECONE_ENVIRONMENT,
        apiKey: process.env.PINECONE_API_KEY,
    });

    // Set index we query from
    let indexName = "financial-news";

    // Pinecone index
    const index = pinecone.Index({ indexName });

    const queryRequest = {
        vector: vectorizedQueryData,
        top_k: 10,
    };
    
    // Send the query request to the Pinecone index and retrieve the results
    const response = await index.queryRaw({ queryRequest });

    console.log("Query Results" + JSON.stringify(response));

I am trying to query the vector database from a user input, vectorized by Bm25

I’m trying to run the LangChain Pinecone sample code and I hit the same upset error:

Code:

import { PineconeClient } from "@pinecone-database/pinecone";
import * as dotenv from "dotenv";
import { Document } from "langchain/document";
import { OpenAIEmbeddings } from "langchain/embeddings/openai";
import { PineconeStore } from "langchain/vectorstores/pinecone";

dotenv.config();

const client = new PineconeClient();
await client.init({
  apiKey: process.env.PINECONE_API_KEY,
  environment: process.env.PINECONE_ENVIRONMENT,
});
const pineconeIndex = client.Index(process.env.PINECONE_INDEX);

const docs = [
  new Document({
    metadata: { foo: "bar" },
    pageContent: "pinecone is a vector db",
  }),
  new Document({
    metadata: { foo: "bar" },
    pageContent: "the quick brown fox jumped over the lazy dog",
  }),
  new Document({
    metadata: { baz: "qux" },
    pageContent: "lorem ipsum dolor sit amet",
  }),
  new Document({
    metadata: { baz: "qux" },
    pageContent: "pinecones are the woody fruiting body and of a pine tree",
  }),
];

await PineconeStore.fromDocuments(docs, new OpenAIEmbeddings(), {
  pineconeIndex,
});

.env file:

OPENAI_API_KEY=<key>
PINECONE_API_KEY=<key>
PINECONE_ENVIRONMENT=<xxx.gcp.free>
PINECONE_INDEX_NAME=<short name>

Output:

node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

[PineconeError: PineconeClient: Error calling upsert: PineconeError: PineconeClient: Error calling upsertRaw: FetchError: The request failed and the interceptors did not return an alternative response]

Node.js v18.16.0

• I’m using the index short name (1536 dimensions)
• I’m using my OpenAI API Key
• Pinecone Key (starter plan, 1 index)

Any ideas?

1 Like