Skip to content
This repository has been archived by the owner on Aug 9, 2022. It is now read-only.

PDF/PNG download report - doesn't work ODFE1.13 - http 500 error #387

Open
RameshKatkam opened this issue Jul 20, 2021 · 3 comments
Open

Comments

@RameshKatkam
Copy link

Hello,

Version details:
elasticsearch-oss-7.10.2-1.x86_64
opendistroforelasticsearch-1.13.1-1.x86_64
opendistroforelasticsearch-kibana-1.13.1-1.x86_64

Reproduce issue:

  1. Generate PDF or PNG from the sample data set from the reporting definition. NOTE: CSV works fine.
  2. Check the developer tools response from the browser. Error dumps as Target closed with 500 error as shown below.
    chrome developer tools response:
    {statusCode: 500, error: "Internal Server Error",…}
    error: "Internal Server Error"
    message: "Protocol error (Target.setDiscoverTargets): Target closed."
    statusCode: 500
  3. No other errors from the logs.

Any thoughts on resolution?

Thanks in advance.

@zhongnansu
Copy link
Member

can you check and see if there's any error log on Kibana server side?

@zhongnansu
Copy link
Member

@rylativity
Copy link

@RameshKatkam are you using any kind of authentication requiring the presence of certain headers (e.g. proxy auth requires the presence of x-proxy-user and x-proxy-roles headers)?

I have seen the exact same behavior as you (i.e. I can generate CSV reports but not PDF and PNG), and it only occurs for me when I have proxy auth enabled. In my case, the requests made by headless Chrome don't appear to carry the auth headers through. In the Kibana logs, I see a 401 immediately upon clicking "Generate PDF/PNG", followed by a 500 in the Kibana logs and a 500 in the browser (like you are seeing) exactly one minute after the initial request. This is the 401 that get's thrown immediately in response to headless Chrome's request:

{"type":"response","@timestamp":"2021-07-30T14:57:11Z","tags":[],"pid":1,"method":"get","statusCode":401,"req":{"url":"/app/dashboards?security_tenant=global","method":"get","headers":{"host":"0.0.0.0:5601","connection":"keep-alive","upgrade-insecure-requests":"1","user-agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/77.0.3844.0 Safari/537.36","accept":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3","accept-encoding":"gzip, deflate","accept-language":"en-US"},"remoteAddress":"127.0.0.1","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/77.0.3844.0 Safari/537.36"},"res":{"statusCode":401,"responseTime":2,"contentLength":9},"message":"GET /app/dashboards?security_tenant=global 401 2ms - 9.0B"}

I am starting to think that headers are not being passed to or handled correctly by the headless chrome browser. It would explain why CSV reports are generated without issue (as they do not rely on headless chrome as far as I know), but PDF/PNG reports are not. Just a hunch.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants