Xpra-org / xpra-html5

HTML5 client for Xpra
Mozilla Public License 2.0
209 stars 55 forks source link

no start menu entry in HTML5 client v9.0 #263

Closed TermeHansen closed 8 months ago

TermeHansen commented 1 year ago

I just updated to the new 9.0 release, and suddenly there is no start menu entry??

image

totaam commented 1 year ago

What distro, package, version, etc.

Please see https://github.com/Xpra-org/xpra/wiki/Reporting-Bugs

TermeHansen commented 1 year ago

Running on Ubuntu 22.04

$ xpra --version
xpra v5.0.1-r0
> sudo apt list xpra
Listing... Done
xpra/jammy,now 5.0.1-r0-1 amd64 [installed]
Package: xpra-html5
Versions: 
9.0-r1481-1

image

using the xpra-client the start menu is there fine. image

TermeHansen commented 1 year ago

just downgraded xpra-html5 to 8.1-r9-1 and now the start menu is there again...

totaam commented 1 year ago

v5 servers need a compatibility flag, the commit above fixes that. Until the next update is released, you can also use xpra v6 builds from the beta area. (v6 no longer requires this flag)

Rush-iam commented 10 months ago

@totaam, the problem with the missing menu is returned in v10.0

totaam commented 10 months ago

What's your server version?

Rush-iam commented 10 months ago

The server is the latest 5.0.3

Rush-iam commented 10 months ago

Should I create a new issue?

totaam commented 10 months ago

Should I create a new issue?

What's wrong with this one?

totaam commented 10 months ago

v10 has been released and I couldn't reproduce menu issues, please try that first. Preferably with a 5.0.4 server.

Rush-iam commented 10 months ago

Hmm... I can't find 5.0.4 in Ubuntu 22.04:

> apt list -a xpra-common
Listing... Done
xpra-common/jammy 5.0.3-r1-1 amd64
xpra-common/jammy 5.0.2-r0-1 amd64
xpra-common/jammy 5.0.1-r0-1 amd64
xpra-common/jammy 5.0-r0-1 amd64
totaam commented 10 months ago

Ah, right. Ubuntu Jammy. I was meant to get back to that one. It failed to build because of the outdated Cython in the Ubuntu repositories. We have a workaround specifically for this: https://github.com/Xpra-org/xpra/blob/8f72bb11c02b9caeee885304093f581bf153b431/packaging/debian/xpra.sh#L36-L39, but for whatever reason, it was still falling over because it preferred the old one to the one we install. Now forced: https://github.com/Xpra-org/xpra/commit/1d84ece83249956a248e374ce818720b4422b4cc The 5.0.4 are now in the stable repository. Sorry about the delay.

Rush-iam commented 9 months ago

Thanks!

I tried 5.0.4 + v10, and there is no application menu. v9.1 is fine.

totaam commented 9 months ago

Ouch, looks like the fix that had landed in 9.1 somehow went MIA in 10.x: 1378ff914aab1b382fb2ddd6471d4d33200bbd07 I will release 10.1 with that fix.

Rush-iam commented 9 months ago

I tried 10.1, but the application menu is still lacking :(

totaam commented 9 months ago

@Rush-iam please look in your server log and browser console, there must be a message somewhere.

Rush-iam commented 9 months ago

I haven't found anything suspicious during connecting.

Here is a log of the server:

Warning: running as root

2023-12-15 15:22:02,730 created ws socket '0.0.0.0:8998'
2023-12-15 15:22:02,732 no uinput module (not usually needed)
2023-12-15 15:22:04,397 pointer device emulation using XTest
2023-12-15 15:22:04,449 serving html content from '/usr/share/xpra/www'
2023-12-15 15:22:04,450 wrote pid 38920 to '/run/xpra/0/server.pid'
2023-12-15 15:22:04,469 created unix domain socket '/run/xpra/0/socket'
2023-12-15 15:22:04,469 xvfb pid=38938
2023-12-15 15:22:04,583 xpra is ready.
2023-12-15 15:22:04,583 xpra X11 seamless server version 5.0.4-r0M
2023-12-15 15:22:04,597  uid=0 (root), gid=0 (root)
2023-12-15 15:22:04,597  running with pid 38920 on Linux Ubuntu 22.04 jammy
2023-12-15 15:22:04,728  connected to X11 display :0 with 24 bit colors
2023-12-15 15:22:04,732 watching for applications menu changes in:
2023-12-15 15:22:04,732  '/usr/share/applications'
2023-12-15 15:22:05,217 CUDA initialization (this may take a few seconds)
2023-12-15 15:22:05,330 CUDA 11.2.0 / PyCUDA 2023.1, found 1 device:
2023-12-15 15:22:05,335   + Tesla T4 @ 0000:00:1E.0 (memory: 99% free, compute: 7.5)
2023-12-15 15:22:05,363 loaded 2 start menu entries from 1 sub-menus in 0.5 seconds
2023-12-15 15:22:05,373 NVidia driver version 470.182.3
2023-12-15 15:22:05,446 Error: failed to load module from buffer for 'BGRX_to_NV12'
2023-12-15 15:22:05,447  cuModuleLoadDataEx failed: device kernel image is invalid - 
2023-12-15 15:22:05,447  cannot load nvenc (nvenc encoder)
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/xpra/codecs/loader.py", line 88, in codec_import_check
    init_module()
  File "xpra/codecs/nvidia/nvenc/encoder.pyx", line 3028, in xpra.codecs.nvidia.nvenc.encoder.init_module
  File "xpra/codecs/nvidia/nvenc/encoder.pyx", line 3089, in xpra.codecs.nvidia.nvenc.encoder.init_module
  File "xpra/codecs/nvidia/nvenc/encoder.pyx", line 1681, in xpra.codecs.nvidia.nvenc.encoder.Encoder.init_context
  File "xpra/codecs/nvidia/nvenc/encoder.pyx", line 1726, in xpra.codecs.nvidia.nvenc.encoder.Encoder.init_device
  File "xpra/codecs/nvidia/nvenc/encoder.pyx", line 1728, in xpra.codecs.nvidia.nvenc.encoder.Encoder.init_device
  File "xpra/codecs/nvidia/nvenc/encoder.pyx", line 1872, in xpra.codecs.nvidia.nvenc.encoder.Encoder.init_cuda_kernel
RuntimeError: failed to load 'BGRX_to_NV12' for cuda context <pycuda._driver.Context object at 0x7f60f6fc4dd0>
2023-12-15 15:22:05,448 30.9GB of system memory
2023-12-15 15:22:05,794 OpenGL is not supported on this display
2023-12-15 15:22:05,794  `xpra-client-gtk3` is not installed
2023-12-15 15:22:39,132 Handshake complete; enabling connection
2023-12-15 15:22:39,143 HTML5 Posix Chrome client version 9.0
2023-12-15 15:22:39,144 setting keyboard layout to 'gb'
2023-12-15 15:22:39,199  client root window size is 3744x2096
2023-12-15 15:22:39,200   Google Chrome 119 (991x555 mm - DPI: 96x96)
2023-12-15 15:22:39,702 ouch, failed to set new resolution: 'xpra.x11.bindings.randr.RandRBindingsInstance' object has no attribute 'check_randr'
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/xpra/x11/x11_server_core.py", line 779, in set_screen_size
    if RandR.check_randr():
AttributeError: 'xpra.x11.bindings.randr.RandRBindingsInstance' object has no attribute 'check_randr'
2023-12-15 15:22:39,705  automatic picture encoding enabled, also available:
2023-12-15 15:22:39,705   jpeg, png, png/P, png/L, rgb32, rgb24, webp, avif
2023-12-15 15:22:39,795 client   1 startup complete
2023-12-15 15:22:39,795 client   1 connection-established
2023-12-15 15:22:39,795 client   1 update encodings: encodings,encodings.core,encodings.allowed,encodings.lossless,encodings.with_speed,encodings.with_quality,encodings.with_lossless_mode
2023-12-15 15:24:49,413 client   1 visibilitychange hidden= true connected= true

And the client:

Utilities.js:1 draw animation_cb 867.734 fps -1 vrefresh -1
Utilities.js:1 document is ready, browser is Linux x86_64 64-bit: true
Utilities.js:1 draw animation_cb 884.401 fps 59 vrefresh -1
Utilities.js:1 draw animation_cb 901.084 fps 59 vrefresh -1
Utilities.js:1 draw animation_cb 917.751 fps 59 vrefresh -1
Utilities.js:1 draw animation_cb 934.417 fps 59 vrefresh -1
Utilities.js:1 draw animation_cb 951.084 fps 59 vrefresh -1
Utilities.js:1 draw animation_cb 967.751 fps 59 vrefresh -1
Utilities.js:1 draw animation_cb 984.418 fps 59 vrefresh -1
Utilities.js:1 draw animation_cb 1001.085 fps 59 vrefresh -1
Utilities.js:1 draw animation_cb 1017.752 fps 59 vrefresh -1
Utilities.js:1 draw animation_cb 1034.419 fps 59 vrefresh -1
Utilities.js:1 network got default settings: {blocked-hosts: 'xpra.org,www.xpra.org', min-quality: '10', min-speed: '50'}
Utilities.js:1 mouse set_touchaction() touchaction= none label= zoom
Utilities.js:1 using sound = false  from parameters
Utilities.js:1 using audio_codec = mediasource:opus+mka  from parameters
Utilities.js:1 using offscreen = false  from parameters
Utilities.js:1 using encoding = auto  from parameters
Utilities.js:1 using bandwidth_limit = 0  from parameters
Utilities.js:1 using action = connect  from parameters
Utilities.js:1 using submit = true  from parameters
Utilities.js:1 using port = 8998  from parameters
Utilities.js:1 using ssl = true  from parameters
Utilities.js:1 using keyboard_layout = gb  from parameters
Utilities.js:1 using exit_with_children = false  from parameters
Utilities.js:1 using exit_with_client = false  from parameters
Utilities.js:1 using sharing = false  from parameters
Utilities.js:1 using video = false  from parameters
Utilities.js:1 using mediasource_video = false  from parameters
Utilities.js:1 using insecure = false  from parameters
Utilities.js:1 using ignore_audio_blacklist = false  from parameters
Utilities.js:1 using keyboard = false  from parameters
Utilities.js:1 using clipboard = true  from parameters
Utilities.js:1 using printing = true  from parameters
Utilities.js:1 using file_transfer = true  from parameters
Utilities.js:1 using steal = true  from parameters
Utilities.js:1 using reconnect = true  from parameters
Utilities.js:1 using swap_keys = false  from parameters
Utilities.js:1 using scroll_reverse_x = false  from parameters
Utilities.js:1 using scroll_reverse_y = false  from parameters
Utilities.js:1 using floating_menu = true  from parameters
Utilities.js:1 using toolbar_position = top  from parameters
Utilities.js:1 using autohide = false  from parameters
Utilities.js:1 using vrefresh = 60  from parameters
Utilities.js:1 using debug_main = false  from parameters
Utilities.js:1 using debug_keyboard = false  from parameters
Utilities.js:1 using debug_geometry = false  from parameters
Utilities.js:1 using debug_mouse = false  from parameters
Utilities.js:1 using debug_clipboard = false  from parameters
Utilities.js:1 using debug_draw = false  from parameters
Utilities.js:1 using debug_audio = false  from parameters
Utilities.js:1 using debug_network = false  from parameters
Utilities.js:1 using debug_file = false  from parameters
Utilities.js:1 debug enabled for: []
Utilities.js:1 no clipboard write support: no images, navigator.clipboard= Clipboard {}
Utilities.js:1 encoding: auto
Utilities.js:1 using min-speed = 50  from default settings
Utilities.js:1 encoding:  min-speed = 50
Utilities.js:1 using min-quality = 10  from default settings
Utilities.js:1 encoding:  min-quality = 10
Utilities.js:1 using debug_main = false  from parameters
Utilities.js:1 connection_progress( Initializing ,   ,  20 )
Utilities.js:1 audio codec MediaSource supported: [mp3: 'audio/mpeg', opus+mka: 'audio/webm; codecs="opus"', vorbis+mka: 'audio/webm; codecs="vorbis"']
Utilities.js:1 audio codec MediaSource not available: {aac+mpeg4: 'audio/mp4; codecs="mp4a.40.2"', mp3+mpeg4: 'audio/mp4; codecs="mp3"', ogg: 'audio/ogg', wav: 'audio/wav', flac: 'audio/flac', …}
Utilities.js:1 audio aurora codecs supported: Map(0) {wav: 'lpcm', size: 0}
Utilities.js:1 audio aurora codecs not available: Map(0) {mp3+id3v2: 'mp3', flac: 'flac', aac+mpeg4: 'mp4a', size: 0}
Utilities.js:1 using mediasource audio codec: opus+mka
Utilities.js:1 audio codecs:  (4) ['mp3', 'opus+mka', 'vorbis+mka', 'wav']
Utilities.js:1 using blocked-hosts = xpra.org,www.xpra.org  from default settings
OffscreenDecodeWorkerHelper.js:1 offscreen canvas is available with Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36
Utilities.js:1 we have webworker support
Utilities.js:1 using offscreen decode worker
Utilities.js:1 decode worker will check: (11) ['jpeg', 'png', 'png/P', 'png/L', 'rgb', 'rgb32', 'rgb24', 'scroll', 'webp', 'void', 'avif']
Utilities.js:1 using keyboard = false  from parameters
Utilities.js:1 using clock = true  from parameters
Utilities.js:1 got a keyboard layout map: KeyboardLayoutMap {size: 48}
Utilities.js:1 keys: (48) ['KeyE', 'KeyD', 'KeyU', 'Minus', 'KeyH', 'KeyZ', 'Equal', 'KeyP', 'Semicolon', 'BracketRight', 'Slash', 'BracketLeft', 'KeyL', 'Digit8', 'KeyW', 'KeyS', 'Digit5', 'Digit9', 'KeyO', 'Period', 'Digit6', 'KeyV', 'Digit3', 'Backquote', 'KeyG', 'KeyJ', 'KeyQ', 'Digit1', 'KeyT', 'KeyY', 'Quote', 'IntlBackslash', 'Backslash', 'KeyK', 'KeyF', 'KeyI', 'KeyR', 'KeyX', 'KeyA', 'Digit2', 'Digit7', 'KeyM', 'Digit4', 'Digit0', 'KeyN', 'KeyB', 'KeyC', 'Comma']
Utilities.js:1 we can use websocket in webworker
Utilities.js:1 connection_progress( Opening WebSocket connection ,   ,  50 )
Utilities.js:1 we can decode using a worker: Worker {onmessage: null, onerror: null}
Utilities.js:1 full list of supported encodings: (10) ['jpeg', 'png', 'png/P', 'png/L', 'rgb', 'rgb32', 'rgb24', 'webp', 'void', 'avif']
Utilities.js:1 connection_progress( WebSocket connection established ,   ,  80 )
Utilities.js:1 sending hello
Utilities.js:1 using new navigator.clipboard
Utilities.js:1 sending hello capabilities {version: '9.0', client_type: 'HTML5', display: '', build: {…}, platform: {…}, …}
Utilities.js:1 received hello capabilities {digest: Array(12), salt-digest: Array(10), compressors: Array(4), encoders: Array(4), flush: true, …}
Utilities.js:1 got hello: server version 5.0 accepted our connection
Utilities.js:1 audio-state: disabled
Utilities.js:1 server screen sizes: (2) [Array(2), Array(2)]
Utilities.js:1 connection_progress( Session started ,   ,  100 )
Utilities.js:1 using toolbar_position = top  from parameters
Utilities.js:1 using floating_menu = true  from parameters
Utilities.js:1 using autohide = false  from parameters
Utilities.js:1 startup complete
Utilities.js:1 connection-established
Utilities.js:1 update encodings: (7) ['encodings', 'encodings.core', 'encodings.allowed', 'encodings.lossless', 'encodings.with_speed', 'encodings.with_quality', 'encodings.with_lossless_mode']
Utilities.js:1 visibilitychange hidden= true connected= true
Utilities.js:1 visibilitychange hidden= false connected= true
Utilities.js:1 visibilitychange hidden= true connected= true
Utilities.js:1 visibilitychange hidden= false connected= true
Rush-iam commented 9 months ago

It is out of this issue: I discovered NVJPEG does not work in Xpra 5.0.4 with my system, though 5.0.3 works fine without the errors below. It may be intended to require newer drivers, but I am reporting my findings just in case (I haven't found new requirements in the release notes).

2023-12-15 15:22:05,446 Error: failed to load module from buffer for 'BGRX_to_NV12'
2023-12-15 15:22:05,447  cuModuleLoadDataEx failed: device kernel image is invalid - 
2023-12-15 15:22:05,447  cannot load nvenc (nvenc encoder)
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/xpra/codecs/loader.py", line 88, in codec_import_check
    init_module()
  File "xpra/codecs/nvidia/nvenc/encoder.pyx", line 3028, in xpra.codecs.nvidia.nvenc.encoder.init_module
  File "xpra/codecs/nvidia/nvenc/encoder.pyx", line 3089, in xpra.codecs.nvidia.nvenc.encoder.init_module
  File "xpra/codecs/nvidia/nvenc/encoder.pyx", line 1681, in xpra.codecs.nvidia.nvenc.encoder.Encoder.init_context
  File "xpra/codecs/nvidia/nvenc/encoder.pyx", line 1726, in xpra.codecs.nvidia.nvenc.encoder.Encoder.init_device
  File "xpra/codecs/nvidia/nvenc/encoder.pyx", line 1728, in xpra.codecs.nvidia.nvenc.encoder.Encoder.init_device
  File "xpra/codecs/nvidia/nvenc/encoder.pyx", line 1872, in xpra.codecs.nvidia.nvenc.encoder.Encoder.init_cuda_kernel
RuntimeError: failed to load 'BGRX_to_NV12' for cuda context <pycuda._driver.Context object at 0x7f60f6fc4dd0>
...
2023-12-15 15:22:39,702 ouch, failed to set new resolution: 'xpra.x11.bindings.randr.RandRBindingsInstance' object has no attribute 'check_randr'
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/xpra/x11/x11_server_core.py", line 779, in set_screen_size
    if RandR.check_randr():
AttributeError: 'xpra.x11.bindings.randr.RandRBindingsInstance' object has no attribute 'check_randr'
totaam commented 9 months ago

cuModuleLoadDataEx failed: device kernel image is invalid

I guess this is a driver thing. I thought that NVidia had good ABI versioning, but perhaps not for kernel images then. We do compile with support for most arches: https://github.com/Xpra-org/xpra/blob/824d488b11d78df580657181fcb10d8021c6c78d/setup.py#L2290C35-L2290C78 Only sm2x was removed, and that was in v5.0

AttributeError: 'xpra.x11.bindings.randr.RandRBindingsInstance' object has no attribute 'check_randr'

Oops, minor buggy backport in 5.0.4 - can only affect DPI, fixed in https://github.com/Xpra-org/xpra/commit/30c7cfa5a9f119aac300b5652d3d545f9ca799cf

offscreen canvas is available with Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36

Have you tried other browsers? Have you cleared the browser caches, etc?

Can you try running your server with -d menu,exec

Rush-iam commented 9 months ago

Clearing browser cache didn't help.. and I don't have a different browser - I am on Chrome OS. -d menu,exec is probably not much related to the client I have the issue with, I get new log lines mostly for server initialization.

I got a small hint:

Client 8.1

2023-12-18 22:25:56,845 get_menu_data(False, False, True)
2023-12-18 22:25:56,845 1 entries sent in initial data
2023-12-18 22:25:56,845 exec_on_connect_commands() start=[], start_child=[]
2023-12-18 22:25:56,849 DPI set to 96 x 96
2023-12-18 22:25:56,931 client   1 startup complete
2023-12-18 22:25:56,931 client   1 connection-established
2023-12-18 22:25:57,048 client   1 received xdg start menu data
2023-12-18 22:25:57,055 client   1 update encodings: encoding.rgb.version,encoding.pillow.version,encoding.webp.version,encoding.jpeg.version,encoding.avif.version,encoding.nvjpeg.version,encoding.vpx.version,encoding.nvenc.version,encodings,encodings.core,encodings.allowed,encodings.lossless,encodings.with_speed,encodings.with_quality,encodings.with_lossless_mode

Client 10.1

2023-12-18 22:30:08,564 get_menu_data(False, False, True)
2023-12-18 22:30:08,565 1 entries sent in initial data
2023-12-18 22:30:08,565 exec_after_connect_commands() start=[], start_child=[]
2023-12-18 22:30:08,565 exec_on_connect_commands() start=[], start_child=[]
2023-12-18 22:30:08,568 DPI set to 96 x 96
2023-12-18 22:30:08,649 client   1 startup complete
2023-12-18 22:30:08,650 client   1 connection-established
2023-12-18 22:30:08,650 client   1 update encodings: encodings,encodings.core,encodings.allowed,encodings.lossless,encodings.with_speed,encodings.with_quality,encodings.with_lossless_mode

You can see, 2023-12-18 22:25:57,048 client 1 received xdg start menu data is missing for 10.1 (and the encoding list is much shorter, though it is not related, I suppose).

totaam commented 9 months ago

received xdg start menu data is here: https://github.com/Xpra-org/xpra-html5/blob/52742e3f78fee5c098778f68094f7c58e603f22a/html5/js/Client.js#L2826-L2827 And it is called from: https://github.com/Xpra-org/xpra-html5/blob/52742e3f78fee5c098778f68094f7c58e603f22a/html5/js/Client.js#L2900-L2907 SHOW_START_MENU is always true: https://github.com/Xpra-org/xpra-html5/blob/52742e3f78fee5c098778f68094f7c58e603f22a/html5/js/Client.js#L20

The server sends the xdg-menu setting as part of the initial data if the connection supports xdg-menu-update: https://github.com/Xpra-org/xpra/blob/0c71089c7e45981671f64a21ba52b2ee82214a65/xpra/server/mixins/child_command.py#L163-L176 And xdg-menu-update defaults to true since https://github.com/Xpra-org/xpra/commit/c1618738fd6fe4ec24c86c08e63e6e75743a1571: https://github.com/Xpra-org/xpra/blob/0c71089c7e45981671f64a21ba52b2ee82214a65/xpra/server/source/client_connection.py#L208-L209

So I was completely wrong to push 10.1 with the xdg-menu-update flag, it should not make any difference. My guess is that your system has some old copy of the code somewhere.

Rush-iam commented 9 months ago

I have altered the source code of a client and added this log line:

_process_setting_change(packet) {
    const setting = packet[1];
    const value = packet[2];
    this.log("!!!!!!!!!!!!", setting, value);
    if (setting == "xdg-menu" && SHOW_START_MENU) {
      this.xdg_menu = value;
      if (this.xdg_menu) {
        this.process_xdg_menu();
        $("#startmenuentry").show();
      }
    }
  }

I see Client 9.1 prints this line on connect, but 10.1 does not (_process_setting_change is not called).

cpatulea commented 9 months ago

Server: v5.0.4 (local build, on Debian 11) Client: html5 master (commit af92392)

Note at that revision, Client.js does not have xdg-menu-update capability (and no start menu). It was removed in a6a8f59 (perhaps by accident).

Cherry-picked 1378ff9 and try again:

Server log:

2023-12-30 13:46:13,661 get_menu_data(False, False, True)
2023-12-30 13:46:13,661 startup_complete()
2023-12-30 13:46:13,661 11 entries sent in initial data

Client log:

sending hello capabilities  ... xdg-menu-update: true
received hello capabilities ... xdg-menu-update: true

Client breakpoint on _process_setting_change, never executed.

cpatulea commented 9 months ago

I think the cause is that a6a8f59 also (accidentally?) dropped client capability setting-change. So server v5.0.4 suppresses any setting-change events: https://github.com/Xpra-org/xpra/blob/1321eed2383070b71a08a08c0886b13b530a0c15/xpra/server/source/client_connection.py#L395

totaam commented 8 months ago

Version 11 has been released with this fix: https://github.com/Xpra-org/xpra-html5/releases/tag/v11.0