ztefn / haguichi

Haguichi provides a graphical frontend for Hamachi on Linux.
https://haguichi.net
GNU General Public License v3.0
151 stars 8 forks source link

Getting a "Hamachi version 2.1.0.203 is obsolete" message on start. #55

Closed polemion closed 1 year ago

polemion commented 1 year ago

I have built an app2image for Hamachi (for personal use, I intend on posting a guide at some point), using the the Ubuntu libs which should prevent it from crashing all the time.

The issue is that when Haguichi starts, it tries to detect the version, and even though is the latest, it throws the following error: "Hamachi version 2.1.0.203 is obsolete"

Is there a way to bypass the version check?

ztefn commented 1 year ago

Could you provide the output from starting Haguichi in debug mode from terminal using command: haguichi --debug

polemion commented 1 year ago

Hey, yes of course!

[12:30:02.196602 INFO] [Haguichi.startup] Greetings, I am Haguichi 1.4.5
[12:30:02.196635 ENVIRONMENT] [Haguichi.startup] Running inside Flatpak sandbox: false
[12:30:02.197159 ENVIRONMENT] [Settings.check] Settings are on stamp 2
[12:30:02.197252 INFO] [Key.get_value] Getting value for GSettings key connect-on-startup...
[12:30:02.197297 INFO] [Key.get_value] Getting value for GSettings key disconnect-on-quit...
[12:30:02.197334 INFO] [Key.get_value] Getting value for GSettings key reconnect-on-connection-loss...
[12:30:02.197371 INFO] [Key.get_value] Getting value for GSettings key update-network-list...
[12:30:02.197416 INFO] [Key.get_value] Getting value for GSettings key customizable...
[12:30:02.197455 INFO] [Key.get_value] Getting value for GSettings key init-system...
[12:30:02.197502 INFO] [Key.get_value] Getting value for GSettings key super-user...
[12:30:02.197561 INFO] [Key.get_value] Getting value for GSettings key check-internet-hostname...
[12:30:02.197607 INFO] [Key.get_value] Getting value for GSettings key check-internet-ip...
[12:30:02.197648 INFO] [Key.get_value] Getting value for GSettings key nickname...
[12:30:02.197872 INFO] [Key.get_value] Getting value for GSettings key protocol...
[12:30:02.197917 INFO] [Key.get_value] Getting value for GSettings key reconnect-interval...
[12:30:02.197963 INFO] [Key.get_value] Getting value for GSettings key update-interval...
[12:30:02.198030 INFO] [Key.get_value] Getting value for GSettings key collapsed-networks...
[12:30:02.198073 INFO] [Key.get_value] Getting value for GSettings key long-nicks...
[12:30:02.198118 INFO] [Key.get_value] Getting value for GSettings key member-template-large...
[12:30:02.198160 INFO] [Key.get_value] Getting value for GSettings key member-template-small...
[12:30:02.198203 INFO] [Key.get_value] Getting value for GSettings key network-template-large...
[12:30:02.198244 INFO] [Key.get_value] Getting value for GSettings key network-template-small...
[12:30:02.198294 INFO] [Key.get_value] Getting value for GSettings key show-offline-members...
[12:30:02.198348 INFO] [Key.get_value] Getting value for GSettings key sort-by...
[12:30:02.198415 INFO] [Key.get_value] Getting value for GSettings key connection-loss...
[12:30:02.198458 INFO] [Key.get_value] Getting value for GSettings key member-join...
[12:30:02.198501 INFO] [Key.get_value] Getting value for GSettings key member-leave...
[12:30:02.198541 INFO] [Key.get_value] Getting value for GSettings key member-offline...
[12:30:02.198582 INFO] [Key.get_value] Getting value for GSettings key member-online...
[12:30:02.198630 INFO] [Key.get_value] Getting value for GSettings key height...
[12:30:02.198675 INFO] [Key.get_value] Getting value for GSettings key position-x...
[12:30:02.198718 INFO] [Key.get_value] Getting value for GSettings key position-y...
[12:30:02.198761 INFO] [Key.get_value] Getting value for GSettings key prefer-dark-theme...
[12:30:02.198803 INFO] [Key.get_value] Getting value for GSettings key show-indicator...
[12:30:02.198845 INFO] [Key.get_value] Getting value for GSettings key sidebar-position...
[12:30:02.198887 INFO] [Key.get_value] Getting value for GSettings key width...
[12:30:02.266071 GUI] [Window.set_styles] Loading mint stylesheet
[12:30:02.297988 ENVIRONMENT] [Inhibitor.aquire] Acquiring inhibit lock.
[12:30:02.301419 ENVIRONMENT] [Utils.path_exists] FileUtils tested true for path /var/lib/logmein-hamachi
[12:30:02.301500 INFO] [Haguichi.startup] Completed startup in 104916 microseconds
[12:30:02.302280 GUI] [Window.on_state_changed] Minimized: false
[12:30:02.302311 GUI] [Window.on_state_changed] Maximized: false
[12:30:02.303785 ENVIRONMENT] [Command.determine_sudo] pkexec
[12:30:02.315404 ENVIRONMENT] [Command.determine_terminal] xfce4-terminal
[12:30:02.326563 ENVIRONMENT] [Command.determine_file_manager] thunar
[12:30:02.334633 ENVIRONMENT] [Command.determine_remote_desktop] vncviewer
[12:30:02.428186 ERROR] [Command.return_output] stderr: qt5ct: using qt5ct plugin

[12:30:02.428242 HAMACHI] [Hamachi.get_info] hamachid: must be run with superuser permissions

[12:30:02.516771 ERROR] [Command.return_output] stderr: qt5ct: using qt5ct plugin

[12:30:02.516812 HAMACHI] [Hamachi.determine_version] LogMeIn Hamachi, a zero-config virtual private networking utility, ver 2.1.0.203

  usage: hamachid [-r <ipc_path>] [-c <cfg_path>] [debug]

  -c         overrides default configuration directory (/var/lib/logmein-hamachi)

[12:30:02.516858 HAMACHI] [Hamachi.determine_version] Hamachi 2.1.0.203 detected
[12:30:02.516887 ENVIRONMENT] [Utils.path_exists] FileUtils tested true for path /run/systemd/system
[12:30:02.861348 ENVIRONMENT] [Hamachi.systemctl_unit_found] ● logmein-hamachi.service - Hamachi Service
     Loaded: loaded (/etc/systemd/system/logmein-hamachi.service; disabled; vendor preset: enabled)
     Active: inactive (dead)
       Docs: https://www.vpn.net/linux

[12:30:02.861531 ENVIRONMENT] [Hamachi.systemctl_unit_found] true
[12:30:02.861637 ENVIRONMENT] [Hamachi.determine_service] auto: systemctl {0} logmein-hamachi.service
[12:30:02.862227 HAMACHI] [Hamachi.get_account]
[12:30:02.862419 ENVIRONMENT] [Utils.path_exists] FileUtils tested true for path /var/lib/logmein-hamachi/h2-engine-override.cfg
[12:30:02.862580 ENVIRONMENT] [Controller.has_internet_connection] Trying to ping 8.8.8.8...
[12:30:02.866864 HAMACHI] [Hamachi.get_address] IPv4:
[12:30:02.867061 HAMACHI] [Hamachi.get_address] IPv6:
[12:30:02.867223 HAMACHI] [Hamachi.get_address] IP version:
[12:30:02.867441 HAMACHI] [Hamachi.get_client_id]
[12:30:02.931172 ENVIRONMENT] [Controller.has_internet_connection] PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=57 time=59.1 ms

--- 8.8.8.8 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 59.117/59.117/59.117/0.000 ms

[12:30:02.931344 ENVIRONMENT] [Controller.has_internet_connection] Success!
[12:30:02.931502 INFO] [Controller.status_check] Unknown.
[12:30:07.646266 GUI] [Window.on_state_changed] Minimized: false
[12:30:07.646413 GUI] [Window.on_state_changed] Maximized: false

It may have some inconsistencies to be said, since I am in developing mode right now, thanks by the way

ztefn commented 1 year ago

Two requests appear to receive standard error qt5ct: using qt5ct plugin instead of actual response from hamachi. This is an issue on the host system (Haguichi doesn't use Qt5). One of these requests output is used by Haguichi to determine the state hamachi is in and thus failed [12:30:02.931502 INFO] [Controller.status_check] Unknown..

So the message "Hamachi version 2.1.0.203 is obsolete" that Haguichi shows is incorrect and should instead have been something like "Error detecting Hamachi".

polemion commented 1 year ago

Thank you for your response.

I will of course close the issue, I guess disabling the detection (as an option) is a feature instead.

Do note that even though the error appear on hamachi's start, hamachi does function without any issues afterwards.

One of these requests output is used by Haguichi to determine the state hamachi 

This is what I was suspecting, thank you for confirming it.

ztefn commented 1 year ago

Actually, looking deeper into this. The standard errors do not seem to be the issue because, there is actually also standard output returned. But the output is from hamachid (ending with d from daemon, usually in /opt/logmein-hamachi/bin) intstead of hamachi (without d at the end, usually in /usr/bin). And they return different output when called as non super user (which is very strange because the latter is just a symbolic link to the other):

hamachi:

Hamachi does not seem to be running.
Run '/etc/init.d/logmein-hamachi start' to start daemon.

hamachid:

hamachid: must be run with superuser permissions

Haguichi only recognizes only the first output and not the second... so that will be easy to fix.

This also means that indeed Haguichi should function fine if hamachi daemon is already started.

ztefn commented 1 year ago

Ah, forget that last thing. Haguichi cannot talk directly to hamachid because that binary wants superuser permissions for each and every call...

polemion commented 1 year ago

Thanks for the extra info!

Having the Hamachi daemon already started, still makes Haguichi complain about the version.

I'll see if I can manipulate the output from Hamachi's appimage, the extra messages are caused because of the Appimagelauncher which is interfering.

ztefn commented 1 year ago

Best advice I can give is to make sure that the hamachi binary is a symbolic link to the daemon. That should apparently be sufficient to have the hamachi command available without superuser privileges (if properly configured). This is the bash command that hamachi installer runs:

ln -sf /opt/logmein-hamachi/bin/hamachid /usr/bin/hamachi

polemion commented 1 year ago

Strange, I have eliminated the extraneous output, but I still get the same version issue:

[15:47:14.984988 GUI] [Window.on_state_changed] Maximized: false
[15:47:15.075123 HAMACHI] [Hamachi.get_info] hamachid: must be run with superuser permissions

[15:47:15.156856 HAMACHI] [Hamachi.determine_version] LogMeIn Hamachi, a zero-config virtual private networking utility, ver 2.1.0.203

  usage: hamachid [-r <ipc_path>] [-c <cfg_path>] [debug]

  -c         overrides default configuration directory (/var/lib/logmein-hamachi)

[15:47:15.156918 HAMACHI] [Hamachi.determine_version] Hamachi 2.1.0.203 detected
[15:47:15.156945 ENVIRONMENT] [Utils.path_exists] FileUtils tested true for path /run/systemd/system
polemion commented 1 year ago

image

polemion commented 1 year ago

Anyway, this is not a Haguichi issue, it is an issue with the Hamachi implementation I am trying to make.

So thanks for all the info supplied so far

ztefn commented 1 year ago

Yeah, like I said above that's because the hamachi command on your system points to hamachid (daemon) instead of "plain" hamachi.

ztefn commented 1 year ago

I can see the difference because version detection runs hamachi -h.

hamachi (normal) output:

$ /usr/bin/hamachi -h
LogMeIn Hamachi, a zero-config virtual private networking utility, ver 2.1.0.203

  usage: hamachi [-r <ipc_path>] [command]

  command    specifies an action. Can be one of the following -

             #  set-nick <nickname>
                login
                logon
                logout
                logoff
             #  list
                peer <client id>
                network <network id>
             #  create <network id> [<password>]
                set-pass <network id> [<password>]
                set-access <network id> [lock|unlock] [manual|auto]
                delete <network id>
                evict <network id> <client id>
             #  approve <network id> <client id>
                reject <network id> <client id>
             #  join <network id> [<password>]
                do-join <network id> [<password>]
                leave <network id>
             #  go-online <network id>
                go-offline <network id>
             #  attach <LogMeIn account>
                attach-net <LogMeIn account>
                cancel
             #  gw-config <network id>
                    [dhcp|static [net <start ip> <end ip> <netmask> <default gateway>]
                                 [domain <dns domain>]
                                 [dns <dns ip 1> [<dns ip 2>]]]
                    [del <remote subnet CIDR> ...]
                    [add <remote subnet CIDR> ...]
             #  set-ip-mode ipv4 | ipv6 | both
             #  check-update
                vpn-alias <client id> <vpn-alias address>|0
                proxy-pass [<proxy password>]
                remove-proxy-pass

  If no command is specified, hamachi displays its status including version,
  pid, client id, online status, nickname and the LogMeIn account

hamachid (deamon) output:

$ /opt/logmein-hamachi/bin/hamachid -h
LogMeIn Hamachi, a zero-config virtual private networking utility, ver 2.1.0.203

  usage: hamachid [-r <ipc_path>] [-c <cfg_path>] [debug]

  -c         overrides default configuration directory (/var/lib/logmein-hamachi)

On your system the command hamachi -v returns output from the daemon instead of hamachi command line. That's your problem.

polemion commented 1 year ago

Yeah that's it!

This strange thing with the symbolic link changing the behavior of Hamachi, is causing issues with the appimage.

I was under the impression that Haguichi was interacting with the service (hamachid), as I understand now it interacts with the Hamachi.

OK, thanks again, I'll see what I can do, I really appreciate all the help!

polemion commented 1 year ago

It works.

I had to create two different appimages though, one for the hamachid and one for the hamachi...

Now it only needs testing it's stability.