PineconeNotFoundError when using local docker instance

Using the configuration found here, namely:

pinecone:
    image: ghcr.io/pinecone-io/pinecone-index:latest
    environment:
      PORT: 5080
      INDEX_TYPE: serverless
      VECTOR_TYPE: dense
      DIMENSION: 2 
      METRIC: cosine
    ports:
      - "5080:5080"
    platform: linux/amd64

And instantiating a client, as described here, like so:

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

const client = new Pinecone({
  apiKey: "<anything-does-not-matter>",
  controllerHostUrl: "http://localhost:5080",
});

If I try, for example, to list the indexes:

const indexes = await client.listIndexes();

console.log('Pinecone indexes:', indexes);

I get the following error:

"A call to http://localhost:5080/indexes returned HTTP status 404.",

The container does seem to be running correctly:

[INFO] - Emulating a Pinecone serverless index with dimension 2 and metric cosine on port 5080

And the port bindings do seem to be correct also:

"PortBindings": {
  "5088/tcp": [
    {
      "HostIp": "",
      "HostPort": "5080"
    }
  ]
},

Any ideas what is going wrong?

Hi @lee2 - Thanks for posting your question!

When using the pinecone-index image, you are starting up with an index already created. In this case, the APIs to manage indexes are not exposed, only those to interact with an index. listIndexes is one of those APIs that’s not available.

If you want to be able to manage indexes, which includes listIndexes, I would suggest using the pinecone-local image instead as documented here. Then you would have to create/upsert to indexes as shown in the code example there.

docker-compose.yaml:

services:
  pinecone:
    image: ghcr.io/pinecone-io/pinecone-local:latest
    environment: 
      PORT: 5080
      PINECONE_HOST: localhost
    ports: 
      - "5080-5090:5080-5090"
    platform: linux/amd64

It’s not entirely clear in our docs that it works this way, so I have passed this info along and we’ll get it updated there as well.

Hi @jenna, I did end up moving back to the pinecone-local docker image, however now I am getting a similar error that /vectors/<verb> endpoints are giving back 404 when trying to delete and upload documents via langchain (upserting vectors).

Hi @lee2 -

Can you share the exact error, your updated docker config (unless it’s exactly as above), and some code snippets of what you’re trying to do?

It might be worth trying curl or the Pinecone SDK directly to determine if it’s a config issue or with code.