Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recovering/reconnecting to existing sessions #3088

Closed
stdedos opened this issue Apr 12, 2021 · 36 comments
Closed

Recovering/reconnecting to existing sessions #3088

stdedos opened this issue Apr 12, 2021 · 36 comments
Assignees
Labels
enhancement New feature or request

Comments

@stdedos
Copy link
Collaborator

stdedos commented Apr 12, 2021

From #3077 (comment):

There are two parts to this:

  • which $XAUTHORITY file was used
  • allowing access (ie: xhost +)

It should be possible to rescue the session by re-creating the file or allowing access.
xpra uses the $XAUTHORITY value which is often set by the login manager (ie: gdm). Unfortunately, it is possible for that file to disappear.
We have support code for using our own private one (#1776) but since this restricts access to the $DISPLAY and users expect to be able to do DISPLAY=:N dosomething from any login session, this was never enabled by default.

@stdedos
Copy link
Collaborator Author

stdedos commented Apr 12, 2021

My .Xauthority looks parseable:

xauth> list
u-oldhost/unix:0  MIT-MAGIC-COOKIE-1  167a04c95b46778acddc5be84cdd499e
u-oldhost/unix:10  MIT-MAGIC-COOKIE-1  4c0bf9942e4fe15173d7c4ef9cb17ac0
oldhost/unix:1  MIT-MAGIC-COOKIE-1  0ff49a354529485188f335d45d12fdc7
oldhost/unix:2  MIT-MAGIC-COOKIE-1  dad11fc3517f4f79ad4378275f4aca8d
oldhost/unix:3  MIT-MAGIC-COOKIE-1  95056639d3c84cc29d3399dd6a08dafd
oldhost/unix:4  MIT-MAGIC-COOKIE-1  17103b9cbe4044b29e00ae0a71009412
oldhost/unix:5  MIT-MAGIC-COOKIE-1  10fba12acbc441769f8cf096cf7d9502
oldhost/unix:5  MIT-MAGIC-COOKIE-1  10fba12acbc441769f8cf096cf7d9502
oldhost/unix:0  MIT-MAGIC-COOKIE-1  ad622ac89ef4e0c1335cff47a958eeec
u-host/unix:1  MIT-MAGIC-COOKIE-1  0eb4bfde3bf5450d9b3d1936432a7971
u-host/unix:2  MIT-MAGIC-COOKIE-1  0be0c7e5787e41438403a3f8160aff83
u-host/unix:3  MIT-MAGIC-COOKIE-1  8868ced8cf8944e99a049017bba11089
u-host/unix:4  MIT-MAGIC-COOKIE-1  bbbe18d6edb1495787916cebbc3e2576
u-host/unix:100  MIT-MAGIC-COOKIE-1  64ceb850adfe49509dbf2e5d9ccb4faa
u-host/unix:5  MIT-MAGIC-COOKIE-1  4c1acaeb497846248c60fbf257774fe0
u-host/unix:6  MIT-MAGIC-COOKIE-1  b427b3116e0f4e3aaa6742c1a58360f3
u-host/unix:7  MIT-MAGIC-COOKIE-1  a4423c0563e34c69bb48b8c5d1daa87c
u-host/unix:8  MIT-MAGIC-COOKIE-1  cf7fa868c6f74ff590a377fe63d6b81a
u-host/unix:9  MIT-MAGIC-COOKIE-1  824dd00d58c5404c88c769f2297d73c5
u-host/unix:11  MIT-MAGIC-COOKIE-1  a29d797233e343beace2801b02d9a018
u-host/unix:12  MIT-MAGIC-COOKIE-1  514f363ec3024e48ad892a2cc2998d5e
u-host/unix:30  MIT-MAGIC-COOKIE-1  1775528eeaf346149fce653bd1039140
u-host/unix:999  MIT-MAGIC-COOKIE-1  5582a11013f54d98aa22ec273c34a8b9
u-host/unix:20  MIT-MAGIC-COOKIE-1  ed404a377a7f463ebcac05ab2ce15358
u-host/unix:200  MIT-MAGIC-COOKIE-1  e6ad1658af934141beba2b18f171f554
u-host/unix:50  MIT-MAGIC-COOKIE-1  08c821e5b2d74fd3a2c29a03e7b5e256
u-host/unix:0  MIT-MAGIC-COOKIE-1  8bff4171743b3674f3b779c1c1167856
u-host/unix:10  MIT-MAGIC-COOKIE-1  7e04d0e1993e2a58ca029ff671f62a98

but a lot of entries 😕

Does xpra have enough time to try them all out?

(ofc I have xhost +)

@stdedos
Copy link
Collaborator Author

stdedos commented Apr 12, 2021

Hmmm ....

$ ps faux | grep -i xvfb
u   13488  0.0  0.2 1738464 172932 ?      Ssl  Απρ08   0:00  \_ Xvfb-for-Xpra-:2 +extension GLX +extension Composite -screen 0 8192x4096x24+32 -nolisten tcp -noreset -auth /run/user/1000/gdm/Xauthority -dpi 96 :2
u   15797  0.6  0.3 1787812 222836 ?      Sl   Απρ08  34:39  \_ Xvfb-for-Xpra-S15793 +extension GLX +extension Composite -screen 0 8192x4096x24+32 -nolisten tcp -noreset -auth /run/user/1000/gdm/Xauthority -dpi 96 -displayfd 6
u  272754  0.7  0.6 2213988 443464 ?      Ssl  Απρ09  32:57 Xvfb-for-Xpra-:4 +extension GLX +extension Composite -screen 0 8192x4096x24+32 -nolisten tcp -noreset -auth /home/u/.Xauthority -dpi 96 :4
u 2923724  0.0  0.0  11448   668 pts/33   S+   09:23   0:00      \_ grep --color=auto -i xvfb
u  366252  0.0  0.3 1798980 234328 ?      Ssl  Απρ09   0:39 Xvfb-for-Xpra-:5 +extension GLX +extension Composite -screen 0 8192x4096x24+32 -nolisten tcp -noreset -auth /home/u/.Xauthority -dpi 96 :5
$ ls -alh /run/user/1000/gdm/Xauthority
-rw------- 1 u u 274 Απρ   8 16:06 /run/user/1000/gdm/Xauthority

@totaam totaam added the enhancement New feature or request label Apr 30, 2021
@totaam
Copy link
Collaborator

totaam commented Apr 30, 2021

This may help:

@stdedos
Copy link
Collaborator Author

stdedos commented Apr 30, 2021

Awesome, thank you 😀; however, no screens to try it out right now

@stdedos
Copy link
Collaborator Author

stdedos commented May 4, 2021

  1. xpra recover will not try to find "displays that exist but their socket is closed".
  2. After xpra recover (which tried to recover the [working] session I called it from), the output has very high latency - typing and looking is impossible to work:
    when I type grepgrep, the only text I will see is gr, and the rest of the characters will arrive one-by-one.

@stdedos
Copy link
Collaborator Author

stdedos commented May 4, 2021

Also, something decided to kill the Xvfb-for-xpra-:2 during this process 😡😡😡😡

@totaam
Copy link
Collaborator

totaam commented May 4, 2021

xpra recover will not try to find "displays that exist but their socket is closed".

Do you mean the xpra socket or the X11 socket?
We don't do a connect test on the X11 socket, but we do test the xpra server socket.

After xpra recover (which tried to recover the [working] session I called it from)

Why did it do that? Was the socket dead? Did you instruct it to do so? (ie: xpra recover $DISPLAY)
Where you call xpra recover should not make any difference.

the output has very high latency - typing and looking is impossible to work:

In the end, xpra recover only runs xpra start[-desktop] with the correct $DISPLAY value and --use-display=yes.
Perhaps you ran it from a shell that ended up zombied somehow? Then the dead stdin and stdout triggered an endless interrupt storm for that process?

Also, something decided to kill the Xvfb-for-xpra-:2 during this process

Sorry about that. As per above, xpra recover only does an xpra start.
Was there anything in your server log?
The only explanation that I have is that your previous xpra server was still running and so the new one took over ungracefully thereby causing the previous one to shutdown and take the display with it.
Does that sound plausible?

@stdedos
Copy link
Collaborator Author

stdedos commented May 4, 2021

xpra recover will not try to find "displays that exist but their socket is closed".

Do you mean the xpra socket or the X11 socket?
We don't do a connect test on the X11 socket, but we do test the xpra server socket.

xpra socket, idk anything about the X11

After xpra recover (which tried to recover the [working] session I called it from)

Why did it do that? Was the socket dead? Did you instruct it to do so? (ie: xpra recover $DISPLAY)
Where you call xpra recover should not make any difference.

No, I just did xpra recover. I had to do xpra recover :2 to force xpra to try and pick up :2 (at that time, I think there were no xpra sockets for :2)

the output has very high latency - typing and looking is impossible to work:

In the end, xpra recover only runs xpra start[-desktop] with the correct $DISPLAY value and --use-display=yes.
Perhaps you ran it from a shell that ended up zombied somehow? Then the dead stdin and stdout triggered an endless interrupt storm for that process?

I have no idea 😕. And, since I was not expecting such a quick response, I just patiently typed xpra stop :4

Also, something decided to kill the Xvfb-for-xpra-:2 during this process

Sorry about that. As per above, xpra recover only does an xpra start.
Was there anything in your server log?
The only explanation that I have is that your previous xpra server was still running and so the new one took over ungracefully thereby causing the previous one to shutdown and take the display with it.
Does that sound plausible?

The only data I have is:

Logs:

  • (Sometime after 2021-05-03 14:43) Xpra: Fatal IO error 11 (Resource temporarily unavailable) on X server :2, X IO Error
  • <timestamp> Error: failed to connect to display :2
  • Error: failed to connect to display :2 (w/o timestamp!)

Actions:

  • during this time, I have updated xpra and I tried to do xpra upgrade :2 on the server (more than once, since I had forgotten to do apt-get)
  • the xpra server status was UNKNOWN at sometime (which I think I have killed successfully, as to not allow it to garbage-collect the server)

@stdedos
Copy link
Collaborator Author

stdedos commented May 4, 2021

I know it sounds funny, but can I "somehow" attempt to authorise with "all the available X11 credentials and methods" to some leftover display?

I don't understand how it is possible that the server can start&connect, but after a few days it cannot re-connect.

Can the xpra server dump its credentials somewhere, and me try to manually ping the server with those?

@stdedos
Copy link
Collaborator Author

stdedos commented May 4, 2021

For the shadow server #3077 (comment), the problem is much more obvious.

....

......

........

The display is not at :0 😱, but DISPLAY is at :1
(That seems to be the case for Ubuntu Xenial updates only i.e. upgrades at least from <=16.04)

@totaam
Copy link
Collaborator

totaam commented May 4, 2021

I don't understand how it is possible that the server can start&connect, but after a few days it cannot re-connect.

This can happen if the $XAUTHORITY file is modified or deleted by some other process. (ie gdm?)
But in this case I think it was an xpra bug that ended up using a different $XAUTHORITY value when recovering the session and when starting..
1b5d31b should ensure the same value is used, and even if not then it will try to re-add an xauth entry when the X11 server socket is present but it fails to connect to it.

Tested using:

xpra start :10 --no-daemon -d server,screen
sleep 10
xpra exit
xauth remove :10
#this will now fail:
DISPLAY=:10 xterm
#but xpra will re-add the xauth entry and succeed:
xpra start :10 --no-daemon -d server,screen

The server will rescue this display despite not being able to access it initially.
A bunch of No protocol specified will be sent to stderr by xlib.

@stdedos
Copy link
Collaborator Author

stdedos commented May 5, 2021

xpra upgrade :2 "crashed" with "Warning: no window manager found, using EWMH window 0x400005, Error: xpra server not found". My currently connected client did not disconnect. (I forgot to check for a socket AGAIN; however, xpra info after that gave me UNKNOWN).

xpra recover :2, however, managed to rescue the servers (and it worked like upgrade, in the sense that all windows were moved on one monitor, instead of the pre-existing allocation)

@stdedos
Copy link
Collaborator Author

stdedos commented May 5, 2021

Perhaps you ran it from a shell that ended up zombied somehow? Then the dead stdin and stdout triggered an endless interrupt storm for that process?

I have no idea 😕. And, since I was not expecting such a quick response, I just patiently typed xpra stop :4

It seems that xpra commands did not per se cause the issue. I have somehow re-created the issue with one terminal tab; no xpra commands have been run, it was not used for at least a day, and it does not seem to rack up CPU time either (and anyway load is 0.16/0.41/0.67)

It seems that terminal tabs "after some time" (after the first spinner?) degenerate to that state.
Maybe it is #3109?

@stdedos
Copy link
Collaborator Author

stdedos commented May 6, 2021

xpra recover :2, however, managed to rescue the servers (and it worked like upgrade, in the sense that all windows were moved on one monitor, instead of the pre-existing allocation)

After recovery I get "This server does not provide start menu data" 😒

@totaam
Copy link
Collaborator

totaam commented May 6, 2021

After recovery I get "This server does not provide start menu data" unamused

I don't! (what a suprise..)
And I even tested on an Ubuntu 20.04 VM to be sure.

xpra start :10
sleep 5;
xpra exit
xpra displays
xpra recover -d exec
sleep 5;
xpra info :10 | grep commands.start-menu

@stdedos
Copy link
Collaborator Author

stdedos commented May 6, 2021

Fun fun fun fun ... I'll try to fake (?) upgrade the server tomorrow.
Fingers crossed 🤞 and let's see ...

@stdedos
Copy link
Collaborator Author

stdedos commented May 7, 2021

Well, I can tell you for a fact that xpra upgrade kills instead of upgrade, and that rescue is ... at least doing the job:

u@h:~$ bat /run/user/1000/xpra/display-\:2-20210507-141812.log 
2021-05-07 14:18:12,379 created unix domain socket '/run/user/1000/xpra/u-h-2'
2021-05-07 14:18:12,380 created unix domain socket '/run/xpra/u-h-2'
2021-05-07 14:18:12,380 created unix domain socket '/home/u/.xpra/u-h-2'
2021-05-07 14:18:12,422 pointer device emulation using XTest
2021-05-07 14:18:12,501 serving html content from '/usr/share/xpra/www'
2021-05-07 14:18:12,512 xvfb pid=2980708
2021-05-07 14:18:12,513 Warning: no window manager found
2021-05-07 14:18:12,513  on display :2 using EWMH window 0x2a00005
2021-05-07 14:18:12,513 Error: xpra server not found
u@h:~$ xpra list
Found the following xpra sessions:
/run/user/1000/xpra:
	UNKNOWN session at :2
/run/xpra:
	UNKNOWN session at :2
/home/u/.xpra:
	UNKNOWN session at :2
Re-probing unknown sessions in: /home/u/.xpra, /run/xpra, /run/user/1000/xpra
^C
caught KeyboardInterrupt(), exiting
u@h:~$ xpra recover
No dead displays found, see 'xpra displays'
u@h:~$ xpra recover :2

@totaam
Copy link
Collaborator

totaam commented May 8, 2021

Ah, reproduced.
The upgrade fails (not sure why yet - it should find the previous instance one way or another) and then it deletes the server sockets! (it should not!)
Then xpra recover doesn't want to recover automatically because the sockets are completely gone. It should figure it out.

Much fixings needed here.

@totaam totaam self-assigned this May 8, 2021
totaam added a commit that referenced this issue May 9, 2021
totaam added a commit that referenced this issue May 9, 2021
@totaam
Copy link
Collaborator

totaam commented May 9, 2021

  • the xpra upgrade was failing because of a silly bug I had introduced during the refactoring for xpra displays..
  • we no longer delete the server sockets unless the upgrade actually succeeds (re-ordering server initialization)
  • xpra recover now works whether the xpra sockets exist or not

@stdedos
Copy link
Collaborator Author

stdedos commented May 9, 2021

Hopefully everything is fine now 😄

Can't wait for Monday (for a change 😝)

@stdedos
Copy link
Collaborator Author

stdedos commented May 10, 2021

It's even worse now. xpra recover :2 will blow up the Xvfb.

 1 created unix domain socket '/run/user/1000/xpra/u-h-2'
 2 created unix domain socket '/run/xpra/u-h-2'
 3 created unix domain socket '/home/u/.xpra/u-h-2'
 4 pointer device emulation using XTest
 5 serving html content from '/usr/share/xpra/www'
 6 xvfb pid=2980708
 7 Warning: no window manager found
 8  on display :2 using EWMH window 0x2800005
 9 Error parsing initial property '_XPRA_CONTENT_TYPE':
10 Traceback (most recent call last):
11   File "/usr/lib/python3/dist-packages/xpra/x11/models/core.py", line 394, in _read_initial_X11_properties
12     handler(self)
13   File "/usr/lib/python3/dist-packages/xpra/x11/models/base.py", line 393, in _handle_xpra_content_type_change
14     self._update_content_type()
15   File "/usr/lib/python3/dist-packages/xpra/x11/models/base.py", line 400, in _update_content_type
16     content_type = guess_content_type(self)
17   File "/usr/lib/python3/dist-packages/xpra/server/window/content_guesser.py", line 247, in guess_content_type
18     return guess_content_type_from_defs(window) or guess_content_type_from_command(window) or DEFAULT_CONTENT_TYPE
19   File "/usr/lib/python3/dist-packages/xpra/server/window/content_guesser.py", line 238, in guess_content_type_from_command
20     ctt = load_command_to_type()
21   File "/usr/lib/python3/dist-packages/xpra/server/window/content_guesser.py", line 202, in load_command_to_type
22     xdg_menu = load_xdg_menu_data()
23   File "/usr/lib/python3/dist-packages/xpra/platform/xposix/xdg_helper.py", line 208, in load_xdg_menu_data
24     xdg_menu_data = do_load_xdg_menu_data()
25   File "/usr/lib/python3/dist-packages/xpra/platform/xposix/xdg_helper.py", line 267, in do_load_xdg_menu_data
26     name = submenu.getName()
27 AttributeError: 'Separator' object has no attribute 'getName'
28 Error: cannot start the seamless server
29 Traceback (most recent call last):
30   File "/usr/lib/python3/dist-packages/xpra/scripts/server.py", line 952, in do_run_server
31     app.server_init()
32   File "/usr/lib/python3/dist-packages/xpra/x11/server.py", line 213, in server_init
33     X11ServerBase.server_init(self)
34   File "/usr/lib/python3/dist-packages/xpra/x11/x11_server_core.py", line 103, in server_init
35     self.x11_init()
36   File "/usr/lib/python3/dist-packages/xpra/x11/server.py", line 276, in x11_init
37     raise InitException("another window manager is active on display '%s'" % display) from None
38   File "/usr/lib/python3/dist-packages/xpra/gtk_common/error.py", line 190, in __exit__
39     trap.Xexit()
40   File "/usr/lib/python3/dist-packages/xpra/gtk_common/error.py", line 119, in Xexit
41     raise XError(error)
42 xpra.gtk_common.error.XError: XError: BadWindow (invalid Window parameter)
43 XError: BadWindow (invalid Window parameter)
44 
45 killing xvfb with pid 2980708
46 removing unix domain socket '/run/user/1000/xpra/u-h-2'
47 removing unix domain socket '/run/xpra/u-h-2'
48 removing unix domain socket '/home/u/.xpra/u-h-2'

I don't honestly know why would xpra "decide" it's "okay" to kill the xvfb 😕

@totaam
Copy link
Collaborator

totaam commented May 10, 2021

I don't honestly know why would xpra "decide" it's "okay" to kill the xvfb confused

It's not. And it doesn't for me.
Can you please provide steps? How did you end up in a situation where you had to xpra recover?
Was the xpra server process still running? Were the socket still there? In what state?
Did you run xpra displays or xpra sessions before xpra recover to see what data it was going to be working with?

totaam added a commit that referenced this issue May 10, 2021
@stdedos
Copy link
Collaborator Author

stdedos commented May 10, 2021

It's not. And it doesn't for me.
Can you please provide steps?

#3088 (comment) + the log above (after apt-get upgrade)

How did you end up in a situation where you had to xpra recover?

Well - right now I am just doing it; hopefully, you'll be able to fix it before I actually need it (and it blows up my xvfb out of the blue).
(I do have that gnome-terminal very-slow-input-issue which gets mitigated by the new instance for some time).

Was the xpra server process still running? Were the socket still there? In what state?

(as above)

Did you run xpra displays or xpra sessions before xpra recover to see what data it was going to be working with?

Yes (as above). It did detect the :2 display

@totaam
Copy link
Collaborator

totaam commented May 10, 2021

#3088 (comment) + the log above (after apt-get upgrade)

That's odd because it should now be impossible to have the dead sockets by running xpra upgrade.
The commit above should prevent the unwanted xvfb killing.
What's odd there is that it didn't just upgrade the instance, telling it to exit instead of bailing out not finding the existing WM.

@stdedos
Copy link
Collaborator Author

stdedos commented May 10, 2021

Whenever you are ready, I can apt-get and retry again ...

@totaam
Copy link
Collaborator

totaam commented May 10, 2021

Whenever you are ready, I can apt-get and retry again ...

You can try now.. but maybe not with a critical session just yet?
It's still not clear to me why you got another window manager is active on display. I'll try harder to reproduce.

@stdedos
Copy link
Collaborator Author

stdedos commented May 10, 2021

The sessions seem to be upgradeable now 😕 (and have a Start menu)

I don't know how to try recover at this state.

@totaam
Copy link
Collaborator

totaam commented May 10, 2021

I don't know how to try recover at this state.

You can use #3088 (comment) or forcibly kill the xpra server process with a kill -9.
The former will remove the xpra server sockets cleanly, the latter won't.
Both should leave the X11 display in a state that xpra recover can fix.

@stdedos
Copy link
Collaborator Author

stdedos commented May 10, 2021

kill -9 at least works. The other one was not tested (I cannot read the code; I'll try verbatim tomorrow).

Also ... I'm not gonna complain again about it; however: Can plain xpra recover not touch servers that are fully operational? e.g. have xpra server, have sockets, have x11, have "x11 sockets" etc? It touches my main season for no reason.

@stdedos
Copy link
Collaborator Author

stdedos commented May 11, 2021

xpra recover :9 :10 does not work; other than that, everything seems seamless 😛

@totaam
Copy link
Collaborator

totaam commented May 11, 2021

xpra recover :9 :10 does not work; other than that, everything seems seamless stuck_out_tongue

As of 117eb76, it does.

Can plain xpra recover not touch servers that are fully operational?

The only way xpra recover can match a display is if xpra displays shows it as DEAD.
And that can only happen if xpra wminfo $DISPLAY doesn't find a valid window manager running on that display. Even if we can't access the display (ie: missing xauth) this will not show up as DEAD.
As of 24a7dbc, it shows it as UNKNOWN.
You can still recover those using xpra recover $DISPLAY but xpra recover will leave them alone.

@stdedos
Copy link
Collaborator Author

stdedos commented May 11, 2021

Can plain xpra recover not touch servers that are fully operational?

The only way xpra recover can match a display is if xpra displays shows it as DEAD.

Weeeeeeeeeeeeeeeeeell, I kinda disagree - I ran xpra recover from my :2 (main) session; and it took it with it. I would be super worried if the screen I was attached said DEAD also 😛.

And that can only happen if xpra wminfo $DISPLAY doesn't find a valid window manager running on that display. Even if we can't access the display (ie: missing xauth) this will not show up as DEAD.
As of 24a7dbc, it shows it as UNKNOWN.
You can still recover those using xpra recover $DISPLAY but xpra recover will leave them alone.

Awesome - just the way I like it (I imagined it as xpra recover -f|--force [...], but dunmatter)

@stdedos
Copy link
Collaborator Author

stdedos commented May 11, 2021

Phew .... glad to have put this behind us 😅

@stdedos
Copy link
Collaborator Author

stdedos commented May 12, 2021

Weeeeeeeeeeeeeeeeeell, I kinda disagree

And proof:

u@h:~$ xpra list
Found the following xpra sessions:
/run/user/1000/xpra:
	UNKNOWN session at :2
	LIVE session at :9
/run/xpra:
	UNKNOWN session at :2
	LIVE session at :9
/home/u/.xpra:
	UNKNOWN session at :2
	LIVE session at :9
Re-probing unknown sessions in: /run/xpra, /home/u/.xpra, /run/user/1000/xpra
^C
caught KeyboardInterrupt(), exiting
u@h:~$ xpra recover
Recovering display ':9' as a seamless server
Entering daemon mode; any further errors will be reported to:
  /run/user/1000/xpra/display-:9-20210512-100336.log
u@h:~$ tail -17 /run/user/1000/xpra/display-\:9-20210512-100032.log 
2021-05-12 10:00:35,907 xpra X11 seamless version 4.2-r29074 (g5db0de9cc) 64-bit
2021-05-12 10:00:35,908  uid=1000 (u), gid=1000 (u)
2021-05-12 10:00:35,908  running with pid 1021030 on Linux Ubuntu 20.04 focal
2021-05-12 10:00:35,912  connected to X11 display :9 with 24 bit colors
2021-05-12 10:03:37,064 Lost WM selection ManagerSelection(WM_S0), exiting
2021-05-12 10:03:37,064 xpra X11 seamless server is exiting
2021-05-12 10:03:37,064 Disconnecting client /run/xpra/u-h-9:
2021-05-12 10:03:37,064  server upgrade
2021-05-12 10:03:37,066 xpra client 1 disconnected.
2021-05-12 10:03:37,081 stopping pulseaudio with pid 1021145
2021-05-12 10:03:37,185 removing private directory '/run/user/1000/xpra/pulse-9'
2021-05-12 10:03:37,187 upgrading: not cleaning up Xvfb
/usr/lib/python3/dist-packages/gi/overrides/Gtk.py:1632: Warning: g_object_ref: assertion 'G_IS_OBJECT (object)' failed
  return _Gtk_main(*args, **kwargs)
2021-05-12 10:03:37,243 started command 'bash -c xpra id "${DISPLAY}" | grep session-type= | cut -d = -f 2 | grep -qP "shadow" || exit 0 ; env DBUS_SESSION_BUS_ADDRESS="$(cut -f 2- -d= "${XDG_RUNTIME_DIR}/dbus-session")" gnome-screensaver-command -l' with pid 1025423
server socket for display :9 is in UNKNOWN state
 waiting up to 20 seconds

Also: Can you now recover displays on attach?

2021-05-12 10:08:40,239 Error: failed to receive anything, not an xpra server?
2021-05-12 10:08:40,246   could also be the wrong protocol, username, password or port
2021-05-12 10:08:40,247   or the session was not found
2021-05-12 10:08:40,248 Connection lost
2021-05-12 10:08:40,261 remote SSH stderr:
2021-05-12 10:08:40,262  server socket for display :2 is in UNKNOWN state
2021-05-12 10:08:40,264   waiting up to 20 seconds
2021-05-12 10:08:40,265  xpra initialization error:
2021-05-12 10:08:40,275   cannot find live server for display :2

And since I've remembered: Can you block xpra recover of touching displays that are "not hers"? e.g. :0, :1 etc.
Not that I have seen such an issue, however, there was a bug (ages ago) that you could do xpra upgrade :0, with not-so-good results.

@stdedos
Copy link
Collaborator Author

stdedos commented May 12, 2021

Oh ... and yet-another-funny thing:

u@h:~$ xpra recover
Recovering display ':9' as a seamless server
Entering daemon mode; any further errors will be reported to:
  /run/user/1000/xpra/display-:9-20210512-100336.log

Never had it ever recovered the :2; I had to do it myself (i.e. xpra recover :2).

@totaam
Copy link
Collaborator

totaam commented May 14, 2021

And proof:

Not for me:

  • started two seamless servers on :2 and :9
  • used kill -9 on :2
$ xpra list
Found the following xpra sessions:
/run/user/1000/xpra:
	UNKNOWN session at :2
	LIVE session at :9
/run/xpra:
	UNKNOWN session at :2
	LIVE session at :9
/home/antoine/.xpra:
	UNKNOWN session at :2
	LIVE session at :9
Re-probing unknown sessions in: /home/antoine/.xpra, /run/user/1000/xpra, /run/xpra
^C
caught KeyboardInterrupt(), exiting
$ xpra recover
No dead displays found, see 'xpra displays'
$ xpra displays
Found 2 displays:
  :1    LIVE        GNOME Shell: uid=0, gid=1000
  :9    LIVE        Xpra: mode=X11 seamless, uid=1000, gid=1000

It does not try to recover a display that is shown as LIVE, only DEAD ones.

Also: Can you now recover displays on attach?

I guess we could. Maybe a new subcommand could be added to mean I want to see this display, do whatever is needed to let me see it (ie: start a shadow server if you have to, recover a seamless server if you have to, etc)
But it is too late for 4.2.

Can you block xpra recover of touching displays that are "not hers"?

As per above, that is already the case. Only DEAD displays can be recovered automatically.
Now if you specify a display yourself, that's a different thing.

Never had it ever recovered the :2; I had to do it myself (i.e. xpra recover :2).

It would if you let xpra list timeout and remove the dead sockets.
I guess that if there aren't any DEAD servers, xpra recover could then wait and timeout the UNKNOWN server sockets - then there would be DEAD servers it could upgrade.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants