xorilog / docker-telegram

Dockerfile for a Telegram gui client
65 stars 32 forks source link

error: XDG_RUNTIME_DIR is invalid or not set in the environment #27

Open Zapa3a opened 2 weeks ago

Zapa3a commented 2 weeks ago

I am running with command

sudo docker run --rm -it --name telegram \
       --hostname=$(hostname) \
       -e DISPLAY=unix$DISPLAY \
       -e PULSE_SERVER=unix:$XDG_RUNTIME_DIR/pulse/native \
       -e XAUTHORITY=$XAUTHORITY \
       -v $XAUTHORITY:$XAUTHORITY \
       -v /dev/snd:/dev/snd --privileged \
       -v /tmp/.X11-unix:/tmp/.X11-unix \
       -v "/home/$(whoami)/.Xauthority:/home/user/.Xauthority" \
       -v $XDG_RUNTIME_DIR/pulse:$XDG_RUNTIME_DIR/pulse \
       -v /etc/localtime:/etc/localtime:ro \
       -v /.local/share/TelegramDesktop/ \
       xorilog/telegram

and everything works well, except new telegram bots like '@wallet' and other, which are trying to open a new window for their work then my container crushes with terminal output:

qt.gui.imageio.jpeg: ./lib/jpegli/decode_scan.cc:535: Incomplete scan detected.
qt.gui.imageio.jpeg: ./lib/jpegli/decode_scan.cc:535: Incomplete scan detected.
qt.gui.imageio.jpeg: ./lib/jpegli/decode_scan.cc:535: Incomplete scan detected.
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-user'
error: XDG_RUNTIME_DIR is invalid or not set in the environment
Fatal: Failed to open server socket: "6ce7de587ddacca886605fc2d7c74451-TelegramDesktop-webview-291-wayland". XDG_RUNTIME_DIR is: ""

or

qt.gui.imageio.jpeg: ./lib/jpegli/decode_scan.cc:535: Incomplete scan detected.
qt.gui.imageio.jpeg: ./lib/jpegli/decode_scan.cc:535: Incomplete scan detected.
qt.gui.imageio.jpeg: ./lib/jpegli/decode_scan.cc:535: Incomplete scan detected.
[libvpx-vp9 @ 0x7f1100ce9400] v1.13.0
[libvpx-vp9 @ 0x7f1100ce9400] v1.13.0
[libvpx-vp9 @ 0x7f1100ce9800] v1.13.0
[libvpx-vp9 @ 0x7f1100ce9800] v1.13.0
qt.gui.imageio.jpeg: ./lib/jpegli/decode_scan.cc:535: Incomplete scan detected.
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-user'
error: XDG_RUNTIME_DIR is invalid or not set in the environment
Fatal: Failed to open server socket: "6ce7de587ddacca886605fc2d7c74451-TelegramDesktop-webview-308-wayland". XDG_RUNTIME_DIR is: ""

depending on which bot im launching

Ubuntu 23.04, xorilog/telegram:latest

xorilog commented 2 weeks ago

Hello @Zapa3a , this seems to be related to webview & wayland, unfortunately i am not familiar with webview and this docker container uses X11 instead of wayland. You can try following this: https://github.com/mviereck/x11docker/wiki/How-to-provide-Wayland-socket-to-docker-container and if it works for you i would be happy to add it as a running example. Let me know how it goes :)

Zapa3a commented 2 weeks ago

So, with wayland it opens webview windows like wallet bot, but there is another issue with WebKitGTK

5

and installation of provided packages does not helps. now there is a telegram warning message: (Telegram:229): GLib-GIO-WARNING **: 22:09:57.515: Your application does not implement g_application_activate() and has no handlers connected to the 'activate' signal. It should do one of these.

Zapa3a commented 2 weeks ago

I`ve checked it on fedora with native XWayland and its also works like wayland composer on ubuntu, and installing WebKitGTK does not helps. But official Telegram app works with webview apps well, so i can think there is a trouble in your docker telegram version or appimage. Because all window management now works on both OS

UPD: info from log docker telegram version 5.0.1, official working app version 5.1.5