Xpra: Ticket #1515: bencode parsing error from the HTML client depending on the remotized window height

I'm experiencing a failure to display the remote session from the HTML client when the size of one of the window is too big. The end result is that the browser will be directed to the connect.html page and it will show the error:

You were disconnected for the following reason: failed to parse bencode packet

This is the log on the client console:

websocket error:  undefined reason:  failed to parse bencode packet  Client.js:1382:2
    XpraClient.prototype._process_error http://xx.xx.xx.xx:5999/js/Client.js:1382:2
    XpraClient.prototype._route_packet http://xx.xx.xx.xxx:5999/js/Client.js:484:3
    XpraProtocolWorkerHost.prototype.open/< http://xx.xx.xx.xx:5999/js/Protocol.js:46:6
websocket closed:  undefined reason:  failed to parse bencode packet reconnect:  true , reconnect attempt:  0

The following is an excerpt from the server log:

2017-05-11 08:37:39,192 processing packet logging
2017-05-11 08:37:39,192 process non-ui packet logging
2017-05-11 08:37:39,192 client 4: got hello: server version 2.1 accepted our connection
2017-05-11 08:37:39,193 processing packet ping
2017-05-11 08:37:39,193 process non-ui packet ping
2017-05-11 08:37:39,193 processing packet focus
2017-05-11 08:37:39,193 will process ui packet focus
2017-05-11 08:37:39,193 processing packet configure-window
2017-05-11 08:37:39,194 will process ui packet configure-window
2017-05-11 08:37:39,194 Error parsing bencode packet:
2017-05-11 08:37:39,195  invalid literal for long() with base 10: 'NaN'
2017-05-11 08:37:39,195 failed to parse bencode packet: 6c31363a636f6e6669677572652d77696e646f77693165693065694e614e656931393230656931303830656432313a656e636f64696e67732e7267625f666f726d6174736c343a52474258343a52474241656565
2017-05-11 08:37:39,196  invalid literal for long() with base 10: 'NaN'
2017-05-11 08:37:39,196  data: 'l16:configure-windowi1ei0eiNaNei1920ei1080ed21:encodings.rgb_formatsl4:RGBX4:RGBAeee'
2017-05-11 08:37:39,198  packet index=0, packet size=84, buffer size=214
2017-05-11 08:37:39,198 untilConcludes(<bound method SocketConnection.is_active of tcp socket: xx.xx.xx.xx:5999 <- xx.xx.xx.xx:47797>, <built-in method recv of _socket.socket object at 0x7f771cb80c38>, (8192, 2), {}) timed out, retry=socket.timeout
2017-05-11 08:37:39,196 add_packet_to_queue(ping_echo ...)
2017-05-11 08:37:39,200 will process ui packet gibberish
2017-05-11 08:37:39,200 Received uninterpretable nonsense from Protocol(tcp websocket: xx.xx.xx.xx:5999 <- xx.xx.xx.xx:47799): failed to parse bencode packet
2017-05-11 08:37:39,200  data: 'l16:configure-windowi1ei0eiNaNei1920ei1080ed21:encodings.rgb_formatsl4:RGBX4:RGBAeee'
2017-05-11 08:37:39,200 disconnect_client(Protocol(tcp websocket: xx.xx.xx.xx <- xx.xx.xx.xx), failed to parse bencode packet, ())
2017-05-11 08:37:39,200 disconnect_protocol(Protocol(tcp websocket: xx.xx.xx.xx:5999 <- xx.xx.xx.xx:47799), failed to parse bencode packet, ())
2017-05-11 08:37:39,201 Disconnecting client xx.xx.xx.xx:47799:
2017-05-11 08:37:39,201  failed to parse bencode packet
2017-05-11 08:37:39,201 flush_then_close(['disconnect', 'failed to parse bencode packet'], None) closed=False

Server display size is 1366x768, according to my test I got a failure in case the window height is >= 747.

The window is created by running the command on the server:

DISPLAY=:NNN ffmpeg -f lavfi -re -i testsrc=s=WxH -f sdl out

(NNN being the display number of the xpra service).



Fri, 12 May 2017 06:55:31 GMT - Antoine Martin: owner changed; milestone set

Please specify the OS and browser used, the exact xpra version and revision. Is this a regression in trunk? (ie: does this also occur if you run 2.0.x?)

Can you reproduce with this test application: browser/xpra/trunk/src/tests/xpra/test_apps/test_window_fixed_size.py


Fri, 12 May 2017 07:07:01 GMT - Antoine Martin: owner, status changed

Never mind, reproduced it with chrome. Fix to follow.


Fri, 12 May 2017 08:17:18 GMT - Antoine Martin: owner, status changed

Fixed in r15815. (this was caused by the work in #1491)

@saste: please close this ticket if the fix works for you.


Fri, 12 May 2017 08:35:52 GMT - saste:

Replying to Antoine Martin:

Please specify the OS and browser used, the exact xpra version and revision.

$ xpra --version
xpra v2.1-r15796

Note that today I updated to the latest version (r15814), *but* it is still showing the same version as before.

$ uname -a
Linux 4.11.0-0.rc6.git0.1.fc26.x86_64 #1 SMP Mon Apr 10 19:45:50 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
$ cat  /etc/fedora-release
Fedora release 26 (Twenty Six)

Is this a regression in trunk? (ie: does this also occur if you run 2.0.x?)

Didn't yet try, will do later.

Can you reproduce with this test application: browser/xpra/trunk/src/tests/xpra/test_apps/test_window_fixed_size.py

It is working fine with the test app. I also tried with glxgears -geometry 1920x1080 and it is working fine as well.

With either ffmpeg or vlc it is failing though, looks like it depends on the X client.


Fri, 12 May 2017 10:57:31 GMT - Antoine Martin:

Note that today I updated to the latest version (r15814), *but* it is still showing the same version as before.

r15817 is available now, r15815 contains the fix.


Fri, 12 May 2017 12:49:06 GMT - saste: status changed; resolution set

Confirm that it's fixed in -r15819, thank you.


Sat, 23 Jan 2021 05:26:24 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/1515