# Internal Server Error when trying to search for app\_metadata.tenant\_id

**URL:** <https://community.auth0.com/t/internal-server-error-when-trying-to-search-for-app-metadata-tenant-id/7734>\
**Category:** Get Help\
**Tags:** api, search, bug\
**Created:** [August 3, 2017, 9:03pm UTC](https://community.auth0.com/t/internal-server-error-when-trying-to-search-for-app-metadata-tenant-id/7734 "2017-08-03T21:03:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![marmax](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marmax/32/7848_2.png) [@marmax](https://community.auth0.com/u/marmax)\
**Post date:** [August 3, 2017, 9:03pm UTC](https://community.auth0.com/t/internal-server-error-when-trying-to-search-for-app-metadata-tenant-id/7734/1 "2017-08-03T21:03:14Z")

</div>

I maybe found a bug in the user search API.

I use a app\_metadata\_field to retrieve some users.  
I search by using a lucene query like this : app\_metadata.tenant\_id:“test” but i receive a 500 error

```
 { "statusCode": 500, "error": "Internal Server Error", "message": "An internal server error occurred", "errorCode": "SearchPhaseExecutionException[Failed to execute phase [query_fetch], all shards failed; shardFailures {[B03gidRzQsSNhopxzxvb8A][users][0]: RemoteTransportException[production-user-data-es-i-02c4205da47ca3064-eu-central-1][inet[/172.29.48.227:9300]][indices:data/read/search[phase/query+fetch]]]; nested: SearchParseException[users][0]: from[0],size[50]: Parse Failure [Failed to parse source [{\"size\":50,\"from\":0,\"timeout\":\"5s\",\"query\":{\"query_string\":{\"query\":\"__meta.maxlab_app_metadata.tenant_id:\\\"test\\\"\"}},\"sort\":[{\"last_login\":{\"order\":\"desc\",\"missing\":0}}]}]]]; nested: NumberFormatException[For input string: \"test\"]; }]" } 

```

However when I try with a field named, for example t\_id. It’s working ( q:app\_metadata.t\_id:“test” )

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [August 4, 2017, 7:40pm UTC](https://community.auth0.com/t/internal-server-error-when-trying-to-search-for-app-metadata-tenant-id/7734/2 "2017-08-04T19:40:34Z")

</div>

There was an incident (already addressed) reported yesterday that caused some search queries to fail (see more about this [here](https://status.auth0.com/incidents/04g4bmj8fsq1)). This may or may not explain your situation, but given a relatively close timeline between the question creation and the incident can you confirm if you’re still experiencing the issue?

As additional note, on my own account I was not able to reproduce the situation, but I may have failed to follow the exact same steps that lead to your situation. If you can also share any additional information that helps reproduce this it will be great.

---

<div class="post-metadata">

**Author:** ![marmax](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marmax/32/7848_2.png) [@marmax](https://community.auth0.com/u/marmax)\
**Post date:** [August 4, 2017, 7:55pm UTC](https://community.auth0.com/t/internal-server-error-when-trying-to-search-for-app-metadata-tenant-id/7734/3 "2017-08-04T19:55:46Z")

</div>

Thanks for your answer. I rewrite my API in order to use t\_id key. It’s working.

I tried at the moment on the auth0 dashboard ([https://manage.auth0.com/#/users](https://manage.auth0.com/#/users)) \> Search by lucene syntax

When i try : _app\_metadata.t\_id:test_ it’s ok and I get my users but if i search for _app\_metadata.tenant\_id:test_ i still get the Network error ( i guess i should get only an empty result )

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 2, 2018, 5:55am UTC](https://community.auth0.com/t/internal-server-error-when-trying-to-search-for-app-metadata-tenant-id/7734/4 "2018-03-02T05:55:44Z")

</div>


