# Cannot read properties of undefined (reading ‘statusCode’) when trying to create an Elasticsearch query rule

**URL:** https://discuss.elastic.co/t/cannot-read-properties-of-undefined-reading-statuscode-when-trying-to-create-an-elasticsearch-query-rule/370061
**Category:** Kibana
**Tags:** detection-rules
**Created:** [November 5, 2024, 10:00am UTC](https://discuss.elastic.co/t/cannot-read-properties-of-undefined-reading-statuscode-when-trying-to-create-an-elasticsearch-query-rule/370061 "2024-11-05T10:00:58Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![x271091-bce\_sangroup](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/x271091-bce_sangroup/32/125903_2.png) [@x271091-bce\_sangroup](https://discuss.elastic.co/u/x271091-bce_sangroup)
#### Post date: [November 5, 2024, 10:00am UTC](https://discuss.elastic.co/t/cannot-read-properties-of-undefined-reading-statuscode-when-trying-to-create-an-elasticsearch-query-rule/370061/1 "2024-11-05T10:00:58Z")

</div>

When I open the Elasticsearch query rule menu, I keep getting the same error:

```auto
**Error fetching fields for data view log-prep-* (ID: 93f9403b-5153-5e38-a9ab-035d84a55566).**

Cannot read undefined properties (reading ‘statusCode’)

```

 ![error_statuscode](https://us1.discourse-cdn.com/elastic/original/3X/7/3/73e2a343250d3adc58233ef1c6704129ef0ae7cd.png)

My Kiana and Elastic version is 8.8.

How can we fix this error? Thank you very much
