Pinecone Java client throwing error `io.pinecone.exceptions.PineconeException: Unable to extract pinecone client version`

Hi there,

I’m a Pinecone Java user that just upgraded to version 0.7.1 of the Pinecone Java client.

Unfortunately, my Java code now throws the error:

io.pinecone.exceptions.PineconeException: Unable to extract pinecone client version

I traced this down a bit and it looks like the root cause is from PineconeClientConfig.java, with this method:

public String getUserAgent() {
        Properties properties = new Properties();
        String userAgentLanguage = "lang=java";
        String version = (this.getUsageContext() != null) ?
                userAgentLanguage + "; usageContext=" + this.getUsageContext()
                : userAgentLanguage;

        try (FileInputStream input = new FileInputStream("gradle.properties")) {
            properties.load(input);
            version = properties.getProperty("pineconeClientVersion") + "; " + version;
        } catch (IOException e) {
            throw new PineconeException("Unable to extract pinecone client version");
        }
        return version;
    }

Is there a way to get around this issue?

Thanks!

How did you fix this issue ?

I had to downgrade to version 0.6.0

I downgraded . But received the error
Exception in thread “main” io.grpc.StatusRuntimeException: INVALID_ARGUMENT: The ‘queries’ parameter has been deprecated.
at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:268)
at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:249)
at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:167)
at io.pinecone.proto.VectorServiceGrpc$VectorServiceBlockingStub.query(VectorServiceGrpc.java:513)
at org.example.PineConeConnector.main(PineConeConnector.java:88)

My code ,

try (PineconeConnection connection = pineconeClient.connect(connectionConfig)) {
Vector v1 = Vector.newBuilder()
.setId(“v1”)
.addAllValues(Floats.asList(1F, 3F, 5F))
.build();

        Vector v2 = Vector.newBuilder()
                .setId("v2")
                .addAllValues(Floats.asList(5F, 3F, 1F))
                .build();

        // Deprecated: use addValue() or addAllValues() instead of addVector() and addAllVectors() respectively
        UpsertRequest upsertRequest = UpsertRequest.newBuilder()
                .addVectors(v1)
                .addVectors(v2)
                .setNamespace(args.namespace)
                .build();

        System.out.println("Sending upsert request:");
        System.out.println(upsertRequest);

        UpsertResponse upsertResponse = connection.getBlockingStub().upsert(upsertRequest);

        System.out.println("Got upsert response:");
        System.out.println(upsertResponse);


        QueryVector queryVector = QueryVector
                .newBuilder()
                .addAllValues(Floats.asList(1F, 2F, 2F))
                .setTopK(args.topK)
                .setNamespace(args.namespace)
                .build();

        QueryRequest queryRequest = QueryRequest
                .newBuilder()
                .addQueries(queryVector)
                .setTopK(args.topK)
                .build();

        System.out.println("Sending query request:");
        System.out.println(queryRequest);

        QueryResponse queryResponse = connection.getBlockingStub().query(queryRequest);

        System.out.println("Got query response:");
        System.out.println(queryResponse);
    } catch (PineconeException e) {
        e.printStackTrace();
    }

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.

@shyamu.in if you haven’t already I suggest upgrading to the latest version, 0.7.2. It resolves both of these issues.