opendistro-for-elasticsearch / kibana-reports

Kibana Reports
https://opendistro.github.io/
39 stars 31 forks source link

Cannot Generate PDF/PNG Reports In Open Distro Kibana Docker Container & Cannot Sudo in ODKibana Container to Install Chromium Dependencies #389

Closed rylativity closed 3 years ago

rylativity commented 3 years ago

I'm seeing a very similar problem to the OP from these two issues (386 & 387), except I am running my ODElasticsearch and ODKibana servers in docker from the images amazon/opendistro-for-elasticsearch:1.13.2 and amazon/opendistro-for-elasticsearch-kibana:1.13.2 respectively. I am able to generate and download CSV reports just fine, but PDF/PNG reports time out, even if I try to generate a PDF report of a tiny markdown visual.

The comments in the two linked issues suggest installing the additional chromium dependencies by running sudo yum install -y libnss3.so xorg-x11-fonts-100dpi xorg-x11-fonts-75dpi xorg-x11-utils xorg-x11-fonts-cyrillic xorg-x11-fonts-Type1 xorg-x11-fonts-misc fontconfig freetype ; however, I cannot run sudo or switch to the root user in the ODKibana docker container and cannot find any information on the root user password for that container.

I'd appreciate any suggestions for either resolving the original issue of being unable to generate PDF/PNG reports or suggestions on how to gain sudo privileges in the ODKibana docker container to install the additional chromium dependencies.

I've included the error logs below (with sensitive header information redacted).

od-kibana | {"type":"log","@timestamp":"2021-07-23T14:13:00Z","tags":["error","plugins","opendistroReportsKibana"],"pid":1,"message":"Failed to generate report: TimeoutError: waiting for selector \"#dashboardViewport\" failed: timeout 60000ms exceeded"} od-kibana | {"type":"log","@timestamp":"2021-07-23T14:13:00Z","tags":["error","plugins","opendistroReportsKibana"],"pid":1,"message":"{ TimeoutError: waiting for selector \"#dashboardViewport\" failed: timeout 60000ms exceeded\n at new WaitTask (/usr/share/kibana/plugins/opendistroReportsKibana/node_modules/puppeteer-core/lib/DOMWorld.js:549:28)\n at DOMWorld._waitForSelectorOrXPath (/usr/share/kibana/plugins/opendistroReportsKibana/node_modules/puppeteer-core/lib/DOMWorld.js:478:22)\n at DOMWorld.waitForSelector (/usr/share/kibana/plugins/opendistroReportsKibana/node_modules/puppeteer-core/lib/DOMWorld.js:432:17)\n at Frame.waitForSelector (/usr/share/kibana/plugins/opendistroReportsKibana/node_modules/puppeteer-core/lib/FrameManager.js:627:47)\n at Frame.<anonymous> (/usr/share/kibana/plugins/opendistroReportsKibana/node_modules/puppeteer-core/lib/helper.js:112:23)\n at Page.waitForSelector (/usr/share/kibana/plugins/opendistroReportsKibana/node_modules/puppeteer-core/lib/Page.js:1095:29)\n at createVisualReport (/usr/share/kibana/plugins/opendistroReportsKibana/server/routes/utils/visual_report/visualReportHelper.ts:129:18) name: 'TimeoutError' }"}

od-kibana | {"type":"error","@timestamp":"2021-07-23T14:11:57Z","tags":[],"pid":1,"level":"error","error":{"message":"Internal Server Error","name":"Error","stack":"Error: Internal Server Error\n at HapiResponseAdapter.toError (/usr/share/kibana/src/core/server/http/router/response_adapter.js:132:19)\n at HapiResponseAdapter.toHapiResponse (/usr/share/kibana/src/core/server/http/router/response_adapter.js:86:19)\n at HapiResponseAdapter.handle (/usr/share/kibana/src/core/server/http/router/response_adapter.js:81:17)\n at Router.handle (/usr/share/kibana/src/core/server/http/router/router.js:164:34)"},"url":{"protocol":null,"slashes":null,"auth":null,"host":null,"port":null,"hostname":null,"hash":null,"search":"?timezone=America/New_York","query":{"timezone":"America/New_York"},"pathname":"/api/reporting/generateReport","path":"/api/reporting/generateReport?timezone=America/New_York","href":"/api/reporting/generateReport?timezone=America/New_York"},"message":"Internal Server Error"}

od-kibana | {"type":"response","@timestamp":"2021-07-23T14:11:57Z","tags":[],"pid":1,"method":"post","statusCode":500,"req":{"url":"/api/reporting/generateReport?timezone=America%2FNew_York","method":"post","headers":{"host":"xxx.xxx.xxx","sec-ch-ua":"\" Not;A Brand\";v=\"99\", \"Google Chrome\";v=\"91\", \"Chromium\";v=\"91\"","pragma":"no-cache","accept-language":"en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7,zh-TW;q=0.6","sec-ch-ua-mobile":"?0","user-agent":"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36","content-type":"application/json","accept":"*/*","kbn-version":"7.10.2","origin":"https://xxx.xxx.xxx","sec-fetch-site":"same-origin","sec-fetch-mode":"cors","sec-fetch-dest":"empty","referer":"https://xxx.xxx.xxx/kibana/app/dashboards","accept-encoding":"gzip, deflate, br","oidc_claim_exp":"1627049776","oidc_claim_iat":"1627049476","oidc_claim_auth_time":"1627047913","oidc_claim_jti":"jti","oidc_claim_iss":"https://xxx.xxx.xxx/auth/realms/myrealm","oidc_claim_aud":"apache-proxy","oidc_claim_sub":"claimsub","oidc_claim_typ":"ID","oidc_claim_azp":"apache-proxy","oidc_claim_nonce":"claimnonce","oidc_claim_session_state":"50c755d7-7051-429a-8066-35b6e637e892","oidc_claim_at_hash":"oMAzWoi9Pa0w6P0Bm-IDSw","oidc_claim_acr":"0","oidc_claim_resource_access":"{\"roles\": [\"default-roles-poc\", \"offline_access\", \"uma_authorization\"]}","oidc_claim_email_verified":"1","oidc_claim_name":"user1","oidc_claim_preferred_username":"user1","oidc_claim_given_name":"user","oidc_claim_family_name":"1","oidc_claim_email":"user.1@abc.com","oidc_access_token":"ey........","oidc_access_token_expires":"1627049776","x-proxy-user":"user1","x-proxy-roles":"admin","x-forwarded-for":"xxxx.xxxx.xxxx","x-forwarded-host":"xxxx.xxxx.xxxx","x-forwarded-server":"xxx.xxx.xxxx","content-length":"1001","connection":"Keep-Alive","securitytenant":""},"remoteAddress":"172.26.0.1","userAgent":"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36","referer":"https://xxxx.xxxx.xxxx/kibana/app/dashboards"},"res":{"statusCode":500,"responseTime":62957,"contentLength":9},"message":"POST /api/reporting/generateReport?timezone=America%2FNew_York 500 62957ms - 9.0B"}

jamesdboone commented 3 years ago

For anyone else who runs into this...I had similar issue w/ timeouts generating png/pdf. I bumped up memory & CPU to the dashboards pod and all was good. It seems the opensearch helm charts maybe don't accomodate memory for this operation...