Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

[Bug] Failed to create index #335

Open
2 tasks done
mithridatic opened this issue Apr 23, 2024 · 2 comments
Open
2 tasks done

[Bug] Failed to create index #335

mithridatic opened this issue Apr 23, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@mithridatic
Copy link

Is this a new bug?

  • I believe this is a new bug
  • I have searched the existing issues, and I could not find an existing issue for this 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

@mithridatic mithridatic added the bug Something isn't working label Apr 23, 2024
@cvansteenburg
Copy link

cvansteenburg commented May 22, 2024

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
Copy link

@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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants