pinecone-io / canopy

Retrieval Augmented Generation (RAG) framework and context engine powered by Pinecone
https://www.pinecone.io/
Apache License 2.0
961 stars 119 forks source link

[Bug] Failed to create index #335

Open mithridatic opened 5 months ago

mithridatic commented 5 months ago

Is this a new bug?

Current Behavior

I setup canopy. I get an error at 'canopy new'. The reason is because it tries to create a server somewhere besides my region, and to upgrade my plan. The guide on the github page says Starter Plan works for this; I don't understand.

Expected Behavior

A canopy enabled index would be created.

Steps To Reproduce

  1. In Windows command prompt
  2. create a virtual environment with anaconda
  3. Follow the steps for setup: https://github.com/pinecone-io/canopy
  4. Fail at 'canopy new'

Relevant log output

Error: Failed to create a new index. Reason:
Failed to create index canopy--test due to error: {"error":{"code":"INVALID_ARGUMENT","message":"Bad request: Your free plan does not support indexes in the us-west-2 region of aws. To create indexes in this region, upgrade your plan."},"status":400}

Environment

- **OS**: Windows 11 64-Bit
- **Language version**: Python 3.11
- **Canopy version**: 0.9.0

Additional Context

No response

cvansteenburg commented 4 months ago

I suspect Pinecone uses AWS for storage, and aws-west is not free. It seems that aws-east is.

This solved the error for me:

  1. Find the config.yaml in canopy/config_templates/ (this may be in your virtual environment folder, depending on your setup)
  2. Copy this file. Rename and store wherever it suits your project setup
  3. Find region: us-west-2 and set the value to us-east-1
  4. From the terminal, type export CANOPY_CONFIG_FILE="path/to/your/config.yaml". This adds your config file as an environment variable. Now when you do canopy new, canopy will detect the config file.

Root cause I see the default spec in kb.create_canopy_index specifies "us-west-2":

class KnowledgeBase(BaseKnowledgeBase):
    def create_canopy_index(self,
                            spec: Union[Dict, ServerlessSpec, PodSpec] = None,
                            metric: Optional[str] = "cosine"
                            ):

        if spec is None:
            spec = ServerlessSpec(
                cloud="aws",
                region="us-west-2"
            )
cvansteenburg commented 4 months ago

@izellevy do you know why us-west was originally chosen? Would you accept a PR that wires this region to us-east-1? Happy to contribute.