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

describeIndexStats() promise failing #118

Closed
2 tasks done
deemonic opened this issue Sep 14, 2023 · 4 comments
Closed
2 tasks done

describeIndexStats() promise failing #118

deemonic opened this issue Sep 14, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@deemonic
Copy link

Is this a new bug?

  • I believe this is a new bug
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

I'm trying to call the describeIndexStats() function in order to check the record count for a specific index but it does not appear to be working, a keep getting a index.ts:11 Uncaught (in promise) error in the console.

I have gone over the pinecone documentation a few times to ensure that my code is correct and this is what I have

import { Pinecone } from '@pinecone-database/pinecone'

const pinecone = new Pinecone({
  apiKey: "YOUR_API_KEY",
  environment: "YOUR_ENVIRONMENT"
})

const myFunction = async () => {

const index = pinecone.index("my-index")

const stats= await index.describeIndexStats()

console.log(stats)

}

Expected Behavior

To return a 200 response

Steps To Reproduce

  1. install npm
  2. install pinecone
  3. run this code ensure you change the API_KEY and ENVIROMENT variables and specify your own pinecone index
import { Pinecone } from '@pinecone-database/pinecone'

const pinecone = new Pinecone({
  apiKey: "YOUR_API_KEY",
  environment: "YOUR_ENVIRONMENT"
})

const index = pinecone.index("my-index")

const stats= await index.describeIndexStats()

Relevant log output

No response

Environment

- **OS**: Windows 11 
- **Pinecone client version**: 0.1.6
- **Node JS**: 18.16.0

Additional Context

No response

@deemonic deemonic added the bug Something isn't working label Sep 14, 2023
@jhamon
Copy link
Collaborator

jhamon commented Sep 14, 2023

Thanks for the report. I think this is related to an issue with cross-fetch polyfill not getting enabled properly in some cases. I have already fixed that problem in main, and expect to cut a 1.0.1 release with that and a few other bug fixes this evening or tomorrow.

@deemonic
Copy link
Author

Thanks for the quick response... Brilliant I will keep and eye out for the release.

Many Thanks

@jhamon
Copy link
Collaborator

jhamon commented Sep 14, 2023

The 1.0.1 release is out. Release notes here. Please try it out and let me know if you're still having problems.

@deemonic
Copy link
Author

Apologies for the delay...

This release has fixed the issue, I can now called the describeIndexStats() and get a successful response.

Many Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants