Xpra: Ticket #1529: TypeError: unsupported operand type(s) for +: 'memoryview' and 'str'

When I try to connect to the server, the connection gets closed and the server logs:

X.Org X Server 1.19.3
Release Date: 2017-03-15
X Protocol Version 11, Revision 0
Build Operating System:  4.9.3-200.fc25.x86_64
Current Operating System: Linux 125a64427f1a 4.8.0-49-generic #52~16.04.1-Ubuntu SMP Thu Apr 20 10:55:59 UTC 2017 x86_64
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.8.0-49-generic root=UUID=5fcfcd72-c56d-4e35-b87e-bd04e37ec317 ro quiet splash vt.handoff=7
Build Date: 15 March 2017  06:37:12PM
Build ID: xorg-x11-server 1.19.3-1.fc25
Current version of pixman: 0.34.0
        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(++) Log file: "/home/<<user>>/.xpra/Xorg.S15.log", Time: Tue May 23 18:35:53 2017
(++) Using config file: "/etc/xpra/xorg.conf"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
Using display number provided by /usr/libexec/Xorg: :0
failed to rename Xorg log file from '/home/<<user>>/.xpra/Xorg.S15.log' to '/home/<<user>>/.xpra/Xorg.:0.log'
 [Errno 2] No such file or directory
2017-05-23 18:35:53,199 created unix domain socket: /home/<<user>>/.xpra/125a64427f1a-0
2017-05-23 18:35:53,199 created unix domain socket: /var/run/xpra/125a64427f1a-0
2017-05-23 18:35:53,962 serving html content from: /usr/share/xpra/www
2017-05-23 18:35:54,000 pulseaudio server started with pid 51
E: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
E: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
E: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
E: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
E: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
E: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
E: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
E: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
E: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
E: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
E: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
W: [pulseaudio] authkey.c: Failed to open cookie file '/home/<<user>>/.config/pulse/cookie': No such file or directory
W: [pulseaudio] authkey.c: Failed to load authentication key '/home/<<user>>/.config/pulse/cookie': No such file or directory
W: [pulseaudio] authkey.c: Failed to open cookie file '/home/<<user>>/.pulse-cookie': No such file or directory
W: [pulseaudio] authkey.c: Failed to load authentication key '/home/<<user>>/.pulse-cookie': No such file or directory
** (gst-plugin-scanner:58): CRITICAL **: Couldn't g_module_open libpython. Reason: /usr/lib64/python2.7/config/libpython2.7.so: cannot open shared object file: No such file or directory
** (gst-plugin-scanner:58): CRITICAL **: Couldn't g_module_open libpython. Reason: /usr/lib64/libpython3.5m.so: cannot open shared object file: No such file or directory
(gst-plugin-scanner:58): GStreamer-WARNING **: Failed to load plugin '/usr/lib64/gstreamer-1.0/libgstvpx.so': libvpx.so.4: cannot open shared object file: No such file or directory
2017-05-23 18:35:54,355 GStreamer version 1.10.4 for Python 3.5.3 64-bit
2017-05-23 18:35:54,368 D-Bus notification forwarding is available
2017-05-23 18:35:54,384 started command 'vglrun xterm' with pid 61
2017-05-23 18:35:54,385 xpra X11 version 2.0.2-r15657 64-bit
2017-05-23 18:35:54,385  uid=2365536 (<<user>>), gid=0 (root)
2017-05-23 18:35:54,385  running with pid 15 on Linux Fedora 25 Twenty Five
2017-05-23 18:35:54,385  connected to X11 display :0 with 24 bit colors
/usr/bin/vglrun: line 203: hostname: command not found
ERROR: ld.so: object 'libdlfaker.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'librrfaker.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
2017-05-23 18:35:54,507 15.5GB of system memory
2017-05-23 18:35:54,512 xpra is ready.
2017-05-23 18:36:01,285 New tcp connection received from 172.17.0.1:51388
2017-05-23 18:36:01,287 sending data using AES encryption
2017-05-23 18:36:01,288 receiving data using AES encryption
2017-05-23 18:36:01,290 Authentication required by env authenticator module
2017-05-23 18:36:01,290  sending challenge for username '<<user>>' using hmac+sha512 digest
2017-05-23 18:36:01,512 Handshake complete; enabling connection
2017-05-23 18:36:01,521 Python/Gtk2 Linux neon 16.04 xenial x11 client version 2.0.2-r15657 64-bit
2017-05-23 18:36:01,521  connected from '<<host>>' as '<<user>>' - 'User Name'
2017-05-23 18:36:01,522  automatic picture encoding enabled
2017-05-23 18:36:01,522  also available:
2017-05-23 18:36:01,522   h264, vp9, vp8, png, png/P, png/L, rgb24, jpeg, rgb32
2017-05-23 18:36:01,522  client root window size is 1920x1080 with 1 display:
2017-05-23 18:36:01,523   :0.0 (508x285 mm - DPI: 96x96) workarea: 1920x1048 at 0x32
2017-05-23 18:36:01,523     monitor 1 (509x286 mm - DPI: 95x95)
2017-05-23 18:36:01,603 server virtual display now set to 1920x1080
2017-05-23 18:36:01,605 setting key repeat rate from client: 660ms delay / 40ms interval
2017-05-23 18:36:01,606 setting keymap: rules=evdev, model=pc105, layout=us,ara
2017-05-23 18:36:01,640 DPI set to 96 x 96
2017-05-23 18:36:01,678 client 1: Attached to tcp/localhost:30001 (press Control-C to detach)
2017-05-23 18:36:01,786 Error: error in network packet write/format
2017-05-23 18:36:01,786  unsupported operand type(s) for +: 'memoryview' and 'str'
Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/xpra/net/protocol.py", line 292, in _write_format_thread_loop
    self._add_packet_to_queue(*gpc())
  File "/usr/lib64/python2.7/site-packages/xpra/net/protocol.py", line 308, in _add_packet_to_queue
    self._add_chunks_to_queue(chunks, start_send_cb, end_send_cb)
  File "/usr/lib64/python2.7/site-packages/xpra/net/protocol.py", line 332, in _add_chunks_to_queue
    padded = data + pad(self.cipher_out_padding, padding_size)
TypeError: unsupported operand type(s) for +: 'memoryview' and 'str'
2017-05-23 18:36:01,787 xpra client 1 disconnected.

The server container is built from this Dockerfile repository: https://github.com/bwvisu/xpra-docker/tree/ec45e430573adf789516096a78af1cf1d321b703



Wed, 24 May 2017 04:32:36 GMT - Antoine Martin: owner changed; milestone set

This should be fixed in r15935. Please close if this change works for you.

FYI: AES encryption is less well supported than SSL nowadays. It may get removed at some point in the future.


Wed, 24 May 2017 16:25:56 GMT - urzds: status changed; resolution set

Tested:


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

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