hiroi-sora / Umi-OCR

OCR software, free and offline. 开源、免费的离线OCR软件。支持截屏/批量导入图片,PDF文档识别,排除水印/页眉页脚,扫描/生成二维码。内置多国语言库。
MIT License
25.38k stars 2.57k forks source link

docker-compose restart 的时候启动报错:qt.qpa.xcb: could not connect to display :99 qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. #641

Closed BigGan closed 1 week ago

BigGan commented 2 weeks ago

Issues

Umi-OCR version 程序版本

2.1.4

Windows version 系统版本

linux docker

OCR plugins Used 使用的OCR插件

No response

Reproduction steps 复现步骤

docker-compose restart 的时候启动报错:

qt.qpa.xcb: could not connect to display :99
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.
/app/umi-ocr.sh: line 45:    13 Aborted                 (core dumped) python3 UmiOCR-data/main_linux.py "$@"

只有 docker-compose down 再 up 才正常, restart 或者开机重启都报错

Problem screenshots or related files (optional) 问题截图或相关文件(可选)

No response

hiroi-sora commented 2 weeks ago

感谢反馈,确有其事。

经过研究,发现问题出在上次容器退出时, Xvfb 服务的锁文件仍遗留。下次重启时,由于检测到锁,所以 Xvfb 无法开启,导致 Umi-OCR 的QT进程无法启动。

我已更新了 Dockerfile 和启动脚本以解决此问题,实测重启系统后容器能正确启动。请参考 README-docker ,下载最新的 Dockerfile ,重新 build 一个镜像。

(另外,你可以修改下 Dockerfile ,将 Umi-OCR_Linux_Paddle_2.1.4 程序本体放置在宿主机,挂载到容器内。方便后续手动修改程序代码。)

BigGan commented 2 weeks ago

感谢反馈,确有其事。

经过研究,发现问题出在上次容器退出时, Xvfb 服务的锁文件仍遗留。下次重启时,由于检测到锁,所以 Xvfb 无法开启,导致 Umi-OCR 的QT进程无法启动。

我已更新了 Dockerfile 和启动脚本以解决此问题,实测重启系统后容器能正确启动。请参考 README-docker ,下载最新的 Dockerfile ,重新 build 一个镜像。

(另外,你可以修改下 Dockerfile ,将 Umi-OCR_Linux_Paddle_2.1.4 程序本体放置在宿主机,挂载到容器内。方便后续手动修改程序代码。)

Thx hiroi-sora :) you are great! 修复得好快呀 👍