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] Cannot list vectors, getting missing HTTP content-type error #87

Open
2 tasks
maxheckel opened this issue Oct 24, 2024 · 1 comment
Open
2 tasks
Labels
bug Something isn't working status:needs-triage An issue that needs to be triaged by the Pinecone team

Comments

@maxheckel
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
I have the following code:

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"log"

	"github.com/pinecone-io/go-pinecone/pinecone"
	_ "google.golang.org/protobuf/types/known/structpb"
)

func main() {
	ctx := context.Background()

	client, err := pinecone.NewClient(pinecone.NewClientParams{
		ApiKey: "REDACTED",
	})
	if err != nil {
		log.Fatalf("Failed to create Client: %v", err)
	}
	index, err := client.Index(pinecone.NewIndexConnParams{
		Host:      "REDACTED",
		Namespace: "REDACTED",
	})
	if err != nil {
		log.Fatalf("Failed to initialize index: %v", err)
	}

	res, err := index.ListVectors(ctx, &pinecone.ListVectorsRequest{
		Prefix:          nil,
		Limit:           nil,
		PaginationToken: nil,
	})
	if err != nil {
		log.Fatalf("Failed to describe index stats: %v", err)
	}

	fmt.Println(res)
}

When running it I get the following output:
2024/10/24 14:04:37 Failed to describe index stats: rpc error: code = Unknown desc = malformed header: missing HTTP content-type

Error information
n/a

Steps to reproduce the issue locally
Run the code above
My go.mod looks like this:

module ai-experiments

go 1.21

require (
	github.com/pinecone-io/go-pinecone v1.1.1
	google.golang.org/protobuf v1.34.1
)

require (
	github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
	github.com/davecgh/go-spew v1.1.1 // indirect
	github.com/google/uuid v1.6.0 // indirect
	github.com/oapi-codegen/runtime v1.1.1 // indirect
	github.com/pmezard/go-difflib v1.0.0 // indirect
	github.com/stretchr/testify v1.8.4 // indirect
	golang.org/x/net v0.25.0 // indirect
	golang.org/x/sys v0.20.0 // indirect
	golang.org/x/text v0.15.0 // indirect
	google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 // indirect
	google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect
	google.golang.org/grpc v1.65.0 // indirect
	gopkg.in/yaml.v3 v3.0.1 // indirect
)

Environment

  • OS Version: MacOS 14.6.1 (23G93)
  • Go version: 1.21
  • Go SDK version: v1.1.1
@maxheckel maxheckel added the bug Something isn't working label Oct 24, 2024
@github-actions github-actions bot added the status:needs-triage An issue that needs to be triaged by the Pinecone team label Oct 24, 2024
@austin-denoble
Copy link
Contributor

Hey @maxheckel, this is an error we've seen in integration tests when attempting to interact with an index before it's in a ready state.

Is the Host value that you're passing with NewIndexConnParams associated with an index that had been created previously and have you upserted vectors to it?

If you have the index name you should be able to use the name to call client.DescribeIndex("YOUR_INDEX_NAME") and then check the response for Status.State or Status.Ready to verify the state of the index.

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