# Null id Agent Policy

**URL:** <https://discuss.elastic.co/t/null-id-agent-policy/303837>\
**Category:** Kibana\
**Tags:** fleet\
**Created:** [May 3, 2022, 1:17pm UTC](https://discuss.elastic.co/t/null-id-agent-policy/303837 "2022-05-03T13:17:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Leandre](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandre/32/78183_2.png) [@Leandre](https://discuss.elastic.co/u/Leandre)\
**Post date:** [May 3, 2022, 1:17pm UTC](https://discuss.elastic.co/t/null-id-agent-policy/303837/1 "2022-05-03T13:17:43Z")

</div>

Using the fleet API, I created a new Agent Policy. But by accident, I provided the ID for the new Policy : "null". Now when I try to view my policies using the UI or the API, I get this :

```auto
{"statusCode":500,
"error":"Internal Server Error",
"message":"x_content_parse_exception: [parsing_exception] Reason: No text specified for text query"}

```

I suppose that the reason is that the request considers the null value as a missing text or no text at all. So I can only access a Policy using his ID that I saved before the bug.

When I tried to delete this null Policy (by using the UI settings or the API delete), the same error appeared. I'm now stuck, I can't see wich Agent Policy is on my deployement, I can't delete or edit the ID of this null Policy. Any clues on what I can try ?

---

<div class="post-metadata">

**Author:** ![Leandre](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandre/32/78183_2.png) [@Leandre](https://discuss.elastic.co/u/Leandre)\
**Post date:** [May 4, 2022, 9:42am UTC](https://discuss.elastic.co/t/null-id-agent-policy/303837/2 "2022-05-04T09:42:01Z")

</div>

Update : I found a workaround to list all my Agent Policies. That doesn't fix the problem but that's better than nothing. When doing my query with the API, I add

```auto
'?kuery=ingest-agent-policies.name:%20(not%20Test%20Null)

```

Test Null is the name of my glitchy policy.

---

<div class="post-metadata">

**Author:** ![Leandre](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandre/32/78183_2.png) [@Leandre](https://discuss.elastic.co/u/Leandre)\
**Post date:** [May 17, 2022, 8:30am UTC](https://discuss.elastic.co/t/null-id-agent-policy/303837/3 "2022-05-17T08:30:38Z")

</div>

If you want the solution, here it is : [https://github.com/elastic/kibana/issues/131764](https://github.com/elastic/kibana/issues/131764)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 14, 2022, 8:31am UTC](https://discuss.elastic.co/t/null-id-agent-policy/303837/4 "2022-06-14T08:31:14Z")

</div>

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