-
Notifications
You must be signed in to change notification settings - Fork 35
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
PineconeClient: Project name not set. Call init() first #12
Comments
I'm also receiving this error. It looks like I'm getting a Quickly looking through the source code it seems it's trying to use the jsdom version of fetch and isn't using node-fetch or axios? |
+1 It looks like the But when init'ing, that
👆🏼 This will not working. I'm going to use http requests directly until this is fixed. P.S. The documentation says to call |
@ediardo , @NCKLS , @JoshuaPerk - what Node version are you using? This is most likely an issue with using a version of Node that doesn't support |
I've added an
|
I'm running v16.19 in prod and unfortunately can't upgrade, so this would force me to fork or switch to a different library. Would strongly prefer an approach like the one in rileytomasek/pinecone-client, i.e. allow older versions of node via a fetch polyfill. If you wanted to make it extra user friendly, you could detect the absence of native |
Seems like this issue was resolved at |
i use Node.js v18.15.0 , i also get the same error |
I use Node 16.17.1 and get the same error.. "Error: PineconeClient: Project name not set. Call init() first." anyone? |
@markwwd @junhyeokkwak @Thushan96 - Can you please provides steps for a repro? |
@rschwabco I solved it by using the latest NodeJS version. Though, it's giving a warning that it's an experimental feature and it might get replaced in the future (the fetch method). |
Having the same issue. |
Also had this issue. Reverting back to version 0.0.10 fixed it for me. |
Also having this issue on node v16.19.1. Reverting to 0.0.10 worked for me. |
There was a build issue that resulted in the |
hiya new to pinecone, am also having the same errors. To recreate-- I cloned the repo from : https://github.com/mayooear/gpt4-pdf-chatbot-langchain && inputted my own API keys for OpenAI and PineCone. I've confirmed that my API keys work for both because when I removed them individually, I receive the expected corresponding errors of needing respective keys. @rschwabco I am running Node 19.7, and I've tried updating my pinecone to 0.0.10 and 0.0.12 and both are returning below: PineconeClient: Error getting project name: TypeError: fetch failed |
@katalystkat - I cloned the repo and was able to make it work with the same Node version you mentioned. I suspect you might be pointing to the wrong environment, or that the key you're using has been rotated. Can you share which environment you're using and confirm you are using the correct API key? (This is different than not having the key at all, which will result in a different error message) |
I am facing the same issue PineconeClient: Error getting project name: TypeError: fetch failed error - [Error: PineconeClient: Project name not set. Call init() first.] { page: ‘/api/chat’ } My node version is node -v v18.15.0 Pinecone version is “@pinecone-database/pinecone”: “^0.0.10”, It seems it is due to issue of fetch() which is an experimental feature. How to disable fetch() and use node-fetch() |
Had same problem. using node Node.js below 17 , with latest node 19 something, I do not get the init problem. But if I don't specify the pinecone.projectName the url in the library is looking like this https://testy-undefined.svc.testy-54978f2.svc.us-east1-gcp.pinecone.io Been hustling for 2 days with this. |
Also getting the error: PineconeClient: Project name not set. Call init() first. at PineconeClient.Index (/usr/src/app/.output/server/node_modules/@pinecone-database/pinecone/dist/index.js Upgraded my Docker version to Node.js 18.5 - error remains. "@pinecone-database/pinecone": "^0.0.11", import { PineconeClient } from "@pinecone-database/pinecone"; const pinecone = new PineconeClient(); const setupPinecone = async () => { setupPinecone(); export { pinecone } |
I did "@pinecone-database/pinecone": "^0.0.12", in package.json and did install again. it seems to be working fine |
what langchain version do you have? I get conflict with langchain 0.0.41 |
Upgraded but sitting with same issue |
What is your node version?? Mine is 18.5 |
Correct yes |
Are you behind some proxy? |
I think you should pull the code again, there has been changes last night in the code. |
I updated to 0.0.12 but got a new error. error [ErrorWithoutStackTrace: PineconeClient: Error getting project name: TypeError: fetch failed] even when I set the variable in the client. |
Still getting the error: Error: PineconeClient: Project name not set. Call init() first. at PineconeClient.Index (/usr/src/app/.output/server/node_modules/@pinecone-database/pinecone/dist/index.js:251:19) at upsertVectors (file:///usr/src/app/.output/server/chunks/index3.mjs:58:28) at file:///usr/src/app/.output/server/chunks/create.post2.mjs:11:24 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Object.handler (file:///usr/src/app/.output/server/node_modules/h3/dist/index.mjs:1247:19) at async Server.toNodeHandle (file:///usr/src/app/.output/server/node_modules/h3/dist/index.mjs:1322:7) Deleted package-lock.json and node-modules @pinecone-database/pinecone": "^0.0.12" Deployed on Google cloud |
@PMLS3 Want to co op in discord? |
Got it working on myside, have to call init everytime I call a function... |
@PMLS3 that definitely shouldn't be the case. You should only have to call |
I currently have the pinecone environment set to 'us-central1-gcp' because that is what is shown on my pinecone dashboard. I've rotated and tried a new API key as well but am still receiving the same error on my local machine. I tested my API key & environment via Pinecone API Reference (https://docs.pinecone.io/reference/list_collections) and I was able to get a 200 response there. |
Hate to add an extra comment but I too am getting this error. I have checked api key, index name, even added project name in there with the https://github.com/mayooear/gpt4-pdf-chatbot-langchain repo. I am running node 18.15, pinecone 0.0.1.0 . Langchain 0.0.4.0 One odd thing is that after loading my vectors which I got called as successful, I was still unable to view them with fetch or upsert on pinecone dashboard. I uploaded 1000 or so vectors. Shame because I finally got it…locally ok until I make a call. Edit: got mine fixed day or two ago. Re did npm install, no apostrophes on api, project #, and reuploaded vectors. |
Why is this one closed? I'm getting the same error and I'm using this langchain example here: https://js.langchain.com/docs/modules/indexes/vector_stores/integrations/pinecone#index-docs |
@mariobm Langchain seems to be using an outed version of the client (0.0.10 instead of 0.0.12). |
I'm still getting this error as well. I cloned the repo everyone is talking about, then I upgraded the pinecone version to 0.0.1.2, and am using node ~18. I'm getting this error: error [ErrorWithoutStackTrace: PineconeClient: Error getting project name: SyntaxError: Unexpected token A in JSON at position 0] |
Did you try adding the project # in the pinecone.ts? Project number a weird hash like '13h5ja' before the -gcp-1-east or whatever. Not near a computer so don't have a snapshot of my example. The one used has it after the quotations after pinecone_index_name and ID. Sorry can't be much more help right now. |
Not sure I understand. Here's what I have:
still getting the unexpected token issue. |
I was able to solve this problem by setting the project name after the init. Here is the code that worked for me. I'm using Node v19.8.1, "langchain": "^0.0.45", and "@pinecone-database/pinecone": "^0.0.10".
|
I was trying to setup repo 'https://github.com/mayooear/gpt4-pdf-chatbot-langchain' The suggestion by @felipeotarola solved the error without doing anything else. I was simply setting the PINECONE_ENVIRONMENT incorrectly. |
My node version: v18.12.1 |
I experienced this error, when the 'environment' was incorrectly set in the call to init(). |
Update to version 0.0.12 and move to another wi-fi network to avoid problems with a proxy worked for me |
is it solved? |
This is correct and fixed the issue for me. Perhaps the .env.example in this repo (https://github.com/mayooear/gpt4-pdf-chatbot-langchain) should be updated to reflect this. |
I was setting incorrect environment variables when using this project, and it seems like a few others have as well: pinecone-io/pinecone-ts-client#12 I propose outlining an example of correct environment variables in this example to reduce confusion.
I found that every index have a diffrent apikey,so if you have two or more index and you only set one apikey,you will get the "bug" |
Current working solution for me! |
Hi!
First day using Pinecone. I followed the steps at https://docs.pinecone.io/docs/node-client but I'm getting an error.
Version: 0.0.8
Code:
Error:
I tried setting the projectName right before the
init()
but didn't make a difference:What can I do to fix problem?
Thank you.
The text was updated successfully, but these errors were encountered: