Xpra: Ticket #2603: #2599's clipboard issues

See full description from #2599

tl;dr: a bunch of:

2020-02-18 22:57:27,544 Error: failed to set clipboard data
2020-02-18 22:57:27,544  OpenClipboard: access denied
2020-02-18 22:57:27,548 Warning: cannot set clipboard value
2020-02-18 22:57:27,552  failed to set clipboard buffer


Thu, 20 Feb 2020 18:54:03 GMT - stdedos:

I kinda feel there may be something:

On my gnome-terminal display, I cannot copy-paste from local to remote. Copying remote-to-local updates come (that's how I got the backtrace for ticket:2034#comment:4), but I cannot e.g. copy a URL locally and paste it remotely.

The most weird thing is that, in the gnome-terminal display, I get no error messages regarding clipboard.

Since I cannot open session details to indeed verify that I haven't disabled it, here is a grep for you:

$ xpra info 2 | grep clipboard
xpra for python 2.7 is not installed
 retrying with python3
client.clipboard.contents-slice-fix=True
client.clipboard.enabled=True
client.clipboard.greedy=True
client.clipboard.notifications=True
client.clipboard.preferred-targets=('UTF8_STRING', 'TEXT', 'STRING', 'text/plain')
client.clipboard.selections=('CLIPBOARD',)
client.clipboard.set-enabled=True
client.clipboard.want-targets=False
client.connection.input.count.clipboard-contents=1
client.connection.input.count.clipboard-enable-selections=1
client.connection.input.count.clipboard-token=75
client.connection.input.count.set-clipboard-enabled=1
client.connection.output.count.clipboard-pending-requests=82
client.connection.output.count.clipboard-request=59
client.connection.output.count.clipboard-token=74
client.connection.receive_alias.33=clipboard-enable-selections
client.connection.receive_alias.34=set-clipboard-enabled
client.connection.receive_alias.35=clipboard-contents
client.connection.receive_alias.36=clipboard-request
client.connection.receive_alias.53=clipboard-contents-none
client.connection.receive_alias.55=clipboard-loop-uuids
client.connection.receive_alias.61=clipboard-pending-requests
client.connection.receive_alias.62=clipboard-token
client.connection.send_alias.clipboard-contents=47
client.connection.send_alias.clipboard-contents-none=48
client.connection.send_alias.clipboard-enable-selections=50
client.connection.send_alias.clipboard-pending-requests=49
client.connection.send_alias.clipboard-request=46
client.connection.send_alias.clipboard-token=45
client.connection.send_alias.set-clipboard-enabled=44
clipboard.CLIPBOARD.blocked_owner_change=False
clipboard.CLIPBOARD.enabled=True
clipboard.CLIPBOARD.event.get_contents=0
clipboard.CLIPBOARD.event.got_token=52
clipboard.CLIPBOARD.event.request_contents=0
clipboard.CLIPBOARD.event.selection_clear=0
clipboard.CLIPBOARD.event.selection_get=0
clipboard.CLIPBOARD.event.selection_request=0
clipboard.CLIPBOARD.event.sent_token=0
clipboard.CLIPBOARD.greedy_client=True
clipboard.CLIPBOARD.have_token=True
clipboard.CLIPBOARD.last-targets=()
clipboard.CLIPBOARD.loop-uuid=Xpra-Clipboard-Loop-Detection:384699b223174de082bfc5af73be9557
clipboard.CLIPBOARD.preferred-targets=('UTF8_STRING', 'TEXT', 'STRING', 'text/plain')
clipboard.PRIMARY.blocked_owner_change=False
clipboard.PRIMARY.enabled=True
clipboard.PRIMARY.event.get_contents=0
clipboard.PRIMARY.event.got_token=13
clipboard.PRIMARY.event.request_contents=0
clipboard.PRIMARY.event.selection_clear=0
clipboard.PRIMARY.event.selection_get=0
clipboard.PRIMARY.event.selection_request=0
clipboard.PRIMARY.event.sent_token=0
clipboard.PRIMARY.greedy_client=True
clipboard.PRIMARY.have_token=False
clipboard.PRIMARY.last-targets=()
clipboard.PRIMARY.loop-uuid=Xpra-Clipboard-Loop-Detection:897bae4763e643da96b4c74291792d9c
clipboard.PRIMARY.preferred-targets=('UTF8_STRING', 'TEXT', 'STRING', 'text/plain')
clipboard.SECONDARY.blocked_owner_change=False
clipboard.SECONDARY.enabled=True
clipboard.SECONDARY.event.get_contents=0
clipboard.SECONDARY.event.got_token=0
clipboard.SECONDARY.event.request_contents=0
clipboard.SECONDARY.event.selection_clear=0
clipboard.SECONDARY.event.selection_get=0
clipboard.SECONDARY.event.selection_request=0
clipboard.SECONDARY.event.sent_token=0
clipboard.SECONDARY.greedy_client=True
clipboard.SECONDARY.have_token=False
clipboard.SECONDARY.last-targets=()
clipboard.SECONDARY.loop-uuid=Xpra-Clipboard-Loop-Detection:61e2ddbf7cea4ad1b22539492e124b0e
clipboard.SECONDARY.preferred-targets=('UTF8_STRING', 'TEXT', 'STRING', 'text/plain')
clipboard.can-receive=True
clipboard.can-send=True
clipboard.filters=()
clipboard.max_recv_size=-1
clipboard.max_send_size=-1
clipboard.max_size=16777216
clipboard.pending=()
clipboard.requests=94
clipboard.type=X11Clipboard
clipboard.want_targets=False
features.clipboard=True
features.clipboard-direction=both
features.clipboard.contents-slice-fix=True
features.clipboard.enable-selections=True
features.clipboard.loop-uuids.CLIPBOARD=Xpra-Clipboard-Loop-Detection:384699b223174de082bfc5af73be9557
features.clipboard.loop-uuids.PRIMARY=Xpra-Clipboard-Loop-Detection:897bae4763e643da96b4c74291792d9c
features.clipboard.loop-uuids.SECONDARY=Xpra-Clipboard-Loop-Detection:61e2ddbf7cea4ad1b22539492e124b0e
features.clipboard.preferred-targets=('UTF8_STRING', 'TEXT', 'STRING', 'text/plain', 'image/png')
features.clipboards=('CLIPBOARD', 'PRIMARY', 'SECONDARY')

Thu, 20 Feb 2020 18:56:32 GMT - stdedos:

r25314 makes things a bit better (two-way clipboard is working), but you still may need to kick or bash it, before it works

"Xpra-Python3-x86_64_4.0-r25314\xpra_cmd" shadow ssh://user@ip/0 --ssh="plink -ssh -agent" --opengl=no --desktop-scaling=0.75 --min-speed=70 --webcam=no --speaker=off --microphone=off --pulseaudio=no --exit-with-client=no --encoding=h264
2020-02-20 20:40:10,610 Xpra GTK3 client version 4.0-r25314 64-bit
2020-02-20 20:40:10,614  running on Microsoft Windows 10
2020-02-20 20:40:12,615 GStreamer version 1.16.2 for Python 3.8.1 64-bit
2020-02-20 20:40:13,217 keyboard layout code 0x409
2020-02-20 20:40:13,217 identified as 'United States - English' : us
2020-02-20 20:40:13,829  keyboard settings: layout=us
2020-02-20 20:40:13,829  desktop size is 1600x900 with 1 screen:
2020-02-20 20:40:13,845   Default (423x238 mm - DPI: 96x96) workarea: 1600x860
2020-02-20 20:40:13,845     (Standard monitor types) Generic PnP Monitor (309x174 mm - DPI: 131x131)
2020-02-20 20:40:13,845  downscaled to 75%, virtual screen size: 2133x1200
2020-02-20 20:40:13,845   Default (423x238 mm - DPI: 128x128) workarea: 2133x1147
2020-02-20 20:40:13,845     (Standard monitor types) Generic PnP Monitor (309x174 mm - DPI: 175x175)
2020-02-20 20:40:52,132 enabled remote logging
2020-02-20 20:40:52,132 server is using auto encoding instead of h264
2020-02-20 20:40:52,132 Xpra GTK3 shadow server version 3.0.6-r25174 64-bit
2020-02-20 20:40:52,148  running on Linux Ubuntu 16.04 xenial
2020-02-20 20:40:52,148  remote desktop size is 6400x1440
(xpra_cmd:8640): Pango-WARNING **: 20:40:52.973: couldn't load font "Bitstream Vera Sans Not-Rotated 14.662109375", falling back to "Sans Not-Rotated 14.662109375", expect ugly output.
2020-02-20 20:40:54,017 UI thread is now blocked
2020-02-20 20:40:54,156 UI thread is running again, resuming
2020-02-20 20:41:49,067 Warning: cannot set clipboard value
2020-02-20 20:41:49,067  failed to set clipboard buffer
2020-02-20 20:42:30,018 Warning: cannot set clipboard value
2020-02-20 20:42:30,018  failed to set clipboard buffer
2020-02-20 20:43:54,707 Warning: cannot set clipboard value
2020-02-20 20:43:54,707  failed to set clipboard buffer
2020-02-20 20:48:04,681 server is not responding, drawing spinners over the windows
2020-02-20 20:48:05,711 server is OK again
2020-02-20 20:48:14,791 server is not responding, drawing spinners over the windows
2020-02-20 20:48:15,050 server is OK again
2020-02-20 20:48:19,828 server is not responding, drawing spinners over the windows
2020-02-20 20:48:22,223 server is OK again
2020-02-20 20:48:50,111 server is not responding, drawing spinners over the windows
2020-02-20 20:48:51,409 server is OK again
2020-02-20 20:49:15,157 server is not responding, drawing spinners over the windows
2020-02-20 20:49:15,413 server is OK again
2020-02-20 20:49:35,193 server is not responding, drawing spinners over the windows
2020-02-20 20:49:36,477 server is OK again
2020-02-20 20:50:00,310 server is not responding, drawing spinners over the windows
2020-02-20 20:50:01,332 server is OK again
2020-02-20 20:50:25,360 server is not responding, drawing spinners over the windows
2020-02-20 20:50:26,422 server is OK again
(xpra_cmd:8640): Gtk-WARNING **: 20:50:48.109: Could not find the icon 'pan-end-symbolic'. The 'hicolor' theme
was not found either, perhaps you need to install it.
You can get a copy from:
        http://icon-theme.freedesktop.org/releases
Traceback (most recent call last):
  File "E:\Xpra\trunk\src/xpra/client/gtk_base/gtk_tray_menu_base.py", line 454, in show_session_info_cb
  File "E:\Xpra\trunk\src/xpra/client/gtk_base/gtk_tray_menu_base.py", line 315, in show_session_info
  File "E:\Xpra\trunk\src/xpra/client/gtk_base/gtk_client_base.py", line 563, in show_session_info
  File "E:\Xpra\trunk\src/xpra/client/gtk_base/session_info.py", line 228, in __init__
  File "E:\Xpra\trunk\src/xpra/client/gtk_base/session_info.py", line 227, in sgllabel
TypeError: 'NoneType' object is not iterable
2020-02-20 20:51:16,105 Error: failed to get clipboard data
2020-02-20 20:51:16,105  OpenClipboard: too many failed attemps, giving up

The 2020-02-20 20:51:16,105 Error: failed to get clipboard data message came as soon as I copied the above terminal output


Tue, 03 Mar 2020 21:42:50 GMT - stdedos:

From #2617

"Xpra-Python3-x86_64_4.0-r25345\xpra_cmd" shadow ssh://user@ip/0 --ssh="plink -ssh -agent" --opengl=no --desktop-scaling=0.75 --min-speed=70 --webcam=no --speaker=off --microphone=off --pulseaudio=no --exit-with-client=no
2020-03-03 21:07:51,309 Xpra GTK3 client version 4.0-r25345 64-bit
2020-03-03 21:07:51,311  running on Microsoft Windows 10
2020-03-03 21:07:52,491 GStreamer version 1.16.2 for Python 3.8.1 64-bit
2020-03-03 21:07:52,819 keyboard layout code 0x409
2020-03-03 21:07:52,820 identified as 'United States - English' : us
2020-03-03 21:07:53,413  keyboard settings: layout=us
2020-03-03 21:07:53,418  desktop size is 1600x900 with 1 screen:
2020-03-03 21:07:53,420   Default (423x238 mm - DPI: 96x96) workarea: 1600x860
2020-03-03 21:07:53,422     (Standard monitor types) Generic PnP Monitor (309x174 mm - DPI: 131x131)
2020-03-03 21:07:53,423  downscaled to 75%, virtual screen size: 2133x1200
2020-03-03 21:07:53,425   Default (423x238 mm - DPI: 128x128) workarea: 2133x1147
2020-03-03 21:07:53,430     (Standard monitor types) Generic PnP Monitor (309x174 mm - DPI: 175x175)
2020-03-03 21:08:11,951 enabled remote logging
2020-03-03 21:08:11,957 Xpra GTK3 shadow server version 3.0.6-r25174 64-bit
2020-03-03 21:08:11,960  running on Linux Ubuntu 16.04 xenial
2020-03-03 21:08:11,963  remote desktop size is 6400x1440
[...]
(xpra_cmd:11928): Gtk-WARNING **: 22:24:40.716: Error loading theme icon 'document-save' for stock: Icon 'document-save' not present in theme Adwaita
2020-03-03 22:40:02,014 Error: failed to get clipboard data
2020-03-03 22:40:02,017  OpenClipboard: too many failed attemps, giving up
2020-03-03 22:41:01,096 Error: failed to get clipboard data
2020-03-03 22:41:01,098  no matching format in
2020-03-03 22:41:01,272 Error: failed to get clipboard data
2020-03-03 22:41:01,275  OpenClipboard: too many failed attemps, giving up
2020-03-03 22:41:03,542 Error: failed to get clipboard data
2020-03-03 22:41:03,544  OpenClipboard: too many failed attemps, giving up
2020-03-03 22:41:05,124 Error: failed to get clipboard data
2020-03-03 22:41:05,127  OpenClipboard: too many failed attemps, giving up
2020-03-03 22:41:30,190 Error: failed to get clipboard data
2020-03-03 22:41:30,192  OpenClipboard: too many failed attemps, giving up
2020-03-03 22:41:50,526 Error: failed to get clipboard data
2020-03-03 22:41:50,530  OpenClipboard: too many failed attemps, giving up
2020-03-03 22:41:51,911 Error: failed to get clipboard data
2020-03-03 22:41:51,917  OpenClipboard: too many failed attemps, giving up
2020-03-03 22:57:50,292 Error: failed to get clipboard data
2020-03-03 22:57:50,294  no matching format in DataObject, System.Drawing.Bitmap, CF_BITMAP, Ole Private Data, CF_DIB, CF_DIBV5
2020-03-03 22:57:50,451 Error: failed to get clipboard data
2020-03-03 22:57:50,452  no matching format in DataObject, System.Drawing.Bitmap, CF_BITMAP, Ole Private Data, CF_DIB, CF_DIBV5
2020-03-03 23:35:40,000 server is not responding, drawing spinners over the windows
2

Wed, 04 Mar 2020 04:31:08 GMT - Antoine Martin: owner changed

Please try 4.0-r25483 or later. You can then use new environment variables to retry more (or less):

xpra_cmd attach -d clipboard --env=XPRA_CLIPBOARD_RETRY=10 --env=XPRA_CLIPBOARD_INITIAL_DELAY=10 ...

(the default remains 5 / 5)

Note that in some cases, some other application will be hogging the clipboard and failing is the right thing to do. (better than waiting too long) Also, if the data on the clipboard is not handled, you will see messages like these:

no matching format in DataObject, System.Drawing.Bitmap, CF_BITMAP, Ole Private Data, CF_DIB, CF_DIBV5

We may deal with this eventually: #2619.


Thu, 05 Mar 2020 16:27:37 GMT - Antoine Martin:

Managed to reproduce clipboard race conditions by having both virtualbox and xpra fight over who should be synchronizing the clipboard and in which direction. r25516 fixes one more bug, we try again for 2 other possible failures: failure to get a data handle or failure to get a global lock.


Thu, 05 Mar 2020 19:35:13 GMT - stdedos: status changed; resolution set

Since I feel I've got my clipboard sync back, and work has been commited for this ticket, I'll close as fix. Xpra-Python3-x86_64_4.0-r25519 seems to have more or less the same "logs per minute" as usual.

I have noticed that this might be related to having a ternimal and a shadow session in parallel (same server, and obviously different displays). I think xpra handles itself trying to sync between instances though, right?

I'll keep this in my saved tickets; if I run in clip-sync issues, I'll try to increase the defaults.


Fri, 06 Mar 2020 02:49:28 GMT - Antoine Martin:

I have noticed that this might be related to having a terminal and a shadow session in parallel (same server, and obviously different displays). I think xpra handles itself trying to sync between instances though, right?

That's definitely what triggered those issues (and what I was missing when trying to reproduce). Instances will be fighting over who should be doing the synchronization and in which direction.


Fri, 06 Mar 2020 09:59:50 GMT - stdedos:

Oops! :/

I thought that xpra could resolve syncing by itself (I don't know what gave me that idea though :/ )


Fri, 06 Mar 2020 11:36:15 GMT - stdedos:

Can also happen with shadow server connected alone though


Sat, 23 Jan 2021 05:55:47 GMT - migration script:

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