Unable to downloaded report

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):

2.4.1

Describe the issue:

When downloading a report i get the following errors
and i have no clue what’s going on … can somebody help please?

{"type":"log","@timestamp":"2023-01-23T15:11:05Z","tags":["error","plugins","reportsDashboards"],"pid":1,"message":"Failed to generate report by id: ProtocolError: Protocol error (Target.setDiscoverTargets): Target closed."}
{"type":"log","@timestamp":"2023-01-23T15:11:05Z","tags":["error","plugins","reportsDashboards"],"pid":1,"message":"ProtocolError: Protocol error (Target.setDiscoverTargets): Target closed.\n    at /usr/share/opensearch-dashboards/plugins/reportsDashboards/node_modules/puppeteer-core/src/common/Connection.ts:106:16\n    at new Promise (<anonymous>)\n    at Connection.send (/usr/share/opensearch-dashboards/plugins/reportsDashboards/node_modules/puppeteer-core/src/common/Connection.ts:102:12)\n    at Function.create (/usr/share/opensearch-dashboards/plugins/reportsDashboards/node_modules/puppeteer-core/src/common/Browser.ts:231:22)\n    at ChromeLauncher.launch (/usr/share/opensearch-dashboards/plugins/reportsDashboards/node_modules/puppeteer-core/src/node/Launcher.ts:179:31)\n    at createVisualReport (/usr/share/opensearch-dashboards/plugins/reportsDashboards/server/routes/utils/visual_report/visualReportHelper.ts:68:19)\n    at createReport (/usr/share/opensearch-dashboards/plugins/reportsDashboards/server/routes/lib/createReport.ts:93:30)\n    at /usr/share/opensearch-dashboards/plugins/reportsDashboards/server/routes/report.ts:131:28\n    at Router.handle (/usr/share/opensearch-dashboards/src/core/server/http/router/router.js:163:44)\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) {\n  originalMessage: ''\n}"}
{"type":"error","@timestamp":"2023-01-23T15:11:05Z","tags":[],"pid":1,"level":"error","error":{"message":"Internal Server Error","name":"Error","stack":"Error: Internal Server Error\n    at HapiResponseAdapter.toError (/usr/share/opensearch-dashboards/src/core/server/http/router/response_adapter.js:143:19)\n    at HapiResponseAdapter.toHapiResponse (/usr/share/opensearch-dashboards/src/core/server/http/router/response_adapter.js:97: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 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://xxxx.com/api/reporting/generateReport/M_ko34UBjWts53DK1zKJ?timezone=Europe%2FPrague&dateFormat=MMM%20D%2C%20YYYY%20%40%20HH%3Amm%3Ass.SSS&csvSeparator=%2C","message":"Internal Server Error"}
{"type":"response","@timestamp":"2023-01-23T15:11:05Z","tags":[],"pid":1,"method":"get","statusCode":500,"req":{"url":"/api/reporting/generateReport/M_ko34UBjWts53DK1zKJ?timezone=Europe%2FPrague&dateFormat=MMM%20D%2C%20YYYY%20%40%20HH%3Amm%3Ass.SSS&csvSeparator=%2C","method":"get","headers":{"host":"xxx.com","x-request-id":"e9067998beb01b746f9a8ec76da02c30","x-real-ip":"172.19.128.4","x-forwarded-for":"172.19.128.4","x-forwarded-host":"xxxx.com","x-forwarded-port":"443","x-forwarded-proto":"https","x-forwarded-scheme":"https","x-scheme":"https","sec-ch-ua":"\"Not_A Brand\";v=\"99\", \"Google Chrome\";v=\"109\", \"Chromium\";v=\"109\"","content-type":"application/json","sec-ch-ua-mobile":"?0","user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36","osd-version":"2.4.1","sec-ch-ua-platform":"\"Windows\"","accept":"*/*","sec-fetch-site":"same-origin","sec-fetch-mode":"cors","sec-fetch-dest":"empty","referer":"https://xxx.com/app/reports-dashboards","accept-encoding":"gzip, deflate, br","accept-language":"en-US,en;q=0.9,it;q=0.8,cs;q=0.7","securitytenant":""},"remoteAddress":"10.244.1.46","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36","referer":"https://xxxxx.com/app/reports-dashboards"},"res":{"statusCode":500,"responseTime":79,"contentLength":9},"message":"GET /api/reporting/generateReport/M_ko34UBjWts53DK1zKJ?timezone=Europe%2FPrague&dateFormat=MMM%20D%2C%20YYYY%20%40%20HH%3Amm%3Ass.SSS&csvSeparator=%2C 500 79ms - 9.0B"}

Configuration:

deployed with k8s operator and this additionalconfig

      opensearch.requestHeadersAllowlist: '["securitytenant","Authorization"]'
      opensearch_security.multitenancy.enable_filter: 'false'
      opensearch_security.multitenancy.enabled: 'true'
      opensearch_security.multitenancy.tenants.enable_global: 'true'
      opensearch_security.multitenancy.tenants.enable_private: 'false'
      opensearch_security.multitenancy.tenants.preferred: '["Global"]'
      server.maxPayloadBytes: '8388608'

i think i found the reason.

i’m using the official dashboards container version 2.4.1 and it looks like headless_chromium is missing dependencies

[opensearch-dashboards@opensearch-cluster-dashboards-745c9785b7-lztkf .chromium]$ ldd headless_shell
        linux-vdso.so.1 (0x00007ffc65cc2000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007fd78792d000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fd78770f000)
        libgobject-2.0.so.0 => /lib64/libgobject-2.0.so.0 (0x00007fd7874bf000)
        libglib-2.0.so.0 => /lib64/libglib-2.0.so.0 (0x00007fd7871b1000)
        libnss3.so => /lib64/libnss3.so (0x00007fd786e84000)
        libnssutil3.so => /lib64/libnssutil3.so (0x00007fd786c55000)
        libsmime3.so => /lib64/libsmime3.so (0x00007fd786a2f000)
        libnspr4.so => /lib64/libnspr4.so (0x00007fd7867f2000)
        libatk-1.0.so.0 => not found
        libatk-bridge-2.0.so.0 => not found
        libcups.so.2 => not found
        libgio-2.0.so.0 => /lib64/libgio-2.0.so.0 (0x00007fd786460000)
        libdrm.so.2 => not found
        libdbus-1.so.3 => not found
        libatspi.so.0 => not found
        libX11.so.6 => /lib64/libX11.so.6 (0x00007fd786128000)
        libXcomposite.so.1 => not found
        libXdamage.so.1 => not found
        libXext.so.6 => /lib64/libXext.so.6 (0x00007fd785f16000)
        libXfixes.so.3 => not found
        libXrandr.so.2 => /lib64/libXrandr.so.2 (0x00007fd785d0b000)
        libgbm.so.1 => not found
        libexpat.so.1 => /lib64/libexpat.so.1 (0x00007fd785adb000)
        libxcb.so.1 => /lib64/libxcb.so.1 (0x00007fd7858b3000)
        libxkbcommon.so.0 => not found
        libpango-1.0.so.0 => not found
        libcairo.so.2 => not found
        libasound.so.2 => not found
        libm.so.6 => /lib64/libm.so.6 (0x00007fd785573000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fd78535d000)
        libc.so.6 => /lib64/libc.so.6 (0x00007fd784fb0000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fd795f32000)
        libpcre.so.1 => /lib64/libpcre.so.1 (0x00007fd784d4c000)
        libffi.so.6 => /lib64/libffi.so.6 (0x00007fd784b44000)
        libplc4.so => /lib64/libplc4.so (0x00007fd78493f000)
        libplds4.so => /lib64/libplds4.so (0x00007fd78473b000)
        librt.so.1 => /lib64/librt.so.1 (0x00007fd784533000)
        libgmodule-2.0.so.0 => /lib64/libgmodule-2.0.so.0 (0x00007fd78432f000)
        libz.so.1 => /lib64/libz.so.1 (0x00007fd78411a000)
        libselinux.so.1 => /lib64/libselinux.so.1 (0x00007fd783ef3000)
        libresolv.so.2 => /lib64/libresolv.so.2 (0x00007fd783cdd000)
        libmount.so.1 => /lib64/libmount.so.1 (0x00007fd783a8b000)
        libXrender.so.1 => /lib64/libXrender.so.1 (0x00007fd783881000)
        libXau.so.6 => /lib64/libXau.so.6 (0x00007fd78367d000)
        libblkid.so.1 => /lib64/libblkid.so.1 (0x00007fd783435000)
        libuuid.so.1 => /lib64/libuuid.so.1 (0x00007fd783230000)

[opensearch-dashboards@opensearch-cluster-dashboards-745c9785b7-lztkf .chromium]$ pwd
/usr/share/opensearch-dashboards/plugins/reportsDashboards/.chromium

Hello,

now that 2.5 is released have you tried upgrading?
The report is now generated on the client, so it should work now.

BR,
Andreas

Hi,

so, i had identified the bug, and the missing dependencies inside the container were indeed the problem. - [BUG] missing dependencies for chromium headless-shell · Issue #8 · opensearch-project/dashboards-docker-images · GitHub

version 2.5 works well and i see it no longer uses chromium headless_shell, but for previous versions the fix is to rebuild the dashboard container adding the right dependencies .

this worked for me

FROM docker.io/opensearchproject/opensearch-dashboards:2.4.1
USER root

RUN yum update -y
RUN yum install -y atk at-spi2-atk cups-libs libdrm dbus-libs at-spi2-core libXcomposite libXdamage libXfixes mesa-libgbm expat libxcb libxkbcommon pango cairo alsa-lib
USER 1000
1 Like