Page 1 of 1

[RESOLVED] Error with the WAPT agent

Published: April 16, 2026 - 10:03 AM
by AnTho
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

Re: Error with the WAPT agent

Published: April 16, 2026 - 10:56 AM
by htouvet
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]

Re: Error with the WAPT agent

Published: April 16, 2026 - 11:18 AM
by AnTho
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?

Re: Error with the WAPT agent

Published: April 16, 2026 - 3:33 PM
by dcardon
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

Re: [SOLVED] Error with the WAPT agent

Published: April 16, 2026 - 3:35 PM
by htouvet
I've included the fix in the upcoming 2.7 release.
In the meantime, you'll need to copy the file modified via GPO...

Re: [SOLVED] Error with the WAPT agent

Published: April 17, 2026 - 5:24 PM
by AnTho
Thanks for the solution, I'll prepare it.

Have a good weekend