# Use dev tools get "internal server error" 500 error

**URL:** <https://forum.opensearch.org/t/use-dev-tools-get-internal-server-error-500-error/23015>\
**Category:** OpenSearch Dashboards\
**Tags:** troubleshoot\
**Created:** [January 7, 2025, 8:05am UTC](https://forum.opensearch.org/t/use-dev-tools-get-internal-server-error-500-error/23015 "2025-01-07T08:05:41Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![pkingqaq](https://avatars.discourse-cdn.com/v4/letter/p/f07891/32.png) [@pkingqaq](https://forum.opensearch.org/u/pkingqaq)\
**Post date:** [January 7, 2025, 8:05am UTC](https://forum.opensearch.org/t/use-dev-tools-get-internal-server-error-500-error/23015/1 "2025-01-07T08:05:41Z")

</div>

**Versions** (relevant - OpenSearch/Dashboard/Server OS/Browser):  
opensearch 2.11.1  
opensearch dashboard 2.11.0

**Describe the issue** :  
when we use dev tools to exec some api and get “internal server error” with error code 500, but when we try to use some admin user to curl opensearch api in terminal, it make sense.

it looks like that internal user and role of dashboard dev tools have changed, but can I get some help to dive into?

This is a recent issue. Previously, the dev tools were functioning normally  
**Configuration** :

**Relevant Logs or Screenshots** :  
use api

 ![image](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/a/a1b3e188867d1bfb593a9f22d0d2000d56196e4f.png)

dev tool

 ![image](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/9/9af2d212e8987977fc6b5f072ef95f4869f8ac8c.png)

---

<div class="post-metadata">

**Author:** ![cwperks](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/cwperks/32/4968_2.png) [@cwperks](https://forum.opensearch.org/u/cwperks)\
**Post date:** [January 7, 2025, 9:27pm UTC](https://forum.opensearch.org/t/use-dev-tools-get-internal-server-error-500-error/23015/2 "2025-01-07T21:27:02Z")

</div>

I noticed that your OpenSearch and OSD are of different versions (OS 2.11 vs. OSD 2.13 repsectively). Does the error resolve if you run the same version for each?

---

<div class="post-metadata">

**Author:** ![pkingqaq](https://avatars.discourse-cdn.com/v4/letter/p/f07891/32.png) [@pkingqaq](https://forum.opensearch.org/u/pkingqaq)\
**Post date:** [January 13, 2025, 2:29am UTC](https://forum.opensearch.org/t/use-dev-tools-get-internal-server-error-500-error/23015/3 "2025-01-13T02:29:08Z")

</div>

Sry, I checked our config again, and version is  
OSD 2.11.0  
OS 2.11.1  
So maybe it will not be the problem?

---

<div class="post-metadata">

**Author:** ![pkingqaq](https://avatars.discourse-cdn.com/v4/letter/p/f07891/32.png) [@pkingqaq](https://forum.opensearch.org/u/pkingqaq)\
**Post date:** [January 13, 2025, 2:33am UTC](https://forum.opensearch.org/t/use-dev-tools-get-internal-server-error-500-error/23015/4 "2025-01-13T02:33:56Z")

</div>

> <https://github.com/elastic/kibana/issues/103679>
>
> \*\*Kibana version:7.13.1\*\*
> 
> \*\*Elasticsearch version:7.13.1\*\*
> 
> \*\*Server OS ver…sion:\*\*
> Using defualt kibana docker image dictated by the helm chart
> https://github.com/elastic/helm-charts/tree/master/kibana
> 
> \*\*Browser version: Firefox 89.0.2 (64-bit)\*\*
> 
> \*\*Browser OS version:Windows 10 Pro 19042.1052\*\*
> 
> \*\*Original install method (e.g. download page, yum, from source, etc.):\*\*
> https://github.com/elastic/helm-charts/tree/master/kibana
> https://github.com/elastic/helm-charts/blob/master/elasticsearch
> 
> 
> \*\*Describe the bug:\*\*
> From within kibana -\>Dev tools -\> Console
> When you do any command (such as 'GET /\_health') it returns a '500 internal error'. When doing this directly to elasticsearch, it works as intended. 
> 
> \*\*Steps to reproduce:\*\*
> 1. Go into kibana
> 2. Dev Tools -\> Console
> 3. GET /\_health
> 
> \*\*Expected behavior:\*\*
> Returns health of the cluster
> 
> \*\*Screenshots (if relevant):\*\*
> !\[image\](https://user-images.githubusercontent.com/29199726/123817651-55d3cc00-d8c6-11eb-8746-cdbbfbbf03cc.png)
> 
> \*\*Errors in browser console (if relevant):\*\*
> 
> \*\*Provide logs and/or server output (if relevant):\*\*
> Here are the logs from kibana when the call is made:
> \`\`\`
> {"type":"response","@timestamp":"2021-06-29T14:27:23+00:00","tags":\[\],"pid":951,"method":"get","statusCode":200,"req":{"url":"/api/console/es\_config","method":"get","headers":{"host":"kibana-dev.test.com","x-request-id":"bdf76e6f7080de308b2510e5f1b715a6","x-real-ip":"10.x.x.x","x-forwarded-for":"10.x.x.x","x-forwarded-proto":"https","x-forwarded-host":"kibana-dev.test.com","x-forwarded-port":"443","x-scheme":"https","x-original-forwarded-for":"10.x.x.x","user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0","accept":"\*/\*","accept-language":"en-US,en;q=0.5","accept-encoding":"gzip, deflate, br","referer":"https://kibana-dev.test.com/app/dev\_tools","content-type":"application/json","kbn-version":"7.13.1"},"remoteAddress":"10.42.64.0","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0","referer":"https://kibana-dev.test.com/app/dev\_tools"},"res":{"statusCode":200,"responseTime":2,"contentLength":51},"message":"GET /api/console/es\_config 200 2ms - 51.0B"}
> 
> {"type":"log","@timestamp":"2021-06-29T14:27:23+00:00","tags":\["error","http"\],"pid":951,"message":"Error: expected 'location' header to be set
> at HapiResponseAdapter.toRedirect (/usr/share/kibana/src/core/server/http/router/response\_adapter.js:104:13)
> at HapiResponseAdapter.toHapiResponse (/usr/share/kibana/src/core/server/http/router/response\_adapter.js:86:19)
> at HapiResponseAdapter.handle (/usr/share/kibana/src/core/server/http/router/response\_adapter.js:73:17)
> at Router.handle (/usr/share/kibana/src/core/server/http/router/router.js:164:34)
> at runMicrotasks (\<anonymous\>)
> at processTicksAndRejections (internal/process/task\_queues.js:93:5)
> at handler (/usr/share/kibana/src/core/server/http/router/router.js:124:50)
> at exports.Manager.execute (/usr/share/kibana/node\_modules/@hapi/hapi/lib/toolkit.js:60:28)
> at Object.internals.handler (/usr/share/kibana/node\_modules/@hapi/hapi/lib/handler.js:46:20)
> at exports.execute (/usr/share/kibana/node\_modules/@hapi/hapi/lib/handler.js:31:20)
> at Request.\_lifecycle (/usr/share/kibana/node\_modules/@hapi/hapi/lib/request.js:370:32)
> at Request.\_execute (/usr/share/kibana/node\_modules/@hapi/hapi/lib/request.js:279:9)"}
> 
> {"type":"log","@timestamp":"2021-06-29T14:27:23+00:00","tags":\["error","http"\],"pid":951,"message":"Error: expected 'location' header to be set
> at HapiResponseAdapter.toRedirect (/usr/share/kibana/src/core/server/http/router/response\_adapter.js:104:13)
> at HapiResponseAdapter.toHapiResponse (/usr/share/kibana/src/core/server/http/router/response\_adapter.js:86:19)
> at HapiResponseAdapter.handle (/usr/share/kibana/src/core/server/http/router/response\_adapter.js:73:17)
> at Router.handle (/usr/share/kibana/src/core/server/http/router/router.js:164:34)
> at runMicrotasks (\<anonymous\>)
> at processTicksAndRejections (internal/process/task\_queues.js:93:5)
> at handler (/usr/share/kibana/src/core/server/http/router/router.js:124:50)
> at exports.Manager.execute (/usr/share/kibana/node\_modules/@hapi/hapi/lib/toolkit.js:60:28)
> at Object.internals.handler (/usr/share/kibana/node\_modules/@hapi/hapi/lib/handler.js:46:20)
> at exports.execute (/usr/share/kibana/node\_modules/@hapi/hapi/lib/handler.js:31:20)
> at Request.\_lifecycle (/usr/share/kibana/node\_modules/@hapi/hapi/lib/request.js:370:32)
> at Request.\_execute (/usr/share/kibana/node\_modules/@hapi/hapi/lib/request.js:279:9)"}
> 
> {"type":"error","@timestamp":"2021-06-29T14:27:23+00:00","tags":\[\],"pid":951,"level":"error","error":{"message":"Internal Server Error","name":"Error","stack":"Error: Internal Server Error
> at HapiResponseAdapter.toInternalError (/usr/share/kibana/src/core/server/http/router/response\_adapter.js:61:19)
> at Router.handle (/usr/share/kibana/src/core/server/http/router/router.js:177:34)
> at runMicrotasks (\<anonymous\>)
> at processTicksAndRejections (internal/process/task\_queues.js:93:5)
> at handler (/usr/share/kibana/src/core/server/http/router/router.js:124:50)
> at exports.Manager.execute (/usr/share/kibana/node\_modules/@hapi/hapi/lib/toolkit.js:60:28)
> at Object.internals.handler (/usr/share/kibana/node\_modules/@hapi/hapi/lib/handler.js:46:20)
> at exports.execute (/usr/share/kibana/node\_modules/@hapi/hapi/lib/handler.js:31:20)
> at Request.\_lifecycle (/usr/share/kibana/node\_modules/@hapi/hapi/lib/request.js:370:32)
> at Request.\_execute (/usr/share/kibana/node\_modules/@hapi/hapi/lib/request.js:279:9)"},"url":"http://kibana-dev.test.com/api/console/proxy?path=\_aliases&method=GET","message":"Internal Server Error"}
> 
> {"type":"response","@timestamp":"2021-06-29T14:27:23+00:00","tags":\["access:console"\],"pid":951,"method":"post","statusCode":500,"req":{"url":"/api/console/proxy?path=\_aliases&method=GET","method":"post","headers":{"host":"kibana-dev.test.com","x-request-id":"7e4bb92469ccb73ea9f4307489395f04","x-real-ip":"10.x.x.x","x-forwarded-for":"10.x.x.x","x-forwarded-proto":"https","x-forwarded-host":"kibana-dev.test.com","x-forwarded-port":"443","x-scheme":"https","x-original-forwarded-for":"10.x.x.x","content-length":"0","user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0","accept":"text/plain, \*/\*; q=0.01","accept-language":"en-US,en;q=0.5","accept-encoding":"gzip, deflate, br","referer":"https://kibana-dev.test.com/app/dev\_tools","kbn-xsrf":"kibana","origin":"https://kibana-dev.test.com"},"remoteAddress":"10.42.17.0","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0","referer":"https://kibana-dev.test.com/app/dev\_tools"},"res":{"statusCode":500,"responseTime":144,"contentLength":97},"message":"POST /api/console/proxy?path=\_aliases&method=GET 500 144ms - 97.0B"}
> 
> {"type":"error","@timestamp":"2021-06-29T14:27:23+00:00","tags":\[\],"pid":951,"level":"error","error":{"message":"Internal Server Error","name":"Error","stack":"Error: Internal Server Error
> at HapiResponseAdapter.toInternalError (/usr/share/kibana/src/core/server/http/router/response\_adapter.js:61:19)
> at Router.handle (/usr/share/kibana/src/core/server/http/router/router.js:177:34)
> at runMicrotasks (\<anonymous\>)
> at processTicksAndRejections (internal/process/task\_queues.js:93:5)
> at handler (/usr/share/kibana/src/core/server/http/router/router.js:124:50)
> at exports.Manager.execute (/usr/share/kibana/node\_modules/@hapi/hapi/lib/toolkit.js:60:28)
> at Object.internals.handler (/usr/share/kibana/node\_modules/@hapi/hapi/lib/handler.js:46:20)
> at exports.execute (/usr/share/kibana/node\_modules/@hapi/hapi/lib/handler.js:31:20)
> at Request.\_lifecycle (/usr/share/kibana/node\_modules/@hapi/hapi/lib/request.js:370:32)
> at Request.\_execute (/usr/share/kibana/node\_modules/@hapi/hapi/lib/request.js:279:9)"},"url":"http://kibana-dev.test.com/api/console/proxy?path=\_template&method=GET","message":"Internal Server Error"}
> 
> {"type":"response","@timestamp":"2021-06-29T14:27:23+00:00","tags":\["access:console"\],"pid":951,"method":"post","statusCode":500,"req":{"url":"/api/console/proxy?path=\_template&method=GET","method":"post","headers":{"host":"kibana-dev.test.com","x-request-id":"8d5cc2e5a4ec7b088e43686316f6ccc3","x-real-ip":"10.x.x.x","x-forwarded-for":"10.x.x.x","x-forwarded-proto":"https","x-forwarded-host":"kibana-dev.test.com","x-forwarded-port":"443","x-scheme":"https","x-original-forwarded-for":"10.x.x.x","content-length":"0","user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0","accept":"text/plain, \*/\*; q=0.01","accept-language":"en-US,en;q=0.5","accept-encoding":"gzip, deflate, br","referer":"https://kibana-dev.test.com/app/dev\_tools","kbn-xsrf":"kibana","origin":"https://kibana-dev.test.com"},"remoteAddress":"10.42.19.0","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0","referer":"https://kibana-dev.test.com/app/dev\_tools"},"res":{"statusCode":500,"responseTime":137,"contentLength":97},"message":"POST /api/console/proxy?path=\_template&method=GET 500 137ms - 97.0B"}
> \`\`\`
> \*\*Any additional context:\*\*
> Kibana and elasticsearch are both in kubernetes and can talk to each other fine. It's just this particular feature with kibana giving issues

> **[Error: expected 'location' header to be set](https://discuss.elastic.co/t/error-expected-location-header-to-be-set/248025/3)**
>
> It can be caused by clicking one of my search on Kibana screen. For example, running the GET / can cause the error.

I found some related issue and it looks like it is the frontend problem, However, since this is a production environment, I cannot modify the frontend code.

Is there any other way to fix this issue?

---

<div class="post-metadata">

**Author:** ![pablo](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/pablo/32/10363_2.png) [@pablo](https://forum.opensearch.org/u/pablo)\
**Post date:** [January 21, 2025, 5:04pm UTC](https://forum.opensearch.org/t/use-dev-tools-get-internal-server-error-500-error/23015/5 "2025-01-21T17:04:46Z")

</div>

@pkingqaq Did you resolve your issue?

---

<div class="post-metadata">

**Author:** ![pkingqaq](https://avatars.discourse-cdn.com/v4/letter/p/f07891/32.png) [@pkingqaq](https://forum.opensearch.org/u/pkingqaq)\
**Post date:** [January 22, 2025, 3:38pm UTC](https://forum.opensearch.org/t/use-dev-tools-get-internal-server-error-500-error/23015/6 "2025-01-22T15:38:14Z")

</div>

Actually not, now we can use some api tools like Postman to workaround  
It seems usable, but it’s still not as convenient as “dev tools”.

---

<div class="post-metadata">

**Author:** ![pablo](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/pablo/32/10363_2.png) [@pablo](https://forum.opensearch.org/u/pablo)\
**Post date:** [January 23, 2025, 1:01am UTC](https://forum.opensearch.org/t/use-dev-tools-get-internal-server-error-500-error/23015/7 "2025-01-23T01:01:31Z")

</div>

@pkingqaq Could you share your opensearch\_dashboards.yml and config.yml files?  
Does it happen for admin user too?

Do you see any errors in OpenSearch Dashboards logs?

Did you test different browsers and private mode? Do you use any mod header in your browsers?

Does it fail for any API?

You shouldn’t assign admin permission to kibanaserver user. This is only a service account that should have only kibana\_server role assigned.

```auto
root@docker4:/home/pablo# curl --insecure -u kibanaserver:kibanaserver https://localhost:9200/_plugins/_security/authinfo?pretty
{
  "user" : "User [name=kibanaserver, backend_roles=[], requestedTenant=null]",
  "user_name" : "kibanaserver",
  "user_requested_tenant" : null,
  "remote_address" : "172.18.0.1:49174",
  "backend_roles" : [],
  "custom_attribute_names" : [],
  "roles" : [
    "own_index",
    "kibana_server"
  ],
  "tenants" : {
    "kibanaserver" : true
  },
  "principal" : null,
  "peer_certificates" : "0",
  "sso_logout_url" : null
}

```

---

<div class="post-metadata">

**Author:** ![pkingqaq](https://avatars.discourse-cdn.com/v4/letter/p/f07891/32.png) [@pkingqaq](https://forum.opensearch.org/u/pkingqaq)\
**Post date:** [February 6, 2025, 7:56am UTC](https://forum.opensearch.org/t/use-dev-tools-get-internal-server-error-500-error/23015/8 "2025-02-06T07:56:44Z")

</div>

Each time I call the API via Dev Tools, I always receive error messages such as the ones shown below.

```auto
{
    "type": "error",
    "@timestamp": "2025-01-06T06:18:06Z",
    "tags":
    [],
    "pid": 1,
    "level": "error",
    "error":
    {
        "message": "Internal Server Error",
        "name": "Error",
        "stack": "Error: Internal Server Error\n at HapiResponseAdapter.toInternalError (/usr/share/opensearch-dashboards/src/core/server/http/router/response_adapter.js:80:19)\n at Router.handle (/usr/share/opensearch-dashboards/src/core/server/http/router/router.js:177:34)\n at processTicksAndRejections (node:internal/process/task_queues:95:5)\n at handler (/usr/share/opensearch-dashboards/src/core/server/http/router/router.js:124:50)\n at exports.Manager.execute (/usr/share/opensearch-dashboards/node_modules/@hapi/hapi/lib/toolkit.js:60:28)\n at Object.internals.handler (/usr/share/opensearch-dashboards/node_modules/@hapi/hapi/lib/handler.js:46:20)\n at exports.execute (/usr/share/opensearch-dashboards/node_modules/@hapi/hapi/lib/handler.js:31:20)\n at Request._lifecycle (/usr/share/opensearch-dashboards/node_modules/@hapi/hapi/lib/request.js:371:32)\n at Request._execute (/usr/share/opensearch-dashboards/node_modules/@hapi/hapi/lib/request.js:281:9)"
    },
    "url": "http://opensearch-dashboard.kup-ohio.metabit-trading.com/api/console/proxy?path=_mapping&method=GET",
    "message": "Internal Server Error"
}

{
    "type": "log",
    "@timestamp": "2025-01-06T06:18:06Z",
    "tags":
    [
        "error",
        "http"
    ],
    "pid": 1,
    "message": "Error: expected 'location' header to be set\n at HapiResponseAdapter.toRedirect (/usr/share/opensearch-dashboards/src/core/server/http/router/response_adapter.js:123:13)\n at HapiResponseAdapter.toHapiResponse (/usr/share/opensearch-dashboards/src/core/server/http/router/response_adapter.js:105:19)\n at HapiResponseAdapter.handle (/usr/share/opensearch-dashboards/src/core/server/http/router/response_adapter.js:92:17)\n at Router.handle (/usr/share/opensearch-dashboards/src/core/server/http/router/router.js:164:34)\n at processTicksAndRejections (node:internal/process/task_queues:95:5)\n at handler (/usr/share/opensearch-dashboards/src/core/server/http/router/router.js:124:50)\n at exports.Manager.execute (/usr/share/opensearch-dashboards/node_modules/@hapi/hapi/lib/toolkit.js:60:28)\n at Object.internals.handler (/usr/share/opensearch-dashboards/node_modules/@hapi/hapi/lib/handler.js:46:20)\n at exports.execute (/usr/share/opensearch-dashboards/node_modules/@hapi/hapi/lib/handler.js:31:20)\n at Request._lifecycle (/usr/share/opensearch-dashboards/node_modules/@hapi/hapi/lib/request.js:371:32)\n at Request._execute (/usr/share/opensearch-dashboards/node_modules/@hapi/hapi/lib/request.js:281:9)"
}

```

> Did you test different browsers and private mode? Do you use any mod header in your browsers?

yes, I tried but not fine

> Does it fail for any API?

yes, I try serveral apis but get the same error

---

<div class="post-metadata">

**Author:** ![pablo](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/pablo/32/10363_2.png) [@pablo](https://forum.opensearch.org/u/pablo)\
**Post date:** [February 7, 2025, 11:01pm UTC](https://forum.opensearch.org/t/use-dev-tools-get-internal-server-error-500-error/23015/9 "2025-02-07T23:01:02Z")

</div>

@pkingqaq It looks like you’re connecting through reverse proxy to OpenSearch Dashboards.  
How is OpenSearch Dashboards connects to OpenSearch nodes? Is it also through reverse proxy or directly.  
Your curls are executed against direct OpenSearch endpoint [https://localhost:9200](https://localhost:9200).

---

<div class="post-metadata">

**Author:** ![pablo](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/pablo/32/10363_2.png) [@pablo](https://forum.opensearch.org/u/pablo)\
**Post date:** [February 7, 2025, 11:04pm UTC](https://forum.opensearch.org/t/use-dev-tools-get-internal-server-error-500-error/23015/10 "2025-02-07T23:04:06Z")

</div>

@pkingqaq Also check for any additional errors in OpenSearch logs. HTTP 500 is usually preceded by other errors.

---

<div class="post-metadata">

**Author:** ![pkingqaq](https://avatars.discourse-cdn.com/v4/letter/p/f07891/32.png) [@pkingqaq](https://forum.opensearch.org/u/pkingqaq)\
**Post date:** [February 10, 2025, 9:23am UTC](https://forum.opensearch.org/t/use-dev-tools-get-internal-server-error-500-error/23015/11 "2025-02-10T09:23:03Z")

</div>

How to check the connection mode between dashboard and cluster node?  
Here is my opensearch\_dashboard.yml

```auto

logging.verbose: false
opensearch.hosts:
- "<<cluster.url>>"
opensearch.logQueries: false
opensearch.password: xxx
opensearch.requestHeadersWhitelist:
- authorization
- securitytenant
opensearch.ssl.verificationMode: none
opensearch.username: kibanaserver
opensearch_security.auth.type: saml
opensearch_security.cookie.secure: true
opensearch_security.cookie.ttl: 216000000
opensearch_security.multitenancy.enabled: true
opensearch_security.multitenancy.tenants.preferred:
- Private
- Global
opensearch_security.readonly_mode.roles:
- kibana_read_only
opensearch_security.session.keepalive: true
opensearch_security.session.ttl: 216000000
server.host: "0"
server.xsrf.whitelist:
- /_plugins/_security/saml/acs/idpinitiated
- /_plugins/_security/saml/acs
- /_plugins/_security/saml/logout
- /_opendistro/_security/saml/acs/idpinitiated
- /_opendistro/_security/saml/acs
- /_opendistro/_security/saml/logout

```
