Skip to content

[Bug] Cannot list vectors, getting missing HTTP content-type error #87

@maxheckel

Description

@maxheckel

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstatus:needs-triageAn issue that needs to be triaged by the Pinecone team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions