Skip to content

HENGSHI SENSE Other Frequently Asked Questions

Oauth2 Configuration Issues

Ubuntu 18.04 Certificate Issue Causing OAuth2 Configuration Failure

This issue occurs with JDK version 1.8.

text
HttpCommunicationException: javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
at sun.security.ssl.Alerts.getSSLException(Alerts.java:214)
at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1958)
at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1915)
at sun.security.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1898)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1419)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1396)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:563)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1282)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1257)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250)
at com.github.scribejava.core.httpclient.jdk.JDKHttpClient.prepareConnectionForBodyAndGetOutputStream(JDKHttpClient.java:224)
at com.github.scribejava.core.httpclient.jdk.JDKHttpClient.addBody(JDKHttpClient.java:211)
at com.github.scribejava.core.httpclient.jdk.JDKHttpClient.access$100(JDKHttpClient.java:24)

Run the following commands to reinstall and check if the OAuth2 configuration succeeds:

shell
sudo apt-get install ca-certificates-java -y
sudo update-ca-certificates -f

Screenshot Tool Dependency Issues

All Screenshot Tools Fail, Including PDF Export and PNG Export

The keyword is libplc4.so, libnss3, with logs similar to the following:

[2024-11-11T10:06:15.235+0800] [710760] [10.74.194.115] [10.74.194.115] [8081] [01JCCFHFE13MN9RWFT65F368AB] [11909] [DEBUG] [com.hengshi.nangaparbat.screenshot.JavaShellExecutor] [53]  - CommandLine: /bin/bash /opt/hengshi/lib/hengshishot-1.1.31-linux-no-arch/bin/hengshi-shot.sh --shotType=png --shotPath=/opt/hengshi/temp_data/screenshot/83833603-4468-49c2-b80e-19e29b572a0b.png --shotUrl=http://localhost:8081/screenshot/app/E2310E8E94FC0BEA3C0E98092210BB83A/dashboard/E8787F9BA9F818810116C95BBA55D0411?activeClickQuerys=&activeTabs=&cacheId=01JCCFHFE13MN9RWFT65F368AB&haveBackground=1&haveTitle=true&height=960&locale=zh-CN&mode=pc&requestId=01JCCFHFE13MN9RWFT65F368AB&timeout=55000&totalHeight=960&type=png&width=2048 --skey=ca03fea5-5bfa-4c58-aa81-9da1e444677c-238b40fc-e5ba-4527-b938-2bfbe21fbba5 --uid=2 --tenantId=null --timeout=52000 exec time: 167 ms
[2024-11-11T10:06:15.235+0800] [710760] [10.74.194.115] [10.74.194.115] [8081] [01JCCFHFE13MN9RWFT65F368AB] [11909] [INFO] [com.hengshi.nangaparbat.screenshot.CommandHelper] [106]  - CommandLine stdout: {"_":[],"shotType":"png","shotPath":"/opt/hengshi/temp_data/screenshot/83833603-4468-49c2-b80e-19e29b572a0b.png","shotUrl":"http://localhost:8081/screenshot/app/E2310E8E94FC0BEA3C0E98092210BB83A/dashboard/E8787F9BA9F818810116C95BBA55D0411?activeClickQuerys=&activeTabs=&cacheId=01JCCFHFE13MN9RWFT65F368AB&haveBackground=1&haveTitle=true&height=960&locale=zh-CN&mode=pc&requestId=01JCCFHFE13MN9RWFT65F368AB&timeout=55000&totalHeight=960&type=png&width=2048","skey":"ca03fea5-5bfa-4c58-aa81-9da1e444677c-238b40fc-e5ba-4527-b938-2bfbe21fbba5","uid":2,"tenantId":"null","timeout":52000}
Failed to launch the browser process!
/opt/hengshi/lib/hengshishot-1.1.31-linux-no-arch/node_modules/puppeteer/.local-chromium/linux-884014/chrome-linux/chrome: error while loading shared libraries: libplc4.so: cannot open shared object file: No such file or directory


TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md

Error: Failed to launch the browser process!
/opt/hengshi/lib/hengshishot-1.1.31-linux-no-arch/node_modules/puppeteer/.local-chromium/linux-884014/chrome-linux/chrome: error while loading shared libraries: libplc4.so: cannot open shared object file: No such file or directory


TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md

    at onClose (/opt/hengshi/lib/hengshishot-1.1.31-linux-no-arch/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:194:20)
    at Interface.helper_js_1.helper.addEventListener (/opt/hengshi/lib/hengshishot-1.1.31-linux-no-arch/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:184:68)
  1. Install the NSS Library: On most Linux distributions, you can install the required NSS library using the package manager. Depending on your distribution, use one of the following commands. For other systems, refer to the dependency installation documentation for your operating system:

    • Ubuntu/Debian:

      bash
      sudo apt-get update
      sudo apt-get install libnss3
    • CentOS/RHEL:

      bash
      sudo yum install nss
    • Fedora:

      bash
      sudo dnf install nss
  2. Check the Library File: After installing the dependency library, check if libplc4.so is in the system's library path. You can use the find command to locate this file:

    bash
    find / -name libplc4.so

After performing the above steps, try running the PDF and PNG export operations again. They should work successfully. If the issue persists, ensure compatibility between the system architecture and the relevant software versions.

Dashboard Subscription Screenshot and Web Display Discrepancy

The web preview shows 20 rows of data, but the exported PDF only displays 17 rows. As shown in the image below: img

This issue is typically caused by the absence of fonts like Arial on the machine where the service is deployed. Installing the required fonts should resolve the issue.

Tip

The Arial font may involve copyright issues. Please ensure you have the appropriate usage rights.

CentOS Series Installation Reference

  • Copy the Arial font, either from the Windows system or downloaded from the internet, to the /usr/share/font/arial directory on CentOS.

img

shell
sudo yum install mkfontscale mkfontdir fontconfig

# Refresh font cache
cd /usr/share/font/arial
mkfontscale
mkfontdir
fc-cache -fv

# Verify if the font is effective
fc-list | grep -i "arial"
/usr/share/fonts/arial/ARIALNBI.TTF: Arial Narrow:style=Bold Italic,Έντονα Πλάγια
/usr/share/fonts/arial/ariblk.ttf: Arial Black:style=Regular,Standard
/usr/share/fonts/arial/ariali.ttf: Arial:style=kurzíva,Italic
/usr/share/fonts/arial/arialbd.ttf: Arial:style=tučné,Bold
/usr/share/fonts/arial/ARIALNI.TTF: Arial Narrow:style=Italic,Πλάγια
/usr/share/fonts/arial/ARIALN.TTF: Arial Narrow:style=Regular,normal
/usr/share/fonts/arial/arialbi.ttf: Arial:style=tučné kurzíva,Bold Italic
/usr/share/fonts/arial/ARIALNB.TTF: Arial Narrow:style=Bold,Έντονα
/usr/share/fonts/arial/Arial.ttf: Arial:style=Κανονικά,Regular

Ubuntu Series Installation Reference

shell
sudo apt update
sudo apt install ttf-mscorefonts-installer fontconfig -y

# Activate fonts
sudo fc-cache

# Confirm font
fc-match Arial
Arial.ttf: "Arial" "Regular"

User Manual for Hengshi Analysis Platform