# Cryptic error trying to test a PROD-ready query proxy

**URL:** <https://discuss.elastic.co/t/cryptic-error-trying-to-test-a-prod-ready-query-proxy/385029>\
**Category:** Elastic Search\
**Tags:** docker, searchui\
**Created:** [February 12, 2026, 9:45pm UTC](https://discuss.elastic.co/t/cryptic-error-trying-to-test-a-prod-ready-query-proxy/385029 "2026-02-12T21:45:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DaManDOH](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/damandoh/32/146678_2.png) [@DaManDOH](https://discuss.elastic.co/u/DaManDOH)\
**Post date:** [February 12, 2026, 9:45pm UTC](https://discuss.elastic.co/t/cryptic-error-trying-to-test-a-prod-ready-query-proxy/385029/1 "2026-02-12T21:45:29Z")

</div>

Greetings again, Stretchy-lookers!

I’ve run into a problem trying to derive my use case from the following tutorial:

> **[Using UBI in Elasticsearch: Creating an app with UBI & search-ui -...](https://www.elastic.co/search-labs/blog/ubi-elasticsearch-creating-app-search-ui)**
>
> Learn how to use UBI in Elasticsearch through a practical example. We’ll be creating an app with search-ui to collect user behavior data.

_ **Note:** _ I’m not looking to do any User Behavior Insights (UBI), so I’ve trimmed the example down a lot.

The following is the Express-based proxy server I’m using:

```javascript
import express from 'express'
import ElasticsearchAPIConnector from '@elastic/search-ui-elasticsearch-connector'
import 'dotenv/config'
import cors from 'cors'

const app = express()
app.use(express.json())
app.use(cors())

const connector = new ElasticsearchAPIConnector({
  host: process.env.ELASTICSEARCH_HOST,
  index: process.env.ELASTICSEARCH_INDEX,
});

app.post("/api/search", async (req, res) => {
  if (!('state' in req.body) || !('queryConfig' in req.body)) {
    res.status(400).json('{"errorMessage":"Missing parameter(s)"}')
    console.warn('received request w/ missing param(s)')
    return
  }
  const { state, queryConfig } = req.body
  const response = await connector.onSearch(state, queryConfig)
  res.json(response)
});

app.listen(
  process.env.API_PORT,
  () => console.log(`web server listening on port ${process.env.API_PORT}`)
)

```

Meanwhile, the “cluster” I’m using is just a Docker container instantiated by:

```bash
docker run \
   --rm \
   -p 9201:9200 \
   -p 9301:9300 \
   -e "discovery.type=single-node" \
   -e "xpack.security.enabled=false" \
   -e "xpack.security.enrollment.enabled=false" \
   -e "path.repo=/mount/backups" \
   --mount type=bind,source=./es-cluster-backup,target=/mount/backups \
   --mount type=bind,source=./es-data,target=/usr/share/elasticsearch/data \
   docker.elastic.co/elasticsearch/elasticsearch:9.3.0

```

which is populated with the bulk book data from the tutorial I linked above.

And to test:

```bash
curl -v \
-X POST \
--header 'Content-Type: application/json; charset=utf-8' \
--data '{"state":{"current":1,"filters":[],"resultsPerPage":20,"searchTerm":"atwood","sortDirection":"","sortField":"","sortList":[]},"queryConfig":{"disjunctiveFacets":[],"disjunctiveFacetsAnalyticsTags":[],"facets":{},"filters":[],"fuzziness":true,"result_fields":{"author":{"raw":{}},"name":{"raw":{}},"release_date":{"raw":{}}},"search_fields":{"author":{},"name":{}}}}' \
http://localhost:${API_PORT}/api/search

```

But this generates the following error in the Express proxy, causing it to crash:

```auto
TypeError: Cannot read properties of undefined (reading 'total')

```

Any insight would be appreciated.
