Xpra-org / xpra

Persistent remote applications for X11; screen sharing for X11, MacOS and MSWindows.
https://xpra.org/
GNU General Public License v2.0
1.97k stars 169 forks source link

Client disconnect with error `mode 'seamless' not found in command line arguments` #3973

Closed djust-uzh closed 1 year ago

djust-uzh commented 1 year ago

Describe the bug I have a xpra proxy server running as a daemon on Ubuntu Jammy accepting connections over ssl. I can successfully connect to the server with various clients (Windows, macOS) and run programs. At some point the client crashes with the error dialog xpra initialization error: mode 'seamless' not found in command line arguments. The time frame of the crash varies. I've had sessions run as short as 30 seconds and as long as 30 minutes. The session on the server remains active and can be attached to successfully after the client crash.

The disconnects did not happen with older versions on the server, probably 4.4.3 but not sure which version.

To Reproduce Steps to reproduce the behavior:

  1. server configuration in xpra.service (port has been replaced with [port]):
[Unit]
Description=Xpra System Server
Wants=avahi-daemon.socket
Documentation=https://github.com/Xpra-org/xpra/blob/master/docs/Usage/Service.md man:xpra
After=network.target xpra.socket
Requires=xpra.socket

[Service]
Type=simple
EnvironmentFile=-/etc/default/xpra
ExecStart=/usr/bin/xpra proxy :14500 --daemon=no \
    --ssl-cert=/etc/xpra/ssl-cert.pem --ssl=on \
    --bind-ssl=0.0.0.0:[port] --ssl-auth=sys --socket-permissions=666 \
    --log-dir=/var/log --pidfile=/run/xpra/proxy.pid
#rely on SIGKILL which returns 128+15=143
SuccessExitStatus=0 143
Restart=on-abnormal
PIDFile=/run/xpra/proxy.pid
ProtectSystem=strict
ReadWritePaths=/run/xpra /tmp
#PrivateDevices=true
ProtectKernelTunables=true
ProtectControlGroups=true

[Install]
WantedBy=multi-user.target
  1. client command: xpra start ssl://[user]@[server]:[port] --ssl-server-verify-mode=none --microphone=no --speaker=no --webcam=no --printing=no
  2. specific action to trigger the bug: no discernible action taken

System Information (please complete the following information):

Additional context

image

This is probably a problem on the client side, but I cannot produce a log output on Windows (-d all does not output to cmd).

server.log [sanitized]

2023-08-23 16:48:38,190 no uinput module (not usually needed)
_XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: server already running
2023-08-23 16:48:39,429 Warning: found an existing dbus instance:
2023-08-23 16:48:39,429  DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
2023-08-23 16:48:39,499 pointer device emulation using XTest
2023-08-23 16:48:39,554 serving html content from '/usr/share/xpra/www'
2023-08-23 16:48:39,554 wrote pid 78819 to '/run/user/1000/xpra/1/server.pid'
2023-08-23 16:48:39,567 created unix domain socket '/run/user/1000/xpra/[socket]'
2023-08-23 16:48:39,567 cannot create group socket '/run/xpra/[socket]'
2023-08-23 16:48:39,567  [Errno 13] Permission denied
2023-08-23 16:48:39,568 created unix domain socket '/home/admin-vm/.xpra/[socket]'
2023-08-23 16:48:39,569 created unix domain socket '/run/user/1000/xpra/1/socket'
2023-08-23 16:48:39,569 xvfb pid=78826
2023-08-23 16:48:39,616 D-Bus notification forwarding is available
2023-08-23 16:48:39,630 pulseaudio server started with pid 78856
2023-08-23 16:48:39,630  private server socket path:
2023-08-23 16:48:39,630  '/run/user/1000/xpra/1/pulse/pulse/native'
2023-08-23 16:48:39,696 watching for applications menu changes in:
2023-08-23 16:48:39,696  '/usr/share/applications'
2023-08-23 16:48:39,696  '/var/lib/snapd/desktop/applications'
2023-08-23 16:48:39,756 Warning: webcam forwarding is disabled
2023-08-23 16:48:39,756  the virtual video directory '/sys/devices/virtual/video4linux' was not found
2023-08-23 16:48:39,756  make sure that the 'v4l2loopback' kernel module is installed and loaded
2023-08-23 16:48:39,756  or use the 'webcam=no' option
2023-08-23 16:48:39,757 found 0 virtual video devices for webcam forwarding
2023-08-23 16:48:39,814 GStreamer version 1.20.3
2023-08-23 16:48:39,973 waiting for initialization thread to complete
2023-08-23 16:48:39,973 xpra is ready.
2023-08-23 16:48:40,082 New unix-domain connection received
2023-08-23 16:48:40,082  on '/home/admin-vm/.xpra/[socket]'
2023-08-23 16:48:40,204 New unix-domain connection received
2023-08-23 16:48:40,204  on '/run/user/1000/xpra/1/socket'
2023-08-23 16:48:40,212 Handshake complete; enabling connection
2023-08-23 16:48:40,384 Warning: ffmpeg encoder testing failed with h264+mp4:
2023-08-23 16:48:40,384  Invalid argument
2023-08-23 16:48:40,385 Warning: ffmpeg encoder testing failed with mpeg4+mp4:
2023-08-23 16:48:40,385  Invalid argument
2023-08-23 16:48:40,385 Warning: ffmpeg encoder testing failed with mpeg1:
2023-08-23 16:48:40,385  Invalid argument
2023-08-23 16:48:40,386 Warning: ffmpeg encoder testing failed with mpeg2:
2023-08-23 16:48:40,386  Invalid argument
2023-08-23 16:48:40,386 ffmpeg: all the codecs have failed! (h264+mp4, mpeg4+mp4, mpeg1, mpeg2)
2023-08-23 16:48:40,428 Error: failed to allocate a CUDA context:
2023-08-23 16:48:40,428  No module named 'pycuda'
2023-08-23 16:48:40,428  NVJPEG and NVENC will not be available
2023-08-23 16:48:40,428 Python/GTK3 Microsoft Windows 10 aero client version 4.4
2023-08-23 16:48:40,428  connected from 'unknown host' as 'admin-vm'
2023-08-23 16:48:40,428  via Linux 6.2.0-26-generic proxy version 4.4.6 on '[hostname]'
2023-08-23 16:48:40,428  OpenGL is enabled with Radeon RX 570 Series
2023-08-23 16:48:40,530 xpra X11 seamless version 4.4.6-r29 64-bit
2023-08-23 16:48:40,532  uid=1000 (admin-vm), gid=1000 (admin-vm)
2023-08-23 16:48:40,532  running with pid 78819 on Linux Ubuntu 22.04 jammy
2023-08-23 16:48:40,532 setting key repeat rate from client: 500ms delay / 33ms interval
2023-08-23 16:48:40,533 setting keyboard layout to 'us'
2023-08-23 16:48:41,214 loaded 44 start menu entries from 8 sub-menus in 1.5 seconds
2023-08-23 16:48:41,273  client root window size is 4960x1500
2023-08-23 16:48:41,274   Default (1049x317 mm - DPI: 120x120) workarea: 4960x1450
2023-08-23 16:48:41,274     EV2455           2400x1500 at    0x0    (519x324 mm - DPI: 117x118) workarea: 2400x1450
2023-08-23 16:48:41,274     EV2750           2560x1440 at 2400x0    (597x336 mm - DPI: 109x109) workarea: 2560x1390 at 2400x0
2023-08-23 16:48:41,779 server virtual display now set to 4960x1500
2023-08-23 16:48:41,793 client   1 @12.532 Xpra X11 seamless server version 4.4
2023-08-23 16:48:41,794 client   1 @12.532  running on unknown
2023-08-23 16:48:41,794 client   1 @12.532 via: Linux 6.2.0-26-generic proxy version 4.4.6 on '[hostname]'
2023-08-23 16:48:41,794  connected to X11 display :1 with 24 bit colors
2023-08-23 16:48:41,795 DPI set to 120 x 120
2023-08-23 16:48:41,944 started command `rstudio` with pid 78948
2023-08-23 16:48:41,995 client   1 @12.734 running
2023-08-23 16:48:42,109 using pulseaudio device:
2023-08-23 16:48:42,109  'Monitor of Xpra Speaker'
libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
[79028:0823/164842.404530:ERROR:gpu_init.cc(523)] Passthrough is not supported, GL is desktop, ANGLE is
[79028:0823/164842.434130:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported.
2023-08-23 16:48:42,760 audio capture using 'opus' audio codec
2023-08-23 16:48:42,828 printer forwarding enabled using postscript and pdf
2023-08-23 16:48:42,837 started command `rstudio` with pid 79268
2023-08-23 16:48:42,838 230.6GB of system memory
2023-08-23 16:48:43,228 OpenGL is supported on display ':1'
2023-08-23 16:48:43,229  using 'llvmpipe (LLVM 15.0.7, 256 bits)' renderer
2023-08-23 16:48:43,230  automatic picture encoding enabled, also available:
2023-08-23 16:48:43,230   h264, vp9, vp8, png, png/P, png/L, webp, avif, rgb24, rgb32, jpeg, jpega, scroll
2023-08-23 16:48:43,231 started command `ibus-daemon` with pid 79378
[78948:0823/164843.257812:ERROR:object_proxy.cc(623)] Failed to call method: org.freedesktop.DBus.StartServiceByName: object_path= /org/freedesktop/DBus: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
[79372:0823/164843.306773:ERROR:gpu_init.cc(523)] Passthrough is not supported, GL is desktop, ANGLE is
[79372:0823/164843.332335:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported.
[79268:0823/164844.158720:ERROR:object_proxy.cc(623)] Failed to call method: org.freedesktop.DBus.StartServiceByName: object_path= /org/freedesktop/DBus: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
2023-08-23 16:51:17,302 client has requested disconnection: server shutdown (client connection lost)
2023-08-23 16:51:17,302 Disconnecting client /run/user/1000/xpra/1/socket:
2023-08-23 16:51:17,302  client request
2023-08-23 16:51:17,306 Python/GTK3 client 1 disconnected.
2023-08-23 16:51:17,306 audio capture stopping
totaam commented 1 year ago

xpra initialization error: mode 'seamless' not found in command line arguments

That's a re-connection bug. Will fix.

.. but I cannot produce a log output on Windows (-d all does not output to cmd)

Use Xpra_cmd.exe to see the command output. Or locate the client log file in %APPDATA%.

djust-uzh commented 1 year ago

Thank you very much!

If it helps, here are the ends of a couple of client logs.

2023-08-25 10:39:44,232 running
2023-08-25 10:42:42,599 Connection lost
CONNECTION_LOST, reconnecting
2023-08-25 10:42:43,307 xpra initialization error:
 mode 'seamless' not found in command line arguments

In the following log, a new session was started soon after the previous session was successfully shut down, and it crashed without the seamless error. Re-attaching was successful.

2023-08-25 10:44:43,043 running
2023-08-25 10:44:51,270 UI thread is now blocked
totaam commented 1 year ago

UI thread is now blocked

Depending on how long this lasts, this can be the source of the problem. It means that xpra's main thread doesn't get a chance to run - for whatever reason, this can eventually cause the connection to drop if the server decides that the client is unresponsive.

totaam commented 1 year ago

@djust-uzh the commit above should fix this (untested but looks correct). There are updated MS Windows builds here: https://xpra.org/beta/windows/

djust-uzh commented 1 year ago

Unfortunately, the fix did not succeed. I still get the error with the beta version on the client (Xpra-x86_64_6.0-r34116).

2023-08-25 16:02:52,161 running
2023-08-25 16:11:23,306 Connection lost
CONNECTION_LOST, reconnecting
2023-08-25 16:11:23,986 xpra initialization error:
 mode 'seamless' not found in command line arguments

I assume I don't have to update the server also. Let me know, if I can be of further help.

totaam commented 1 year ago

Sorry about that, I fat fingered the fix. Please try again with r34119 or later. Only the client needs updating.

djust-uzh commented 1 year ago

I'm sorry to bother you again, but now I get

2023-08-25 16:48:25,352 running
2023-08-25 16:50:45,039 Connection lost
CONNECTION_LOST, reconnecting
2023-08-25 16:50:45,709 xpra initialization error:
 mode 'seamless' not found in command line arguments ['xpra_cmd', 'start', 'ssl://[user]@[host]:[port]', '--ssl-server-verify-mode=none', '--no-microphone', '--no-speaker', '--no-webcam', '--no-printing', '--pulseaudio=no', '--start-child=rstudio']

with r34119. Re-attaching works.

totaam commented 1 year ago

Sorry about that. It was sloppy, I should really have tested this code before pushing it.

Now done more correctly in b2af51582f8c4c45947b686b634f75dc972b3fc2. This commit includes a unit test that re-uses the arguments you supplied. So it should also work for you and we will notice if it breaks in the future. Try r34120 or later. This will be included in the 5.0.1 release.