# Getting gRPC unknown error when trying to delete all vectors using namespace

**URL:** <https://community.pinecone.io/t/getting-grpc-unknown-error-when-trying-to-delete-all-vectors-using-namespace/6100>\
**Category:** Support\
**Tags:** vector-database\
**Created:** [July 10, 2024, 9:36am UTC](https://community.pinecone.io/t/getting-grpc-unknown-error-when-trying-to-delete-all-vectors-using-namespace/6100 "2024-07-10T09:36:30Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![steven](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/steven/32/1097_2.png) [@steven](https://community.pinecone.io/u/steven)\
**Post date:** [July 10, 2024, 9:36am UTC](https://community.pinecone.io/t/getting-grpc-unknown-error-when-trying-to-delete-all-vectors-using-namespace/6100/1 "2024-07-10T09:36:30Z")

</div>

I’m running this code:

```auto
index.delete(namespace=NAMESPACE, delete_all=True)

```

and am getting this error:

```auto
*** pinecone.core.client.exceptions.PineconeException: UNKNOWN:Error received from peer {grpc_message:"No explicit ids expected when delete_all=true", grpc_status:3, created_time:"202"}

```

I’m not providing any vector IDs though, just the namespace as is specified in the docs.

---

<div class="post-metadata">

**Author:** ![ZacharyProser](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/zacharyproser/32/1146_2.png) [@ZacharyProser](https://community.pinecone.io/u/ZacharyProser)\
**Post date:** [July 10, 2024, 6:17pm UTC](https://community.pinecone.io/t/getting-grpc-unknown-error-when-trying-to-delete-all-vectors-using-namespace/6100/2 "2024-07-10T18:17:19Z")

</div>

Hi @steven and welcome to the Pinecone community forums!

Thank you for your question.

Could you please share all your relevant code, being careful not to include secrets like your Pinecone API key, including where you installed the Pinecone library?

Which version are you currently running?

Best,  
Zack

---

<div class="post-metadata">

**Author:** ![steven](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/steven/32/1097_2.png) [@steven](https://community.pinecone.io/u/steven)\
**Post date:** [July 11, 2024, 2:01am UTC](https://community.pinecone.io/t/getting-grpc-unknown-error-when-trying-to-delete-all-vectors-using-namespace/6100/3 "2024-07-11T02:01:46Z")

</div>

The code flow that I’m currently using first uses random vectors to query the index and retrieve all vectors for each namespace in the index (I can’t use `index.list` because it’s not serverless). I’m essentially using a dictionary that looks like `{namespace: {vectors}}`.

The code for deletion looks like this:

```auto
for namespace in namespace2vectors:
    index.delete(namespace=namespace, delete_all=True)

```

Note, when I change to code to provide the actual vector IDs the deletion happens properly:

```auto
for namespace, vectors in namespace2vectors.items():
    ids = list(vectors)
    index.delete(ids=ids, namespace=namespace)

```

* * *

I’m currently using a Poetry environment to manage my packages. The relevant packages are as follows:

```auto
[tool.poetry.dependencies]
python = "^3.10"
numpy = "^1.26.2"
tqdm = "^4.66.1"
requests = "^2.31.0"
google = "^3.0.0"
openai = "^1.3.5"
tiktoken = "^0.5.2"
tritonclient = {extras = ["grpc"], version = "^2.46.0"}
prometheus-fastapi-instrumentator = "^7.0.0"
prometheus-client = "^0.20.0"
grpcio = "^1.64.1"
pinecone-client = {extras = ["grpc"], version = "^4.1.1"}
python-dotenv = "^1.0.1"
google-api-python-client = "^2.133.0"

[tool.poetry.group.dev]
optional = true

[tool.poetry.group.dev.dependencies]
grpcio = "^1.60.1"
pymongo = "^4.6.1"

```

---

<div class="post-metadata">

**Author:** ![zeke](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/zeke/32/4257_2.png) [@zeke](https://community.pinecone.io/u/zeke)\
**Post date:** [July 12, 2024, 4:23pm UTC](https://community.pinecone.io/t/getting-grpc-unknown-error-when-trying-to-delete-all-vectors-using-namespace/6100/4 "2024-07-12T16:23:26Z")

</div>

@steven Thanks for sharing the code. Please log the value of `namespace` inside the `for` loop in the code in question and share the result. For example:

```auto
for namespace in namespace2vectors:
    print(namespace)
    index.delete(namespace=namespace, delete_all=True)

```

---

<div class="post-metadata">

**Author:** ![steven](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/steven/32/1097_2.png) [@steven](https://community.pinecone.io/u/steven)\
**Post date:** [July 15, 2024, 12:02am UTC](https://community.pinecone.io/t/getting-grpc-unknown-error-when-trying-to-delete-all-vectors-using-namespace/6100/5 "2024-07-15T00:02:02Z")

</div>

`namespace` is a string that refers to each namespace inside of the index.

---

<div class="post-metadata">

**Author:** ![zeke](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/zeke/32/4257_2.png) [@zeke](https://community.pinecone.io/u/zeke)\
**Post date:** [July 15, 2024, 1:09pm UTC](https://community.pinecone.io/t/getting-grpc-unknown-error-when-trying-to-delete-all-vectors-using-namespace/6100/6 "2024-07-15T13:09:27Z")

</div>

@steven, yes, that’s understood. To debug the issue, I hope to see the values of `namespace` that get extracted from `namespace2vectors`, or just the complete `namespace2vectors` object.

If you do not feel comfortable sharing the `namespace2vectors` with the actual names, you can omit the details. I am curious to see the structure of the stored object. We likely need to improve our error messaging in some fashion, but I first want to determine the root cause of the behavior.

---

<div class="post-metadata">

**Author:** ![steven](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/steven/32/1097_2.png) [@steven](https://community.pinecone.io/u/steven)\
**Post date:** [July 15, 2024, 2:23pm UTC](https://community.pinecone.io/t/getting-grpc-unknown-error-when-trying-to-delete-all-vectors-using-namespace/6100/7 "2024-07-15T14:23:36Z")

</div>

Ah, understood.

`namespace2vectors` looks something like this:

```Plain
{
    "namespace1": {
            "vector1": {
                "values": [float],
                "metadata": {
                    "text": str,
                    "lang": str,
                    "model_version": str,
                    "id": str,
                    "type": str,
                 },
    }
}

```

Each vector is itself a mapping from a unique string ID to a dictionary consisting of the two keys `"values"` and `"metadata"`, and each `namepace` has many of these vectors. The values are lists of floating point numbers.

---

<div class="post-metadata">

**Author:** ![zeke](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/zeke/32/4257_2.png) [@zeke](https://community.pinecone.io/u/zeke)\
**Post date:** [July 15, 2024, 6:16pm UTC](https://community.pinecone.io/t/getting-grpc-unknown-error-when-trying-to-delete-all-vectors-using-namespace/6100/9 "2024-07-15T18:16:04Z")

</div>

Thanks, @steven. I’ve just spent some time testing the below code with `namespace2vectors` set to a dictionary of the object structure you specified and have not been able to reproduce the issue.

```auto
for namespace in namespace2vectors:
    print(namespace)
    index.delete(namespace=namespace, delete_all=True)

```

For reference, here is the original error statement you shared:

```auto
*** pinecone.core.client.exceptions.PineconeException: UNKNOWN:Error received from peer {grpc_message:"No explicit ids expected when delete_all=true", grpc_status:3, created_time:"202"}

```

If you can still reproduce this error consistently, please insert the `print` statement as shown in the above code and share the output, along with the name of the index on which you perform these actions.
