Discussion:
[X2Go-User] Broker and resuming sessions
David Barron
2018-10-31 16:42:18 UTC
Permalink
First a little explanation of the architecture.
The login server load balances sessions between 3 servers where the actual applications run. That part is working fine.

The problem is when I suspend a session instead of ending it. My understanding was that if I chose the same session profile it would resume my application at the same point. That's not what I'm seeing.

First, when I run x2golistsessions it does not show my currently running session. Then if I suspend the session I still don't see it listed. I've checked it on all three of the servers.

Then when I run the same session it is starting a new one rather than resuming. Well, I guess it can't do anything else since my session isn't stored.

Can I suspend a session in this kind of environment? The documentation seems to say I can. Is there something special I have to do in the client to get it working?

Currently the only command line option I am using with the client is -broker-url=http://<hostmane>:8080/plain/inifile

Should I use something else?

Thanks


architects of vision and strategy for business intelligence

David Barron
Senior Consultant
Zencos Consulting: ***@zencos.com

[www.zencos.com]<http://www.zencos.com/>

work:

919-480-2761

mobile:

919-995-2356

fax:

919-287-2335



The information in this e-mail and any attached files is confidential. It is intended solely for the use of the addressee. Any unauthorized disclosure or use is prohibited. If you are not the intended recipient of the message, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. The views of the author may not necessarily reflect those of the company.
Stefan Baur
2018-10-31 18:44:47 UTC
Permalink
David,

If you're using the official, python-based X2Go Broker and are seeing
this issue, it would point to a problem with your session database setup.
You need to set up all X2GoServers to share the same session database
(using postgres, rather than SQLite) - preferably on a dedicated
postgres server that has some kind of failover mechanism.
x2golistsessions --all-servers should show your session if your setup is
working properly.

Also, make sure all the X2GoServers share the same home directories.

Feel free to set up a demo cluster using our instructions here
<https://wiki.x2go.org/doku.php/doc:howto:x2gobroker> and compare the
behavior/result.

And, of course, there is always the option to pay for commercial support
and have someone knowledgeable "look over your shoulder" via a shared
SSH session - you can find a list of support companies here:
<https://wiki.x2go.org/doku.php/doc:professional-support>

Kind Regards,
Stefan Baur

Am 31.10.18 um 17:42 schrieb David Barron:
> First a little explanation of the architecture.
> The login server load balances sessions between 3 servers where the actual applications run. That part is working fine.
> The problem is when I suspend a session instead of ending it. My understanding was that if I chose the same session profile it would resume my application at the same point. That's not what I'm seeing.
> First, when I run x2golistsessions it does not show my currently running session. Then if I suspend the session I still don't see it listed. I've checked it on all three of the servers.
> Then when I run the same session it is starting a new one rather than resuming. Well, I guess it can't do anything else since my session isn't stored.
> Can I suspend a session in this kind of environment? The documentation seems to say I can. Is there something special I have to do in the client to get it working?
> Currently the only command line option I am using with the client is -broker-url=http://<hostmane>:8080/plain/inifile
> Should I use something else?

Kind Regards,
Stefan Baur

--
BAUR-ITCS UG (haftungsbeschränkt)
Geschäftsführer: Stefan Baur
Eichenäckerweg 10, 89081 Ulm | Registergericht Ulm, HRB 724364
Fon/Fax 0731 40 34 66-36/-35 | USt-IdNr.: DE268653243
Stefan Baur
2018-10-31 19:39:37 UTC
Permalink
Am 31.10.18 um 20:16 schrieb David Barron:
> Stefan,
> I've made a few discoveries since I sent the email.
>
> First, I was not aware that x2golistsessions only shows the sessions for the person running it. When I run it as me I do see my suspended sessions, so that's good.

If you want an overview over all sessions on the server, then run:

x2golistsessions_root

(as the name indicates, this requires a root account)


> Second all the X2GoServers are using the same session database. PostgreSQL is running on the login server and the 3 servers where the applications run all access the same data.
>
> And the home directories are shared between all the servers.
>
> Still, even though the sessions as suspended they are not being started. To be sure, I've cleaned them all out using x2goterminatesession, then started a new session and suspended it. But when I try to execute the same session I am getting a new one, not the suspended one.

Are you seeing the suspended session as well as the running one in the
session list?


> Any other thoughts?

Yes, is the problem also present when you try to use the broker via SSH
instead of HTTP?

Did you run x2gobroker-keygen on the broker server?

Did you invoke x2go-pubkeyauthorizer with the proper parameters on all
required machines? If so, you should have the same authorized_keys file
in /var/lib/x2gobroker/.ssh/ on the three servers as well as on the broker.

Have you added the users via
x2godbadmin --adduser USERNAME_GOES_HERE

-Stefan

--
BAUR-ITCS UG (haftungsbeschränkt)
Geschäftsführer: Stefan Baur
Eichenäckerweg 10, 89081 Ulm | Registergericht Ulm, HRB 724364
Fon/Fax 0731 40 34 66-36/-35 | USt-IdNr.: DE268653243
Stefan Baur
2018-10-31 20:51:02 UTC
Permalink
David,

Please fix your quoting and reply to the list only. Having to manually
fix your broken quoting each time I'm replying to you is a PITA.

Am 31.10.18 um 21:41 schrieb David Barron:
>> Also, please run
>>
>> x2goclient --debug >x2goclientlog 2>&1
>>
>> when you try to connect to the suspended session.
>>
>> Make sure x2goclientlog doesn't contain any information you don't want us to see (i.e. if necessary, replace IPs with dummy IPs, same goes for usernames and passwords that might show up - though passwords shouldn't be visible there), then post the content of the file here.


> The x2go client is running on windows so this won't work.

Yes, it will. However, you need to specify that you want to use the
debug executable *and* specify the --debug parameter.

So:

x2goclient.debug.exe --debug >x2goclientlog 2>&1


> I tried installing it on the linux servers but the yum command complained about missing libraries (again) and I gave up on it.

Which repository are you using and which Linux Distribution/Version are
you on?


> I ran x2goclient.debug with the --broker-url and got this output
>
> C:\Users\dbarron>cd "C:\Program Files (x86)\x2goclient"
>
> C:\Program Files (x86)\x2goclient>x2goclient.debug --broker-url=http://agmrkgrid
> login3:8080/plain/inifile

If you have the x2goclient.debug.exe installed, then why did you drop
the --debug from the call? Please re-run as described above.

Kind Regards,
Stefan Baur

--
BAUR-ITCS UG (haftungsbeschränkt)
Geschäftsführer: Stefan Baur
Eichenäckerweg 10, 89081 Ulm | Registergericht Ulm, HRB 724364
Fon/Fax 0731 40 34 66-36/-35 | USt-IdNr.: DE268653243
David Barron
2018-10-31 21:14:02 UTC
Permalink
My apologies for the broken quoting, I'm hindered by Outlook.


Let's not worry about the yum install of x2goclient failing, that's an issue for another day.


I'm attaching the log.
David Barron
2018-11-01 16:37:47 UTC
Permalink
Stefan,
Did you get the log I sent yesterday?

Thanks

David Barron
Zencos Consulting LLC
***@zencos.com
919-480-2761 (office)
919-995-2356 (mobile)
David Barron
2018-10-31 20:53:39 UTC
Permalink
I just realized, on the login server there is no authorized_keys file in /var/lib/x2gobroker/.ssh, but it is on all 3 of the application servers.


David Barron
Zencos Consulting LLC
***@zencos.com
919-480-2761 (office)
919-995-2356 (mobile)

-----Original Message-----
From: Stefan Baur <X2Go-ML-***@baur-itcs.de>
Sent: Wednesday, October 31, 2018 4:23 PM
To: David Barron <***@zencos.com>; x2go-***@lists.x2go.org
Subject: Re: [X2Go-User] Broker and resuming sessions

Am 31.10.18 um 21:10 schrieb David Barron:


> Yes, is the problem also present when you try to use the broker via SSH instead of HTTP?
> I don't know, I've never been able to figure out how to use ssh. The documentation on that is sparse.

That's why we have the Demo environment install scripts, where you get a fully configured setup from which you can copy settings/configs.

E.g.
<https://wiki.x2go.org/doku.php/doc:howto:x2gobroker?do=export_code&codeblock=9>
creates two desktop entries on the demo client, one for the HTTP, one for the SSH broker access.
See the section below
"COMMENT: This last step creates an X2GoClient-in-Broker-Mode desktop entry"

As you can tell from there, the ssh broker URL would be something like ssh://x2gobroker1.x2go.example.com:/usr/bin/x2gobroker-ssh


> Did you run x2gobroker-keygen on the broker server?
> Yes. Should I run it again?

At the moment, it doesn't sound like you should.


> Did you invoke x2go-pubkeyauthorizer with the proper parameters on all required machines? If so, you should have the same authorized_keys file in /var/lib/x2gobroker/.ssh/ on the three servers as well as on the broker.
> Yes.

Did you compare the content of the files, or merely verify their existence?


> Should I run it again? Again, the documentation is sparse, so what parameters would I use?
If the files all have the identical content, no.

If they differ, copy /var/lib/x2gobroker/.ssh/authorized_keys from the broker to the three X2Go servers, that should keep you from having to re-run the command.

Also, please run

x2goclient --debug >x2goclientlog 2>&1

when you try to connect to the suspended session.

Make sure x2goclientlog doesn't contain any information you don't want us to see (i.e. if necessary, replace IPs with dummy IPs, same goes for usernames and passwords that might show up - though passwords shouldn't be visible there), then post the content of the file here.

-Stefan

--
BAUR-ITCS UG (haftungsbeschränkt)
Geschäftsführer: Stefan Baur
Eichenäckerweg 10, 89081 Ulm | Registergericht Ulm, HRB 724364 Fon/Fax 0731 40 34 66-36/-35 | USt-IdNr.: DE268653243
Loading...