Curl to dashboard pod gives {"statusCode":500,"error":"Internal Server Error","message":"An internal server error occurred."} with centos image

  • We build a docker image for OpenSearch-dashboards for use in Kubernetes env. Images are built using two distributions (centos7 and rocky8). In both cases, we install the OpenSearch-dashboards rpm and required plugins etc.
  • Tests are being run in a dual-stack Kubernetes env ( IPv4 and IPv6)
  • We check the endpoint /api/status on server.host to verify if the pod is up. In the case of Ipv6 env, server.host is set to :: (Ipv6)
    so a curl to http://:::/5601 should work fine. We run this endpoint to check for pod readiness/liveness…
  • Observation -
    With version 1.3.2 - we see that the curl works fine
    With version 2.2.1 - {“statusCode”:500,“error”:“Internal Server Error”,“message”:“An internal server error occurred.”}

Error inside the dashboard pod

{“type”:“log”,“@timestamp”:“2023-03-15T06:58:59Z”,“tags”:[“error”,“http”,“server”,“OpenSearchDashboards”],“pid”:19,“message”:“TypeError [ERR_INVALID_URL]: Invalid URL: http://:::5601/api/status\n at new NodeError (internal/errors.js:322:7)\n at onParseError (internal/url.js:270:9)\n at new URL (internal/url.js:346:5)\n at Request._parseUrl (/usr/share/opensearch-dashboards/node_modules/@hapi/hapi/lib/request.js:188:25)\n at Request.get url [as url] (/usr/share/opensearch-dashboards/node_modules/@hapi/hapi/lib/request.js:122:21)\n at new OpenSearchDashboardsRequest (/usr/share/opensearch-dashboards/src/core/server/http/router/request.js:114:24)\n at Function.from (/usr/share/opensearch-dashboards/src/core/server/http/router/request.js:49:12)\n at interceptRequest (/usr/share/opensearch-dashboards/src/core/server/http/lifecycle/on_post_auth.js:77:67)\n at exports.Manager.execute (/usr/share/opensearch-dashboards/node_modules/@hapi/hapi/lib/toolkit.js:57:29)\n at Request._invoke (/usr/share/opensearch-dashboards/node_modules/@hapi/hapi/lib/request.js:398:55)\n at Request._lifecycle (/usr/share/opensearch-dashboards/node_modules/@hapi/hapi/lib/request.js:371:86)\n at processTicksAndRejections (internal/process/task_queues.js:95:5)\n at Request._execute (/usr/share/opensearch-dashboards/node_modules/@hapi/hapi/lib/request.js:281:9) {\n input: ‘http://:::5601/api/status’,\n code: ‘ERR_INVALID_URL’\n}”}

@anegi2424 I see that yo uare using ipv6, doe ipv4 work though?

@ashwinpc ipv4 works fine only with ipv6 this issue is seen.

@anegi2424 It seems to be a parsing error with the url parser. Not sure if/when it was updated, but can you try two things:

  1. Try using the url http://[::1]:5601
  2. Try the unabbreviated url for localhost

@ashwinpc http://[::1]:5601 works on the rocky8 distribution but it does not work with centos7.
The following error is observed in centos7
curl: (3) [globbing] illegal character in range specification at pos 9

Yeah this looks like a bug. Can you open an issue in the OpenSearch Dashboards GitHub repo?

Created this issue on OpenSearch dashboard repo

Also even on giving tcp port 5601 for liveness and readiness following error is observed inside the dashboards pod continuosly
{“type”:“log”,“@timestamp”:“2023-03-15T06:58:59Z”,“tags”:[“error”,“http”,“server”,“OpenSearchDashboards”],“pid”:19,“message”:“TypeError [ERR_INVALID_URL]: Invalid URL: http://:::5601/api/status\n at new NodeError (internal/errors.js:322:7)\n at onParseError (internal/url.js:270:9)\n at new URL (internal/url.js:346:5)\n at Request._parseUrl (/usr/share/opensearch-dashboards/node_modules/@hapi/hapi/lib/request.js:188:25)\n at Request.get url [as url] (/usr/share/opensearch-dashboards/node_modules/@hapi/hapi/lib/request.js:122:21)\n at new OpenSearchDashboardsRequest (/usr/share/opensearch-dashboards/src/core/server/http/router/request.js:114:24)\n at Function.from (/usr/share/opensearch-dashboards/src/core/server/http/router/request.js:49:12)\n at interceptRequest (/usr/share/opensearch-dashboards/src/core/server/http/lifecycle/on_post_auth.js:77:67)\n at exports.Manager.execute (/usr/share/opensearch-dashboards/node_modules/@hapi/hapi/lib/toolkit.js:57:29)\n at Request._invoke (/usr/share/opensearch-dashboards/node_modules/@hapi/hapi/lib/request.js:398:55)\n at Request._lifecycle (/usr/share/opensearch-dashboards/node_modules/@hapi/hapi/lib/request.js:371:86)\n at processTicksAndRejections (internal/process/task_queues.js:95:5)\n at Request._execute (/usr/share/opensearch-dashboards/node_modules/@hapi/hapi/lib/request.js:281:9) {\n input: ‘http://:::5601/api/status’,\n code: ‘ERR_INVALID_URL’\n}”}

There is nowhere other than readiness liveness where we are calling /api/status api.
Is there somewhere in the code from where it is getting triggered?