[RESOLVED] Error with the WAPT agent

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
AnTho
Messages: 5
Registration: Nov 21, 2023 - 1:49 p.m.
Location: Langres

April 16, 2026 - 10:03

Hello everyone,

We own:

WAPT version: 2.6.1.1.7765 enterprise edition
Server OS: Dedian 13
Console Machine OS: Windows 11 Pro 25H2 64Bits (build 26200.8246)
Authentication Method: without authentication

Since the last WAPT update, we have noticed disconnections between workstations and the server, and problems with information retrieval (IP, description, etc.)
Despite the agent settling in properly at the workstation (GPO)

However, when we run the command "wapt-get update", we get this:

Code: Select all

C:\Windows\System32>wapt-get update debug

[DEBUG] Logging TSynLog with level=debug to C:\Program Files (x86)\wapt\log\wapt-get.log
Traceback (most recent call last):
  File "<string>", line 228, in <module>
  File "C:\Program Files (x86)\wapt\setuphelpers.py", line 572, in get_language
    lang = locale.windows_locale[ctypes.windll.kernel32.GetUserDefaultUILanguage()]
KeyError: 18416652
KeyError: 18416652
20260416 06093423  ! rotat wapt-get 2.6.1.17765 TSynLog 2.4.13434 {12 17.86 16.15 8.5GB/15.7GB 66581b01}
20260416 06093423  ! info  SetThreadName 1 4190 16784=Main
20260416 06093423  ! EXC   EPyKeyError {Message:"KeyError: 18416652"} [Main] at afd1ed  {12 17.86 16.15 8.5GB/15.7GB 66581b01}
20260416 06093423  ! ERROR KeyError: 18416652
20260416 06093423  ! info  wapt-get terminate
Opening the "setuphelpers.py" file at line 572 leads back to this section:

Code: Select all

def get_language(full_locale=False, separator='_'):
    """Get the os default locale (example: fr, en, pl, etc.)

    >>> get_language()
    'fr'
    >>> get_language(full_locale=True)
    'fr_FR'
    >>> get_language(full_locale=True, separator='-').lower()
    'fr-fr'

    """
    if sys.platform == 'win32':
        lang = locale.windows_locale[ctypes.windll.kernel32.GetUserDefaultUILanguage()]
    else:
        lang = locale.getdefaultlocale()[0]
    if lang==None:
        lang='en_US'
    if full_locale:
        return lang.replace('_', separator)
    return lang.split('_')[0]
By modifying the line "lang = locale.windows_locale[ctypes.windll.kernel32.GetUserDefaultUILanguage()]" with lang='fr_FR', the computer can be reached again on the console.

I don't know if it's a bug or a problem with our environment (the same problem is repeated on many workstations and even on new ones)

Thank you for your feedback and have a good day
Last edited by AnTho on Apr 16, 2026 - 10:59, edited 1 time.
User avatar
htouvet
WAPT Expert
Messages: 436
Registration: March 16, 2015 - 10:48
Contact :

April 16, 2026 - 10:56

Curious.
Probably related to Windows updates. We haven't touched that for years.
I'm going to implement a fallback.

Can you try replacing the function with:

Code: Select all

def get_language(full_locale=False, separator='_'):
    """Get the os default locale (example: fr, en, pl, etc.)

    >>> get_language()
    'fr'
    >>> get_language(full_locale=True)
    'fr_FR'
    >>> get_language(full_locale=True, separator='-').lower()
    'fr-fr'

    """
    if sys.platform == 'win32':
        lang = locale.windows_locale.get(ctypes.windll.kernel32.GetUserDefaultUILanguage(), locale.getdefaultlocale()[0])
    else:
        lang = locale.getdefaultlocale()[0]
    if lang==None:
        lang='en_US'
    if full_locale:
        return lang.replace('_', separator)
    return lang.split('_')[0]
Tranquil IT
AnTho
Messages: 5
Registration: Nov 21, 2023 - 1:49 p.m.
Location: Langres

April 16, 2026 - 11:18

By modifying the line, it works again. The `wapt-get update` executed successfully, and my machine is reachable again on the console.

Is there a way to modify the agent on the server for the GPO?
User avatar
dcardon
WAPT Expert
Messages: 1929
Registration: June 18, 2014 - 09:58
Location: Saint Sébastien sur Loire
Contact :

April 16, 2026 - 3:33 PM

Hi Anthony,

The patch has been integrated into the internal Git repository. The fix will be included in the next release.

If the problem is critical, you can create a Group Policy Object (GPO) to copy the patched file.

Thanks for reporting this; :-)

I'm marking the topic as resolved.

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
User avatar
htouvet
WAPT Expert
Messages: 436
Registration: March 16, 2015 - 10:48
Contact :

April 16, 2026 - 3:35 PM

I've included the fix in the upcoming 2.7 release.
In the meantime, you'll need to copy the file modified via GPO...
Tranquil IT
AnTho
Messages: 5
Registration: Nov 21, 2023 - 1:49 p.m.
Location: Langres

April 17, 2026 - 5:24 PM

Thanks for the solution, I'll prepare it.

Have a good weekend
Locked