Ylianst/MeshAgent

Linux interactive agent asks to install/update Zenity while it is already there

Closed this issue · 19 comments

Hi,

Thanks again for all the work you do.

I am running MeshCentral 0.6.99. I tried to use the interactive agent on a Ubuntu 20.04 laptop today, but it failed saying The graphical version of this installer cannot run on this system. Try installing/updating Zenity, and run again. I checked and Zenity was installed (3.32.0-5).

I tried to run the same interactive agent in an Ubuntu 20.04 live image, and it works properly. Any idea why it failed on this particular laptop? Sorry I am really bad at reading .js… I don't have this laptop at home but can do a few tests in the following days if needed.

From a terminal window on your laptop, can you run the following two commands wherever your agent is installed, and let me know the result?

./meshagent -exec "console.log(require('message-box').zenity);process.exit();"

./meshagent -exec "console.log(require('message-box').zenity.extra);process.exit();"

If the second command returns false, I suspect your Linux system is configured to use wayland. If that's the case you need to do the following 3 things:

  1. Open /etc/gdm/custom.conf or /etc/gdm3/custom.conf
  2. Uncomment: WaylandEnable=false.
  3. Add the following line to the [daemon] section:
    DefaultSession=gnome-xorg.desktop

If the previous suggestion corrects your issue, I'll add a check for this, so that it gives you a better suggested solution.

Thanks Bryan for the answer.

I ran these two commands and both fail with this message:

The graphical version of this installer cannot run on this system.
Try installing/updating Zenity, and run again.

You can also run the text version from the command line with the following command(s): 
./meshcentral -connect

I double checked, the session does not run with Wayland (and indeed, running ./meshagent -connect works perfectly). Also, just to confirm, I run zenity myself on this computer for personal scripts so it is properly installed and working.

Ok sorry, I meant run it with the agent, not the installer...
But you can run the commands on the installer too, if you add the --no-embedded=1 switch at the end... So try running these two commands for me, and tell me the result:

./meshcentral -exec "console.log(require('message-box').zenity);process.exit();" --no-embedded=1
./meshcentral -exec "console.log(require('message-box').zenity.extra);process.exit();" --no-embedded=1

You're not connected to your linux machine via an SSH session are you? I have Ubuntu 20 running with the same version of zenity... The only way this should fail, is if the agent can't find the xserver instance for the current session.

Thanks for your answer. The commands I previously ran was with the interactive agent, not the installer.
Here is the output of the last commands you gave me:

./meshcentral -exec "console.log(require('message-box').zenity);process.exit();" --no-embedded=1
{ path: /usr/bin/zenity, timeout: false }

./meshcentral -exec "console.log(require('message-box').zenity.extra);process.exit();" --no-embedded=1
false

I always logged normally, not via SSH. I just checked, $DISPLAY has the usual value :0.

Ok, how about this command:
./meshcentral -exec "try{var u=require('user-sessions').consoleUid();var x=require('monitor-info').getXInfo(u);console.log(x);}catch(e){console.log(e);}process.exit();" --no-embedded=1

Sorry for the delay, I have been quite busy and the computer where there is this issue is no easily reachable.

Your last command returns nobody logged into console. Note that I tried this command with server and corresponding interactive agent in versions 0.7.9, 0.7.10 and 0.7.14.

if you just run the command: who what does it return?

You are right, who does not return anything (but return code is 0)… I notice that /var/run/utmp and /var/run/wtmp are missing, I will have to investigate. I suppose who is expected to return something: you could just change the error message for this particular case, or you can state that this issue should never arise :-)

Anyway, thanks for your work on debugging this issue, I am sorry the problem was on my side.

Regards,
Yvan

You are right, who does not return anything (but return code is 0)… I notice that /var/run/utmp and /var/run/wtmp are missing, I will have to investigate. I suppose who is expected to return something: you could just change the error message for this particular case, or you can state that this issue should never arise :-)

Anyway, thanks for your work on debugging this issue, I am sorry the problem was on my side.

Regards,
Yvan

Interesting... I do remember Puppy Linux behaves similarly, as it doesn't return anything for 'who', among a few other oddities... I had some work-arounds for Puppy Linux around this for a few other things, but I don't think I ran the binary installer on Puppy Linux, so I'll take a look at that when I get back...

You are right, who does not return anything (but return code is 0)… I notice that /var/run/utmp and /var/run/wtmp are missing, I will have to investigate. I suppose who is expected to return something: you could just change the error message for this particular case, or you can state that this issue should never arise :-)

Anyway, thanks for your work on debugging this issue, I am sorry the problem was on my side.

Regards,
Yvan

ok, I just cofirmed Puppy Linux does almost the exact same thing... It gives the same error message.. Altho in puppy linux's case, who doesn't exist, which is what I used to work around this issue for other use cases. (But I didn't for the binary installer)...

In your case tho, you said who exists, it just doesn't return anything... But you said /var/run/utmp is also missing... This is the same with Puppy Linux, so I will probably include this in the work-around... I'll do testing with Puppy Linux, and send you something you can test on your system when I get it working.

On a side note, is your ubuntu system configured with no users? Puppy linux essentially does not have any users, as when you power it on, you are automatically logged in as a root user. This is why /var/run/utmp is missing and who doesn't exist on Puppy Linux.

I forgot about Puppy Linux's existence :-)

I can not tell why this Ubuntu computer has this weirdness, I think I installed it in a very classical manner (i.e. with the graphical installer) and did not configure anything fancy on it. Do no hesitate to ask if you want me to do some test.

Did you set up Ubuntu to autologin? Or do you actually have to specify a username/password to login?

did you do a clean install or an upgrade of your ubuntu machine? From what I can tell online, it looks like there used to be a bug in systemd, that caused this issue during an OS update. But it looked like you could just manually create utmp and wtmp, to restore functionality.

I think I did a clean install of this computer. But indeed, autologin might be enabled, I will have to check, probably only next week…

In case you are interested in this strange Ubuntu issue, I spent some time on it without success. Autologin was indeed enabled. I can create /var/run/utmp with proper owner/group/permissions but it is deleted on each reboot, even if I disable autologin in lightdm. I also had a very quick look to systemctl status systemd-update-utmp.service and it seems to be OK. I have no other idea right now.

Feel free to close this issue as this computer's issue seems to be very uncommon and might not deserve a workaround in the mesh agent…