5.8 KiB
福建项目:NZ笔记功能无法导出pdf 和markdown格式笔记
| ID | Creation Date | Assignee | Status |
|---|---|---|---|
| OMPUB-1126 | 2024-01-25T17:12:15.000+0800 | 方顺健 | 已关闭 |
notebook编辑保存功能正常,json格式可以导出,pdf下载显示400错误。fangshunjian commented on 2024-01-25T17:34:11.568+0800:
[~wangjunhao] 帮忙导出 /var/log/nezha/nz-web/ 目录下今天的日志文件 ,打包压缩后上传
wangjunhao commented on 2024-01-25T17:49:46.641+0800:
日志文件已上传
fangshunjian commented on 2024-01-25T18:35:51.661+0800:
[~wangjunhao] 帮忙在NZ 服务器执行 以下命令 {code:java} /opt/nezha/nz-web/lib/chromedriver -v {code}
wangjunhao commented on 2024-01-25T18:48:55.761+0800:
ChromeDriver 117.0.5938.149 (e3344ddefa12e60436fa28c81cf207c1afb4d0a9-refs/branch-heads/5938@{#1539})
fangshunjian commented on 2024-01-26T14:46:22.342+0800:
现象: {code:java} 2024-01-25 08:15:09.100 [http-nio-80-exec-7] ERROR c.n.m.dashboard.service.impl.VisualServiceImpl - [downloadSnapshotFile] [error] [type: notebook] [taskId: e2cc9217-6ce2-46bb-87d2-e8b47cf5ce5e] org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: session not created: Chrome failed to start: exited normally. (session not created: DevToolsActivePort file doesn't exist) (The process started from chrome location ./lib/chrome-linux64/chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.) Host info: host: 'FJHD-QZ-NEZHA-SERVER-100', ip: '192.168.10.100' Build info: version: '4.8.3', revision: 'e5e76298c3' System info: os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-693.el7.x86_64', java.version: '21' Driver info: org.openqa.selenium.chrome.ChromeDriver Command: [null, newSession {capabilities=[Capabilities {browserName: chrome, goog:chromeOptions: {args: [--remote-allow-origins=, --headless, --disable-cache, --disable-dev-shm-usage, --no-sandbox, --window-size=1920x1080, --lang=zh-CN.UTF-8], binary: ./lib/chrome-linux64/chrome, extensions: []}}], desiredCapabilities=Capabilities {browserName: chrome, goog:chromeOptions: {args: [--remote-allow-origins=, --headless, --disable-cache, --disable-dev-shm-usage, --no-sandbox, --window-size=1920x1080, --lang=zh-CN.UTF-8], binary: ./lib/chrome-linux64/chrome, extensions: []}}}] at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:148) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:106) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:67) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:165) at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:183) at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:158) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:543) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:229) at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:157) at org.openqa.selenium.chromium.ChromiumDriver.(ChromiumDriver.java:101){code} 排查:
-
直接调用 chrome,检查是否报错 {code:java} /opt/nezha/nz-web/lib/chrome-linux64/chrome --remote-allow-origins=* --headless --disable-cache --disable-dev-shm-usage --no-sandbox --window-size=1920x1080 --lang=zh-CN.UTF-8 --print-to-pdf=./test.pdf http://127.0.0.1 /opt/nezha/nz-web/lib/chrome-linux64/chrome: /lib64/libnss3.so: version `NSS_3.31' not found (required by /opt/nezha/nz-web/lib/chrome-linux64/chrome) /opt/nezha/nz-web/lib/chrome-linux64/chrome: /lib64/libdbus-1.so.3: no version information available (required by /opt/nezha/nz-web/lib/chrome-linux64/chrome) {code}
-
根据提示缺少 nss,dbus相关依赖
-
进一步检查 cat /etc/centos-release ,发现centos版本较低,推荐版本 7.9.2009 及以上版本 {code:java} [root@FJHD-QZ-NEZHA-SERVER-100 ~]# cat /etc/centos-release CentOS Linux release 7.4.1708 (Core) {code}
-
nss, dbus 升级后报错 {code:java} [root@FJHD-QZ-NEZHA-SERVER-100 ~]# /opt/nezha/nz-web/lib/chrome-linux64/chrome --remote-allow-origins=* --headless --disable-cache --disable-dev-shm-usage --no-sandbox --window-size=1920x1080 --lang=zh-CN.UTF-8 --print-to-pdf=./test.pdf http://127.0.0.1 /opt/nezha/nz-web/lib/chrome-linux64/chrome: symbol lookup error: /opt/nezha/nz-web/lib/chrome-linux64/chrome: undefined symbol: gbm_bo_get_modifier {code}
-
mesa-libgbm 版本低 {code:java} [root@FJHD-QZ-NEZHA-SERVER-100 ~]# rpm -qa | grep mesa-libgbm mesa-libgbm-18.3.4-10.el7.x86_64 {code}
解决:
- 从 附件中下载 nss, dbus-libs rpm 安装包,更新后重试
- 升级 mesa-libgbm-18.3.4-10.el7.x86_64
wangjunhao commented on 2024-01-26T17:00:09.123+0800:
升级 nss dbus-libs mesa-libgbm之后笔记pdf导出功能恢复正常
Attachments
Attachment: 3465f426d87221985c21b87547c7205.jpg
Attachment: dbus-libs-1.10.24-15.el7.x86_64.rpm
dbus-libs-1.10.24-15.el7.x86_64.rpm
Attachment: nss-3.44.0-7.el7_7.x86_64.rpm
Attachment: nz-web.zip
