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

[Bug] Nil pointer deref in res.Usage in ListVectors call #90

Open
2 tasks done
Southclaws opened this issue Jan 2, 2025 · 1 comment
Open
2 tasks done

[Bug] Nil pointer deref in res.Usage in ListVectors call #90

Southclaws opened this issue Jan 2, 2025 · 1 comment
Labels
bug Something isn't working status:needs-triage An issue that needs to be triaged by the Pinecone team

Comments

@Southclaws
Copy link

Is this a new bug?

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

Describe the bug

Upon calling ListVectors it fails with a nil pointer panic. While debugging, I can see the field the code is trying to read is nil.

image

Error information

After the grpc call to res, err := (*idx.dataClient).List(idx.akCtx(ctx), req) err is nil but res looks malformed, the res.Usage pointer is nil but the current code tries to read ReadUnits without first checking Usage for nil.

Steps to reproduce the issue locally

Call ListVectors with any args, it seems.

Environment

  • Go SDK version: v1.1.1
@Southclaws Southclaws added the bug Something isn't working label Jan 2, 2025
@Southclaws Southclaws changed the title [Bug] Nil pointer deref in res.Usage [Bug] Nil pointer deref in res.Usage in ListVectors call Jan 2, 2025
@github-actions github-actions bot added the status:needs-triage An issue that needs to be triaged by the Pinecone team label Jan 2, 2025
@jacob-brown
Copy link

jacob-brown commented Jan 5, 2025

same issue here with ListVectors.

I find that running with go run . works but building causes the null pointer error.

(edit) looks like older versions of the SDK also have the issue v1.0.0 to v1.1.1 (latest)

(edit) turns out mine was a bit of a blunder, I was trying to get the vectors for a namespace that doesn't exist!
Changing to the correct namespace resolved my issue however, it would be better to have ListVectorsResponse returned with empty slice for VectorIds.

hope the feedback helps the pinecone team
@Southclaws - double check you are calling with the intended config as the error msg didn't make this clear

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working status:needs-triage An issue that needs to be triaged by the Pinecone team
Projects
None yet
Development

No branches or pull requests

2 participants