Subject: Bug#697: Nightly x2goserver crashes the x2go windows client on connect

From: Jasmin Lévesque <[email-masked]>
Date: Wed, 10 Dec 2014 19:09:44 -0500

Package: x2goserver
Version: git master @HEAD

When using the latest x2goserver and connecting with x2go client on
Windows, the client crashes on connect.

I tried the latest nightly build and my own compiled from HEAD (to solve
issue #676), with 2 different clients (v4.0.3.0 & v4.0.2.0)  the behavior
is the same.

I also tried not to use a full fledged KDE session, even with a single
application "xterm" the app crashes. I tried a combination of client-side
configs (no sound, no clipboard, no printing etc..) with the same results.

I created a server with a fresh CentOS install to isolate any possible
server-side configuration issue, the behavior is the same again.

I see that the server creates the ssh connection, the client get to
acknowledge the new server ssh key, the client crashes a few seconds later.
There is no log entries generated in the %userprofile%/.x2go or in the
/home/$USER/.x2go/  folder.

If you can think about any other test case, i'm willing to try them and
provide feedback.

Thanks,

Jasmin Levesque
Senior System Analyst
Vlan! Technologie

---

From: Mike Gabriel <[email-masked]>
Date: Thu, 11 Dec 2014 10:03:09 +0000

Hi Jasmin,

> If you can think about any other test case, i'm willing to try them and

to narrow down this issue, please try these steps:

   o enable loglevel=debug in /etc/x2go/x2goserver.conf, what do you see in
     /var/log/messages?
   o use a Linux X2Go Client
   o use PyHoca-GUI or PyHoca-CLI as client application for X2Go on a Linux
     machine (with --libdebug option on the cmdline)
   o btw. do you actually see the session window (for desktop sessions)
     appear? (and then disappear?)
   o try ssh user@server -X nxagent :20 (does nxagent come up?)

We have to find out, if your crash is an X2Go Server bug or an NX bug  
on EPEL-7.

Thanks+Greets,
Mike

-- 

DAS-NETZWERKTEAM
mike gabriel, herweg 7, 24357 fleckeby
fon: +49 (1520) 1976 148

GnuPG Key ID 0x25771B31
mail: [email-masked], http://das-netzwerkteam.de

freeBusy:
https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-netzwerkteam.de.xfb

---

From: Jasmin Lévesque <[email-masked]>
Date: Thu, 11 Dec 2014 22:12:50 -0500

> 1  o enable loglevel=debug in /etc/x2go/x2goserver.conf, what do you see in
>     /var/log/messages?
> 2  o use a Linux X2Go Client
> 3  o use PyHoca-GUI or PyHoca-CLI as client application for X2Go on a Linux
> 4  o btw. do you actually see the session window (for desktop sessions)
> 5  o try ssh user@server -X nxagent :20 (does nxagent come up?)
>
> We have to find out, if your crash is an X2Go Server bug or an NX bug on
> EPEL-7.
>
> Thanks+Greets,
> Mike
>

1- /var/log/message with debug loglevel on server after a try with a
Windows client:
Dec 11 21:24:42 centos7nightly systemd: Created slice user-1000.slice.
Dec 11 21:24:42 centos7nightly systemd: Starting Session 3 of user jasminl.
Dec 11 21:24:42 centos7nightly systemd: Started Session 3 of user jasminl.
Dec 11 21:24:42 centos7nightly systemd-logind: New session 3 of user
jasminl.
Dec 11 21:24:45 centos7nightly systemd-logind: Removed session 3.

2- On a CentOS 7 machine, with x2goclient:
x2go-INFO-1> "Starting x2goclient..."
x2go-WARNING-1> "Can't load translator: :/x2goclient_en_us"
x2go-WARNING-2> "Can't load translator: :/qt_en_US"
x2go-INFO-3> "Started  x2goclient."
x2go-INFO-8> "Starting connection to server: 10.10.1.147:22"
Segmentation fault (core dumped)

3-On a CentOs 7 machine, PyHoca-GUI rpm dependency boken with epel...
requires notify-python, PyHoca-CLI installs successfully (will created
another bug for that one..) so...
Calling "pyhoca-cli --server 10.10.1.147 --libdebug -q lan --password
mypass":
Traceback (most recent call last):
  File "/usr/bin/pyhoca-cli", line 422, in <module>
    thisPyHocaCLI.authenticate()
  File "/usr/lib/python2.7/site-packages/pyhoca/cli/frontend.py", line 455,
in authenticate
    self._X2GoClient__connect_session(self.x2go_session_hash,
username=_username, password=self.args.password,
force_password_auth=force_password_auth)
  File "/usr/lib/python2.7/site-packages/x2go/client.py", line 1367, in
connect_session
    sshproxy_force_password_auth=sshproxy_force_password_auth,
  File "/usr/lib/python2.7/site-packages/x2go/session.py", line 1355, in
connect
    self.update_status()
  File "/usr/lib/python2.7/site-packages/x2go/session.py", line 1641, in
update_status
    raise e
x2go.x2go_exceptions.X2GoControlSessionException: x2golistsessions command
failed after we have tried 20 times

In the server's /var/log/message:
Dec 11 22:05:33 centos7nightly systemd: Starting Session 14 of user jasminl.
Dec 11 22:05:33 centos7nightly systemd-logind: New session 14 of user
jasminl.
Dec 11 22:05:33 centos7nightly systemd: Started Session 14 of user jasminl.
Dec 11 22:05:33 centos7nightly /usr/bin/x2gofeaturelist: x2gofeaturelist
called with options:
Dec 11 22:06:00 centos7nightly systemd: Failed to mark scope
session-14.scope as abandoned : Stale file handle
Dec 11 22:06:00 centos7nightly systemd-logind: Removed session 14.

While trying to run x2golistsessions on the server:
DBIconnect('dbname=/var/x2go/x2go_sessions','',...)failed:unabletoopendatabasefileat/usr/share/perl5/vendor_perl/X2Go/Server/DB/SQLite3.pmline67.

Could it be possible that the DB was never created / initialized during
x2goserver's install process? or is it something else entirely? Am I using
pyhoca-cli correctly?

4- No, I don't see the same behavior as with bug #675

5- Yes, if by nxagent you mean a black empty window with NX as the title.

Thanks for the followups

Jasmin

---

From: Mike Gabriel <[email-masked]>
Date: Thu, 08 Jan 2015 22:54:17 +0000

Hi Jasmin,

> DBIconnect('dbname=/var/x2go/x2go_sessions','',...)failed:unabletoopendatabasefileat/usr/share/perl5/vendor_perl/X2Go/Server/DB/SQLite3.pmline67.

Sorry for getting back so late to your follow-up post for #697.

Is the issue solved by now? If not, try

   sudo x2goadmindb --createdb

and re-test session startup. Does that bring a solution?

Mike

-- 

DAS-NETZWERKTEAM

GnuPG Key ID 0x25771B31

freeBusy:

---

From: Mike Gabriel <[email-masked]>
Date: Thu, 08 Jan 2015 22:56:26 +0000

> DBIconnect('dbname=/var/x2go/x2go_sessions','',...)failed:unabletoopendatabasefileat/usr/share/perl5/vendor_perl/X2Go/Server/DB/SQLite3.pmline67.

Also: the x2go_sessions file should be in /var/lib/x2go/x2go_sessions,  
this was a previous problem with the RPM packages provided by X2Go.

Please adapt the HOME path for system user x2gouser on your system  
(set it to /var/lib/x2go). Then re-run x2godbadmin --createdb (I  
misspelled the command name in my previous mail) and try another  
session startup.

Mike

-- 

DAS-NETZWERKTEAM

GnuPG Key ID 0x25771B31

freeBusy:

---

From: Jasmin Lévesque <[email-masked]>
Date: Sun, 11 Jan 2015 21:29:26 -0500

Happy new year!

I just did the manual changes you suggested, it works.

So I removed my rebuilt RPMs to install the latest nightly build. It still
creates the "x2gouser" with the wrong HOME path and the x2go_sessions DB is
missing. The version used was x2goserver.x86_64
0:4.1.0.0-0.0x2go1.0.git20150109.1211.heuler.el7.centos.

I've checked the HEAD for spec file in git. In x2goserver.spec, the
usercreate and the DB creation seems ok. Is it possible that the nightly
RPM "git20150109.1211" is not really the latest? Am I missing something?

Thanks for the follow-ups

Jasmin

On Thu, Jan 8, 2015 at 5:56 PM, Mike Gabriel <
[email-masked]> wrote:

>> DBIconnect('dbname=/var/x2go/x2go_sessions','',...)failed:
>> unabletoopendatabasefileat/usr/share/perl5/vendor_perl/
>> X2Go/Server/DB/SQLite3.pmline67.
>>
>
> Please adapt the HOME path for system user x2gouser on your system (set it
> to /var/lib/x2go). Then re-run x2godbadmin --createdb (I misspelled the
> command name in my previous mail) and try another session startup.
>
>
> Mike
>
> --
>
> DAS-NETZWERKTEAM

---

From: Jasmin Lévesque <[email-masked]>
Date: Sun, 11 Jan 2015 21:44:26 -0500

Found something better while digging HEAD.

In the .spec file, you create the user with: "%{_localstatedir}/x2go" as
the home. On CentOS 7, this would mean /var/x2go, if you want to specify
/var/lib/x2go, you would have to use "%{_sharedstatedir}/x2go". The
x2godbadmin then fails afterwards because /var/x2go doesn't exist and is
not writable by x2gouser.

Hope this helps,

Jasmin

---

From: Mike Gabriel <[email-masked]>
Date: Mon, 12 Jan 2015 04:33:05 +0000

Hi Jasmin,

> not writable by x2gouser.

thanks for digging this out.

I have just searched the web a bit and found [1].

I choose "%{_localstatedir}/lib/x2go" in favour of  
"%{_sharedstatedir}/x2go" for fixing this issue.

Greets
Mike

[1] https://gitlab.labs.nic.cz/labs/knot/issues/48

-- 

DAS-NETZWERKTEAM

GnuPG Key ID 0x25771B31

freeBusy: