wuqicyber commented on PR #30134:
URL: https://github.com/apache/superset/pull/30134#issuecomment-2574980414

   > Happy New Year!  新年快乐!
   > 
   > I've investigated further and found the issue with "Export to PDF" & 
"Download image" not working on dashboards. The issue seems to be the 
interaction of the headless browser and `WEBDRIVER_BASEURL`. In the docker 
compose setup `superset_config.py` suggests setting 
`WEBDRIVER_BASEURL=http://superset_app:8088/`, so accessing the superset 
instance directly and skipping the nginx reverse proxy. This is fine when there 
is no url prefix set as the paths that both the reverse proxy and the superset 
app see are the same. When there is a url prefix set it is baked into the 
javascript files that webpack builds and when accessing the superset app 
directly the extra prefix part of the path raises an error in the superset app 
and the screenshot generation fails.我已经进一步调查并发现“导出为 
PDF”和“下载图片”在仪表板上无法工作的问题。问题似乎是 headless 浏览器和 `WEBDRIVER_BASEURL` 之间的交互。在 docker 
compose 设置中, `superset_con
 fig.py` 建议设置 `WEBDRIVER_BASEURL=http://superset_app:8088/` ,因此直接访问 superset 
实例并跳过 nginx 反向代理。如果没有设置 URL 前缀,这是可以的,因为反向代理和 superset 应用看到的路径是相同的。当设置了 URL 
前缀时,它会被烘焙到 webpack 构建的 javascript 文件中,并且当直接访问 superset 应用时,路径的额外前缀部分会在 superset 
应用中引发错误,截图生成失败。
   > 
   > A fix/workaround (??) seems to be to set `WEBDRIVER_BASEURL = 
f"http://superset_nginx{base_path}/"` but this also requires removing this 
[with 
statement](https://github.com/apache/superset/blob/109e6c69ff25b82b603a4daff40207250788e6b1/superset/utils/urls.py#L35)
 that seems to set a test context that doesn't know about the prefix. I'm not 
sure of the knock on effects of this. @rusackas Would you know someone who 
could comment on this or possibly suggest an alternative 
approach?一个修复/解决方案似乎是设置 `WEBDRIVER_BASEURL = 
f"http://superset_nginx{base_path}/"` ,但这也需要删除这个 with 
语句,该语句似乎设置了一个不知道前缀的测试上下文。我不确定这会有什么副作用。您认识可以对此发表评论或可能提出替代方法的人吗?
   
   @martyngigg try APPLICATION_ROOT, by setting it to perfix, i found it works
    


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to