数据中台datart&selenium/standalone-chrome截图报错datart.core.base.exception.BaseException: org.openqa.selenium.WebDriverException: unknown error: net::ERR_CONNECTION_REFUSED

背景

参考官方网站,以k8s方式进行部署:
https://running-elephant.gitee.io/datart-docs/docs/

部署情况:

报错信息:

datart.core.base.exception.BaseException: org.openqa.selenium.WebDriverException: unknown error: net::ERR_CONNECTION_REFUSED
  (Session info: headless chrome=96.0.4664.110)
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: 'dmp-datart-7b67d9bb67-5vh4z', ip: '192.168.89.195', os.name: 'Linux', os.arch: 'amd64', os.version: '4.19.12-1.el7.elrepo.x86_64', java.version: '1.8.0_342'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 96.0.4664.110, chrome: {chromedriverVersion: 96.0.4664.45 (76e4c1bb2ab46..., userDataDir: /tmp/.com.google.Chrome.gaEl8x}, goog:chromeOptions: {debuggerAddress: localhost:34449}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: LINUX, platformName: LINUX, proxy: Proxy(), se:cdp: ws://192.168.153.126:4444/s..., se:cdpVersion: 96.0.4664.110, se:vnc: ws://192.168.153.126:4444/s..., se:vncEnabled: true, se:vncLocalAddress: ws://192.168.153.126:7900, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:virtualAuthenticators: true}
Session ID: 16ed795bea0f112a6c0ca7611635bf34
	at datart.core.base.exception.Exceptions.e(Exceptions.java:44)
	at datart.core.common.WebUtils.screenShot(WebUtils.java:94)
	at datart.core.common.WebUtils.screenShot2File(WebUtils.java:103)
	at datart.server.service.impl.AttachmentImageServiceImpl.getFile(AttachmentImageServiceImpl.java:59)
	at datart.server.service.impl.DownloadServiceImpl.lambda$submitDownloadTask$0(DownloadServiceImpl.java:95)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:750)
Caused by: org.openqa.selenium.WebDriverException: unknown error: net::ERR_CONNECTION_REFUSED
  (Session info: headless chrome=96.0.4664.110)

排查步骤

  1. 确认datart容器与chrom容器之间网络互通

    通过切换到datart容器网络环境进行telnet验证,两个容器之间网络是互通的。

2.检查datart配置的chrom的地址是否正确

webdriver-path: http://dmp-datart-chrome:4444/wd/hub

核对下chrom的svc名称和端口:

确认没错。

3.检查datart的其他配置

datart:
  migration:
    enable: true
  server:
    address: http://127.0.0.1:8080

参考官方介绍:

这个配置写了127.0.0.1,这个在容器之间是不能互通的。改为datart的域名或者公网地址(内部访问也应该是nodeport对应地址和端口)。

查看datart的svc名称

 kubectl get svc -n dmp-dev

修改配置,将127.0.0.1改为datart的域名:

到此问题就解决了。

posted @ 2023-09-15 10:54  邹姣姣  阅读(377)  评论(0编辑  收藏  举报