zevlg / telega.el

GNU Emacs telegram client (unofficial)
https://zevlg.github.io/telega.el/
GNU General Public License v3.0
1.09k stars 85 forks source link

docker: unknown server OS #332

Open WorldsEndless opened 2 years ago

WorldsEndless commented 2 years ago

tired of failing to get the tdlib version to work with me, I decided to try out the Docker solution. Unfortunately, it also failed fast:

Status (WorldsEndless): telega-server: exited abnormally with code 125 docker: unknown server OS: ...

Telega Setup

OS: openSUSE Tumbleweed Emacs: GNU Emacs 28.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.29, cairo version 1.16.0) Telega: telega v0.7.100 (TDLib v1.7.9) (telega-server v0.7.13)

Current Behavior

after setting telega to use Docker and ensuring that the docker server is running, attempting to start telega fails with the above error.

Steps to Reproduce

Set Telega to use Docker. Start command telega

zevlg commented 2 years ago

To debug docker run, set telega-debug to non-nil, then run M-x telega RET, switch to *telega-debug* buffer, and goto it's beginning, there will be a docker command used to run telega-server, try running it in the console to see why it exits prematurely.

WorldsEndless commented 2 years ago

I ran the revealed docker command and it gives me back essentially the same error:

--8<---------------cut here---------------start------------->8--- docker run --privileged -i -v /home/me/.telega:/home/me/.telega --cidfile /home/me/.telega/worldsendless/docker.cid -u 1000:100 --net=host --device /dev/snd:/dev/snd --device /dev/video0:/dev/video0 --device /dev/video1:/dev/video1 -v /dev/shm:/dev/shm -v /etc/machine-id:/etc/machine-id -v /run/user/1000:/run/user/1000 -e XDG_RUNTIME_DIR -v /var/lib/dbus -e XDG_RUNTIME_DIR --security-opt apparmor=unconfined -v /tmp/.X11-unix:/tmp/.X11-unix -v /run/user/1000/xauth_LdnfNZ:/run/user/1000/xauth_LdnfNZ -v /run/user/1000/bus:/run/user/1000/bus -e DISPLAY -e XAUTHORITY -e DBUS_SESSION_BUS_ADDRESS zevlg/telega-server:latest telega-server -l /home/me/.telega/telega-server.log -v 5

docker: unknown server OS: . --8<---------------cut here---------------end--------------->8---

I am not sure where it is even looking at the server os, though, or where that is specified.

zevlg commented 2 years ago

Docker can't run because of some "unknown server OS" error, telega can't do anything about it. Fix the problem and run again

Hopefully, this docker error is googleable

WorldsEndless commented 2 years ago

after googling, it seems like a permissions thing. When I run the above command from CLI with sudo, I see what looks like something telega should be responsible for:

sudo docker run --privileged -i -v /home/torysa/.telega:/home/torysa/.telega --cidfile /home/torysa/.telega/worldsendless/docker.cid -u 1000:100 --net=host --device /dev/snd:/dev/snd --device /dev/video0:/dev/video0 --device /dev/video1:/dev/video1 -v /dev/shm:/dev/shm -v /etc/machine-id:/etc/machine-id -v /run/user/1000:/run/user/1000 -e XDG_RUNTIME_DIR -v /var/lib/dbus -e XDG_RUNTIME_DIR --security-opt apparmor=unconfined -v /tmp/.X11-unix:/tmp/.X11-unix -v /run/user/1000/xauth_RcQvXV:/run/user/1000/xauth_RcQvXV -v /run/user/1000/bus:/run/user/1000/bus -e DISPLAY -e XAUTHORITY -e DBUS_SESSION_BUS_ADDRESS zevlg/telega-server:latest telega-server -l /home/torysa/.telega/telega-server.log -v 5 [sudo] password for root: event 91 (:@type "updateOption" :name "version" :value (:@type "optionValueString" :value "1.7.10")) event 105 (:@type "updateAuthorizationState" :authorization_state (:@type "authorizationStateWaitTdlibParameters"))

All this sudoing with docker makes me uncomfortable, though, and I wonder if I messed up a permission somewhere.

zevlg commented 2 years ago

Add yourself to the “docker” group to the access to all docker things. sudo is not required to run docker, unless you have docker settled up