[SOLVED] Windows VM displayed as disconnected

Share your tips or issues concerning the WAPT Console or WAPT Agent here
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
Locked
Dr. Mathieu
Messages: 20
Registration: Oct 31, 2024 - 10:43

February 5, 2025 - 4:31 PM

Hello everyone,

this is my first post on this forum, and despite searching everywhere, I can't find a solution.

We have a Windows VM that appears in our WAPT console, but it's showing as disconnected, which isn't the case because I can access it via RDP and perform actions on it.
I've tried several things with the WAPT agent: reinstalling, stopping and starting the service, checking the configurations and logs. It pings the server, and the same with nslookup, etc., but I still don't understand why it's disconnected.

Another interesting point: when I run "runwaptservice" from the command prompt (CMD), it's connected, and I can perform actions on it. Of course, when I close the command prompt, it disappears again.

Thank you for your help.
User avatar
dcardon
WAPT Expert
Messages: 1929
Registration: June 18, 2014 - 09:58
Location: Saint Sébastien sur Loire
Contact :

February 5, 2025 - 4:53 PM

Hello Mathieu,

Could you run runwaptservice.bat as LOCALSYSTEM to see if it works or not? (The WAPT service runs in the LOCALSYSTEM context).

To do this, you can use the psexec.exe command line from Microsoft Sysinternals (if your EDR doesn't block it). It's available in the tis-sysinternals-pstools package. To launch a command prompt as LOCALSYSTEM, you can use the following command:

Code: Select all

psexec.exe -i -s cmd.exe
Then, in this cmd.exe window, launch runwaptservice.bat

Sincerely,

Denis
Denis Cardon - Tranquil IT
Share your experiences on WAPT! Send us your blog and article URLs in the "Your Opinion of the forum, and we'll feature them on the WAPT
Dr. Mathieu
Messages: 20
Registration: Oct 31, 2024 - 10:43

February 6, 2025 - 10:22

Hello Denis,

I was able to reconnect the VM using the runwaptservice.bat command while I downloaded and installed the tis-sysinternals-pstools package.

When I rerun the command in LOCALSYSTEM, I get an error message that I don't understand:

Code: Select all

Le service WAPTService n’est pas lancé.

Vous obtiendrez une aide supplémentaire en entrant NET HELPMSG 3521.

Traceback (most recent call last):
  File "<string>", line 23, in <module>
  File "C:\Program Files (x86)\wapt\waptservice\waptservice_common.py", line 44, in <module>
    import common
  File "C:\Program Files (x86)\wapt\common.py", line 26, in <module>
    import setuphelpers
  File "C:\Program Files (x86)\wapt\setuphelpers.py", line 157, in <module>
    from setuphelpers_windows import get_file_properties,get_domain_fromregistry
  File "C:\Program Files (x86)\wapt\setuphelpers_windows.py", line 42, in <module>
    import win32com.client
  File "C:\Program Files (x86)\wapt\lib\site-packages\win32com\client\__init__.py", line 11, in <module>
    from . import gencache
  File "C:\Program Files (x86)\wapt\lib\site-packages\win32com\client\gencache.py", line 655, in <module>
    __init__()
  File "C:\Program Files (x86)\wapt\lib\site-packages\win32com\client\gencache.py", line 57, in __init__
    _LoadDicts()
  File "C:\Program Files (x86)\wapt\lib\site-packages\win32com\client\gencache.py", line 110, in _LoadDicts
    version = p.load()
_pickle.UnpicklingError: invalid load key, '\x00'.
Exception at 01053067: EPyException:
UnpicklingError: invalid load key, '\x00'.
Thank you for the manipulation
Good day
Mathieu
User avatar
dcardon
WAPT Expert
Messages: 1929
Registration: June 18, 2014 - 09:58
Location: Saint Sébastien sur Loire
Contact :

February 6, 2025 - 10:46

Hi Mathieu,

it seems to be a bug with the win32com Python library. This library creates a Python stub on the fly to call Windows Win32 APIs, the gen_py cache, but it appears to be corrupted in your case.

You can try deleting the C:\Windows\Temp\gen_py\3.9 directory and then restarting the agent from the command line as a SYSTEM account. This will help determine if the problem with creating the gen_py stubs was transient or if it's a different issue.

It works as an admin user because gen_py is created in the user's %temp% directory, which differs depending on whether you're logged in as LOCALSYSTEM or an administrator.

This is a recurring problem. We haven't yet found the sequence that triggers this issue... But we could clear the gen_py cache and perform a regeneration if the load fails.

Best regards,

Denis
Denis Cardon - Tranquil IT
Share your experiences on WAPT! Send us your blog and article URLs in the "Your Opinion of the forum, and we'll feature them on the WAPT
Dr. Mathieu
Messages: 20
Registration: Oct 31, 2024 - 10:43

February 6, 2025 - 1:28 PM

I did delete the folder; in my case, it was C:\Windows\Temp\gen_py\3.8.
Stopping the runwaptservice puts the machine in "Disconnected" mode, but I had to restart the WAPT service for it to work.

I rebooted the VM, and it seems to be working now. Thank you very much for your feedback.

Have a good day,
Mathieu
User avatar
dcardon
WAPT Expert
Messages: 1929
Registration: June 18, 2014 - 09:58
Location: Saint Sébastien sur Loire
Contact :

February 6, 2025 - 4:51 PM

Hi Mathieu,

thanks for the feedback. :-) We'll see how to better handle crashed gen_py. I'm marking the topic as RESOLVED.

Regards,

Denis
Denis Cardon - Tranquil IT
Share your experiences on WAPT! Send us your blog and article URLs in the "Your Opinion of the forum, and we'll feature them on the WAPT
Locked