Xpra: Ticket #1729: Chromebooks browser can't connect: invalid packet header format

Xenials Firefox can connect to the same server. Chromebooks browser tries to connect number of times, but eventually gives up. Server is running on Ubuntu Xenial.

Attached server log shows successful connection with Firefox and failed connection with chromebook.

Browsers chrome://version:

Google Chrome	64.0.3282.41 (Official Build) beta (64-bit)
Revision	0
Platform	10176.22.0 (Official Build) beta-channel auron_paine
Firmware Version	Google_Auron_paine.6301.58.98
ARC	4510202
JavaScript	V8 6.4.388.9
Flash	28.0.0.133 /opt/google/chrome/pepper/libpepflashplayer.so
User Agent	Mozilla/5.0 (X11; CrOS x86_64 10176.22.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.41 Safari/537.36
Command Line	/opt/google/chrome/chrome --ppapi-flash-path=/opt/google/chrome/pepper/libpepflashplayer.so --ppapi-flash-version=28.0.0.133 --ui-prioritize-in-gpu-process --use-gl=egl --enable-native-gpu-memory-buffers --gpu-sandbox-failures-fatal=yes --enable-logging --log-level=1 --use-cras --enable-wayland-server --user-data-dir=/home/chronos --max-unused-resource-memory-usage-percentage=5 --system-developer-mode --login-profile=user --has-chromeos-keyboard --default-wallpaper-large=/usr/share/chromeos-assets/wallpaper/oem_large.jpg --default-wallpaper-small=/usr/share/chromeos-assets/wallpaper/oem_small.jpg --default-wallpaper-is-oem --guest-wallpaper-large=/usr/share/chromeos-assets/wallpaper/guest_large.jpg --guest-wallpaper-small=/usr/share/chromeos-assets/wallpaper/guest_small.jpg --enable-consumer-kiosk --arc-availability=officially-supported --enterprise-enrollment-initial-modulus=15 --enterprise-enrollment-modulus-limit=19 --login-user=petteri.markkula@multitaction.com --login-profile=ac0b6d3c52a505b6b20d0c9fdf6226a6dbab684c --flag-switches-begin --enable-video-player-chromecast-support --enable-features=WebRtcHWH264Encoding,WebRtcHWVP8Encoding --flag-switches-end --vmodule=*arc/*=1,tablet_power_button_controller=1,*chromeos/login/*=1,auto_enrollment_controller=1,*plugin*=2,*zygote*=1,*/ui/ozone/*=1,*/ui/display/manager/chromeos/*=1,*night_light*=1,power_button_observer=2,webui_login_view=2,lock_state_controller=2,webui_screen_locker=2,screen_locker=2 --enable-features=WebRtcHWH264Encoding,WebRtcHWVP8Encoding
Executable Path	/opt/google/chrome/chrome
Profile Path	/home/chronos/u-ac0b6d3c52a505b6b20d0c9fdf6226a6dbab684c
Variations	6a89113b-ccb9a6a5
1e528f0f-f23d1dea
b130ecb8-2e32ee7e
6345b824-3f4a17df
38eb801c-3f4a17df
7c1bc906-8122a015
d52c4ff7-d52c4ff7
47e5d3db-3d47f4f4
b1edbc38-cf4f6ead
79898f76-f23d1dea
9e201a2b-38d7ffb9
116c6887-f7b8f67e
57f575bb-f23d1dea
f347910c-3f4a17df
77bbdddc-3f4a17df
9773d3bd-f23d1dea
93731dca-3d47f4f4
8e3b2dc5-93702590
9e5c75f1-3066ab27
2981bcb4-3d47f4f4
f79cb77b-3f4a17df
4ea303a6-c11ffda7
d92562a9-ea77f3c1
90bcbadc-e4d47f33
1bced4a3-59ba3fef
4932440-d21eb72d
b2f0086-93053e47
ef25c1eb-3f4a17df
4bc337ce-612a79a3
1354da85-f34af386
17507c76-3f4a17df
494d8760-6843eff2
3ac60855-486e2a9c
f296190c-116bbed1
4442aae2-6e3b1976
ed1d377-e1cc0f14
75f0f0a0-6bdfffe7
e2b18481-6bdfffe7
e7e71889-e1cc0f14
f5fff3a2-f5fff3a2
f141d4bc-28ad44a
da4aaa01-f23d1dea


Fri, 29 Dec 2017 10:50:44 GMT - pma: attachment set

Log from server with --debug=protocol.


Fri, 29 Dec 2017 10:57:49 GMT - Antoine Martin: owner changed

From your log, I see that bencode is generating invalid data in the browser:

Error parsing bencode packet:[0m
 invalid literal for long() with base 10: 'Infinity'
failed to parse bencode packet: 6c353a68656c6c6f64373a7665...

Unfortunately, the packet data was not logged in full. Here's what can be decoded:

$ python -c "import binascii;print(binascii.unhexlify('6c353a68656c6c6f64373a76657273696f6e353a322e322e31383a706c6174666f726d353a506f73697831333a706c6174666f726d2e6e616d65353a506f73697831383a706c6174666f726d2e70726f636573736f72373a756e6b6e6f776e31373a706c6174666f726d2e706c6174666f726d3130363a352e3020285831313b'))"
l5:hellod7:version5:2.2.18:platform5:Posix13:platform.name5:Posix18:platform.processor7:unknown17:platform.platform106:5.0 (X11;

Can you try to capture the packet data using tcpdump?


Tue, 02 Jan 2018 12:06:25 GMT - pma:

Is it enough to capture tcp traffic on port 14500?

Btw. I did not get notification email when the ticket was updated.


Tue, 02 Jan 2018 12:39:56 GMT - Antoine Martin: milestone set

Is it enough to capture tcp traffic on port 14500?

Yes.

Btw. I did not get notification email when the ticket was updated.

I'm not aware of any problems with the mail service. (ie: I get them)


Tue, 02 Jan 2018 12:58:36 GMT - pma: attachment set

"tcpdump tcp port 14500 -i eth0 -w tcpdump.log" from server.


Tue, 02 Jan 2018 13:02:22 GMT - pma:

Tcpdump log attached.

I am not getting any emails. I already had trouble with registration verification email.


Tue, 02 Jan 2018 13:26:51 GMT - Antoine Martin:

That tcpdump is big! Lots of things we don't care about (HTTP requests and responses for all the assets), but I can't seem to find the hello packet. This might just be easier (raw dump, before compression, before wrapping using websockets):

--- html5/js/Protocol.js	(revision 17823)
+++ html5/js/Protocol.js	(working copy)
@@ -368,6 +368,7 @@
 		var bdata = null;
 		try {
 			bdata = bencode(packet);
+			console.log("packet", packet[0], ""+bdata.length+" bytes:", bdata);
 		}
 		catch (e) {
 			console.error("Error: failed to bencode packet:", packet);

Temporarily apply this patch to the client and capture the hello packet from the javascript console output. Something in there contains Infinity, we just need to know what.

I am not getting any emails. I already had trouble with registration verification email.

I'll keep an eye on the MTA logs this time and report here.


Tue, 02 Jan 2018 13:48:11 GMT - Antoine Martin:

I'll keep an eye on the MTA logs this time and report here.

It might have been because the outgoing emails were going through the virus and spam detection. Other gmail addresses worked though..


Tue, 02 Jan 2018 13:52:35 GMT - pma:

I got the notification!


Tue, 02 Jan 2018 14:59:30 GMT - pma:

When trying to build with

debuild -us -uc -b

I get some brotli usage errors (it doesn't recognize -k option) and this

make[1]: Leaving directory '/home/petteri/Share/Xpra/trunk/src'
   dh_install
dh_install: xpra missing files: usr/share/xpra/cuda/*
dh_install: missing files, aborting
debian/rules:12: recipe for target 'binary' failed
make: *** [binary] Error 2
dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2
debuild: fatal error at line 1376:
dpkg-buildpackage -rfakeroot -D -us -uc -b failed

Am I missing some development package?


Tue, 02 Jan 2018 15:07:50 GMT - Antoine Martin:

When trying to build with debuild...

The change is a one liner to the the html5 client, you can just apply it by hand to your existing install.

I get some brotli usage errors (it doesn't recognize -k option) and this

Your distro version of brotli is out of date. That's OK, we just fallback to gzip.

dh_install: xpra missing files: usr/share/xpra/cuda/*

It expects to find the CUDA kernels for NVENC, but you don't have the headers installed so they didn't get built. Easiest thing to do is just to remove this path from the xpra.install file.


Tue, 02 Jan 2018 15:22:25 GMT - pma: attachment set

Server log with oneliner from comment #5.


Tue, 02 Jan 2018 15:23:55 GMT - pma:

Replying to Antoine Martin:

The change is a one liner to the the html5 client, you can just apply it by hand to your existing install.

Didn't realize that. Added the line and attached new server log.


Tue, 02 Jan 2018 15:24:17 GMT - Antoine Martin:

Server log with oneliner from comment:5

There won't be anything in the server log, the message is going to be in the browser's javascript console output. (usually under "developer tools")


Tue, 02 Jan 2018 15:41:57 GMT - pma:

Here it is.

packet hello 6106 bytes: l5:hellod7:version5:2.2.18:platform5:Posix13:platform.name5:Posix18:platform.processor7:unknown17:platform.platform106:5.0 (X11; CrOS x86_64 10176.22.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.41 Safari/537.3612:session-type6:Chrome17:session-type.full114:Mozilla/5.0 (X11; CrOS x86_64 10176.22.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.41 Safari/537.369:namespacei1e5:sharei0e5:steali1e11:client_type5:HTML516:encoding.generici1e8:username0:4:uuid36:198af9c7-afa3-6060-7d85-8f119745f0764:argvl31:http://mtc1216:14500/index.htmle6:digestl4:hmac8:hmac+md53:xor8:hmac+md59:hmac+sha111:hmac+sha256e11:salt-digestl4:hmac8:hmac+md53:xor8:hmac+md59:hmac+sha111:hmac+sha256e4:zlibi1e3:lzoi0e17:compression_leveli1e7:rencodei0e7:bencodei1e4:yamli0e15:connection-datad4:type8:ethernet14:effective-type2:4g8:downlinki8550000e12:downlink.maxiInfinitye3:rtti50ee3:lz4i1e14:lz4.js.version5:0.5.116:encoding.rgb_lz4i1e18:auto_refresh_delayi500e12:randr_notifyi1e19:sound.server_driveni1e20:server-window-resizei1e23:notify-startup-completei1e21:generic-rgb-encodingsi1e12:window.raisei1e26:window.initiate-moveresizei1e18:metadata.supportedl10:fullscreen9:maximized5:above5:below5:title10:size-hints14:class-instance13:transient-for11:window-type11:decorations17:override-redirect4:tray5:modal7:opacitye9:encodingsl4:jpeg3:png3:rgb5:rgb324:webpe16:raw_window_iconsi1e23:encoding.icons.max_sizeli30ei30ee14:encodings.corel4:jpeg3:png3:rgb5:rgb324:webpe21:encodings.rgb_formatsl4:RGBX4:RGBAe21:encodings.window-iconl3:pnge16:encodings.cursorl3:pnge14:encoding.flushi1e21:encoding.transparencyi1e23:encoding.client_optionsi1e18:encoding.csc_atomsi1e18:encoding.scrollingi1e20:encoding.color-gamut4:srgb22:encoding.video_scalingi1e23:encoding.full_csc_modesd4:h264l7:YUV420Pe9:mpeg4+mp4l7:YUV420Pe8:h264+mp4l7:YUV420Pe8:vp8+webml7:YUV420Pee29:encoding.x264.YUV420P.profile8:baseline29:encoding.h264.YUV420P.profile8:baseline27:encoding.h264.YUV420P.level3:2.119:encoding.h264.cabaci0e31:encoding.h264.deblocking-filteri0e33:encoding.h264+mp4.YUV420P.profile4:main31:encoding.h264+mp4.YUV420P.level3:3.025:encoding.h264.score-deltai-20e29:encoding.h264+mp4.score-deltai50e30:encoding.mpeg4+mp4.score-deltai50e29:encoding.vp8+webm.score-deltai50e13:sound.receivei1e10:sound.sendi0e14:sound.decodersle21:sound.bundle-metadatai1e18:encoding.rgb24zlibi1e17:encoding.rgb_zlibi1e7:windowsi1e8:keyboardi1e13:xkbmap_layout2:us15:xkbmap_keycodeslli8e9:BackSpacei8ei0ei0eeli9e3:Tabi9ei0ei0eeli12e8:KP_Begini12ei0ei0eeli13e6:Returni13ei0ei0eeli16e7:Shift_Li16ei0ei0eeli17e9:Control_Li17ei0ei0eeli18e5:Alt_Li18ei0ei0eeli19e5:Pausei19ei0ei0eeli20e9:Caps_Locki20ei0ei0eeli27e6:Escapei27ei0ei0eeli31e11:Mode_switchi31ei0ei0eeli32e5:spacei32ei0ei0eeli33e5:Priori33ei0ei0eeli34e4:Nexti34ei0ei0eeli35e3:Endi35ei0ei0eeli36e4:Homei36ei0ei0eeli37e4:Lefti37ei0ei0eeli38e2:Upi38ei0ei0eeli39e5:Righti39ei0ei0eeli40e4:Downi40ei0ei0eeli42e5:Printi42ei0ei0eeli45e6:Inserti45ei0ei0eeli46e6:Deletei46ei0ei0eeli48e1:0i48ei0ei0eeli49e1:1i49ei0ei0eeli50e1:2i50ei0ei0eeli51e1:3i51ei0ei0eeli52e1:4i52ei0ei0eeli53e1:5i53ei0ei0eeli54e1:6i54ei0ei0eeli55e1:7i55ei0ei0eeli56e1:8i56ei0ei0eeli57e1:9i57ei0ei0eeli58e5:coloni58ei0ei0eeli59e9:semicoloni59ei0ei0eeli60e4:lessi60ei0ei0eeli61e5:equali61ei0ei0eeli62e7:greateri62ei0ei0eeli63e8:questioni63ei0ei0eeli64e2:ati64ei0ei0eeli65e1:ai65ei0ei0eeli66e1:bi66ei0ei0eeli67e1:ci67ei0ei0eeli68e1:di68ei0ei0eeli69e1:ei69ei0ei0eeli70e1:fi70ei0ei0eeli71e1:gi71ei0ei0eeli72e1:hi72ei0ei0eeli73e1:ii73ei0ei0eeli74e1:ji74ei0ei0eeli75e1:ki75ei0ei0eeli76e1:li76ei0ei0eeli77e1:mi77ei0ei0eeli78e1:ni78ei0ei0eeli79e1:oi79ei0ei0eeli80e1:pi80ei0ei0eeli81e1:qi81ei0ei0eeli82e1:ri82ei0ei0eeli83e1:si83ei0ei0eeli84e1:ti84ei0ei0eeli85e1:ui85ei0ei0eeli86e1:vi86ei0ei0eeli87e1:wi87ei0ei0eeli88e1:xi88ei0ei0eeli89e1:yi89ei0ei0eeli90e1:zi90ei0ei0eeli91e4:Menui91ei0ei0eeli92e4:Menui92ei0ei0eeli93e8:KP_Enteri93ei0ei0eeli96e1:0i96ei0ei0eeli97e1:1i97ei0ei0eeli98e1:2i98ei0ei0eeli99e1:3i99ei0ei0eeli100e1:4i100ei0ei0eeli101e1:5i101ei0ei0eeli102e1:6i102ei0ei0eeli103e1:7i103ei0ei0eeli104e1:8i104ei0ei0eeli105e1:9i105ei0ei0eeli106e11:KP_Multiplyi106ei0ei0eeli107e6:KP_Addi107ei0ei0eeli109e11:KP_Subtracti109ei0ei0eeli110e9:KP_Deletei110ei0ei0eeli111e9:KP_Dividei111ei0ei0eeli112e2:F1i112ei0ei0eeli113e2:F2i113ei0ei0eeli114e2:F3i114ei0ei0eeli115e2:F4i115ei0ei0eeli116e2:F5i116ei0ei0eeli117e2:F6i117ei0ei0eeli118e2:F7i118ei0ei0eeli119e2:F8i119ei0ei0eeli120e2:F9i120ei0ei0eeli121e3:F10i121ei0ei0eeli122e3:F11i122ei0ei0eeli123e3:F12i123ei0ei0eeli124e3:F13i124ei0ei0eeli125e3:F14i125ei0ei0eeli126e3:F15i126ei0ei0eeli127e3:F16i127ei0ei0eeli128e3:F17i128ei0ei0eeli129e3:F18i129ei0ei0eeli130e3:F19i130ei0ei0eeli131e3:F20i131ei0ei0eeli132e3:F21i132ei0ei0eeli133e3:F22i133ei0ei0eeli134e3:F23i134ei0ei0eeli135e3:F24i135ei0ei0eeli144e8:Num_Locki144ei0ei0eeli145e11:Scroll_Locki145ei0ei0eeli160e15:dead_circumflexi160ei0ei0eeli161e6:exclami161ei0ei0eeli162e8:quotedbli162ei0ei0eeli163e10:numbersigni163ei0ei0eeli164e6:dollari164ei0ei0eeli165e7:percenti165ei0ei0eeli166e9:ampersandi166ei0ei0eeli167e10:underscorei167ei0ei0eeli168e9:parenlefti168ei0ei0eeli169e10:parenrighti169ei0ei0eeli170e8:asteriski170ei0ei0eeli171e4:plusi171ei0ei0eeli172e3:bari172ei0ei0eeli173e5:minusi173ei0ei0eeli174e9:bracelefti174ei0ei0eeli175e10:bracerighti175ei0ei0eeli176e10:asciitildei176ei0ei0eeli186e9:semicoloni186ei0ei0eeli187e5:equali187ei0ei0eeli188e5:commai188ei0ei0eeli189e5:minusi189ei0ei0eeli190e6:periodi190ei0ei0eeli191e5:slashi191ei0ei0eeli192e5:gravei192ei0ei0eeli219e11:bracketlefti219ei0ei0eeli220e9:backslashi220ei0ei0eeli221e12:bracketrighti221ei0ei0eeli222e10:apostrophei222ei0ei0eee12:xkbmap_print0:12:xkbmap_query0:12:desktop_sizeli349ei695ee17:desktop_mode_sizeli349ei695ee12:screen_sizesll4:HTMLi349ei695ei92ei184ell6:Canvasi0ei0ei349ei695ei92ei184eeei0ei0ei349ei695eee3:dpii96e17:clipboard_enabledi1e22:clipboard.want_targetsi1e16:clipboard.greedyi1e20:clipboard.selectionsl9:CLIPBOARD7:PRIMARYe13:notificationsi1e7:cursorsi1e4:belli1e11:system_trayi1e13:named_cursorsi0e13:file-transferi1e8:printingi1e15:file-size-limiti10eee

Tue, 02 Jan 2018 15:52:10 GMT - Antoine Martin:

Here it is

Thanks. That was easy, the problem comes from the bandwidth detection code added in 2.2 (see ticket:1581#comment:3), the fix is in r17830.

You can test using the latest html5 client code here: http://xpra.org/html5/connect.html

Please close this ticket if the fix works for you.


Tue, 02 Jan 2018 15:58:11 GMT - pma: status changed; resolution set

It does work for me.


Sat, 23 Jan 2021 05:32:14 GMT - migration script:

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