[SOLVED] WUA - Error Scanning Updates

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
erems
Messages: 46
Registration: Apr 25, 2023 - 3:52 p.m.

May 25, 2023 - 11:18

Good morning,

One of our Win10 pro workstations consistently fails the WUA scan:
The specified path could not be found: 'C:\\temp\\gen_py'

Indeed, this folder does not exist on this computer (nor on any other for that matter). However, 'C:\Windows\temp\gen_py' does exist.

Could you explain why he's looking for him in that place?

Here is the complete task log:
Ensure wuauserv Auto Update option is disabled
Scanning with windows updates rules:
{
"direct_download":false,
"default_allow":true,
"include_potentially_superseded_updates":true,
"filter":"Type='Software' or Type='Driver'",
"download_scheduling":"7d",
"install_scheduling":"8d",
"install_delay":"7d",
"postboot_delay":"10m"
}
Looking for updates with filter: Type='Software' or Type='Driver'
Connecting to local update searcher using offline wsusscn2 file...
re-enabling wuauserv previous state: 4
[WinError 3] The specified path was not found: 'C:\\temp\\gen_py'
Traceback (most recent call last):
File "C:\Program Files (x86)\wapt\setuphelpers_windows.py", line 4087, in win32com_ensure_dispatch_patch
return win32com.client.gencache.EnsureDispatch(prog_id)
File "C:\Program Files (x86)\wapt\lib\site-packages\win32com\client\gencache.py", line 524, in EnsureDispatch
disp = win32com.client.Dispatch(prog_id)
File "C:\Program Files (x86)\wapt\lib\site-packages\win32com\client\__init__.py", line 96, in Dispatch
return __WrapDispatch(dispatch, userName, resultCLSID, typeinfo, clsctx=clsctx)
File "C:\Program Files (x86)\wapt\lib\site-packages\win32com\client\__init__.py", line 37, in __WrapDispatch
class = gencache.GetClassForCLSID(resultCLSID)
File "C:\Program Files (x86)\wapt\lib\site-packages\win32com\client\gencache.py", line 180, in GetClassForCLSID
mod = GetModuleForCLSID(clsid)
File "C:\Program Files (x86)\wapt\lib\site-packages\win32com\client\gencache.py", line 223, in GetModuleForCLSID
mod = GetModuleForTypelib(typelibCLSID, lcid, major, minor)
File "C:\Program Files (x86)\wapt\lib\site-packages\win32com\client\gencache.py", line 263, in GetModuleForTypelib
AddModuleToCache(typelibCLSID, lcid, major, minor)
File "C:\Program Files (x86)\wapt\lib\site-packages\win32com\client\gencache.py", line 559, in AddModuleToCache
SetTypelibForAllClsids(mod.CLSIDToClassMap)
AttributeError: module 'win32com.gen_py.B596CC9F-56E5-419E-A622-E01BB457431Ex0x2x0' has no attribute 'CLSIDToClassMap'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Program Files (x86)\wapt\waptservice\service.py", line 1907, in run
self.running_task.run()
File "C:\Program Files (x86)\wapt\waptservice\waptservice_common.py", line 710, in run
self._run()
File "C:\Program Files (x86)\wapt\waptservice\enterprise.py", line 216, in _run
self.result = wua.scan_updates_status(self.force)
File "C:\Program Files (x86)\wapt\waptwua\client.py", line 914, in scan_updates_status
for update in self.updates():
File "C:\Program Files (x86)\wapt\waptwua\client.py", line 822, in updates
search_job = self.update_searcher().BeginSearch(self.params.filter, scb_interface, None)
File "C:\Program Files (x86)\wapt\waptwua\client.py", line 784, in update_searcher
self._update_service = self.update_service_manager().AddScanPackageService("Offline Sync Service", self.wsusscn2)
File "C:\Program Files (x86)\wapt\waptwua\client.py", line 699, in update_service_manager
self._update_service_manager = CastTo(self.update_session().CreateUpdateServiceManager(), 'IUpdateServiceManager2')
File "C:\Program Files (x86)\wapt\waptwua\client.py", line 688, in update_session
self._update_session = CastTo(win32com_ensure_dispatch_patch("Microsoft.Update.Session"), 'IUpdateSession3')
File "C:\Program Files (x86)\wapt\setuphelpers_windows.py", line 4094, in win32com_ensure_dispatch_patch
shutil.rmtree(os.path.join(tempfile.gettempdir(), 'gen_py'))
File "shutil.py", line 740, in rmtree
File "shutil.py", line 599, in _rmtree_unsafe
File "shutil.py", line 596, in _rmtree_unsafe
FileNotFoundError: [WinError 3] The specified path could not be found: 'C:\\temp\\gen_py'

2: The specified path could not be found
Traceback (most recent call last):
File "C:\Program Files (x86)\wapt\setuphelpers_windows.py", line 4087, in win32com_ensure_dispatch_patch
return win32com.client.gencache.EnsureDispatch(prog_id)
File "C:\Program Files (x86)\wapt\lib\site-packages\win32com\client\gencache.py", line 524, in EnsureDispatch
disp = win32com.client.Dispatch(prog_id)
File "C:\Program Files (x86)\wapt\lib\site-packages\win32com\client\__init__.py", line 96, in Dispatch
return __WrapDispatch(dispatch, userName, resultCLSID, typeinfo, clsctx=clsctx)
File "C:\Program Files (x86)\wapt\lib\site-packages\win32com\client\__init__.py", line 37, in __WrapDispatch
klass = gencache.GetClassForCLSID(resultCLSID)
File "C:\Program Files (x86)\wapt\lib\site-packages\win32com\client\gencache.py", line 180, in GetClassForCLSID
mod = GetModuleForCLSID(clsid)
File "C:\Program Files (x86)\wapt\lib\site-packages\win32com\client\gencache.py", line 223, in GetModuleForCLSID
mod = GetModuleForTypelib(typelibCLSID, lcid, major, minor)
File "C:\Program Files (x86)\wapt\lib\site-packages\win32com\client\gencache.py", line 263, in GetModuleForTypelib
AddModuleToCache(typelibCLSID, lcid, major, minor)
File "C:\Program Files (x86)\wapt\lib\site-packages\win32com\client\gencache.py", line 559, in AddModuleToCache
SetTypelibForAllClsids(mod.CLSIDToClassMap)
AttributeError: module 'win32com.gen_py.B596CC9F-56E5-419E-A622-E01BB457431Ex0x2x0' has no attribute 'CLSIDToClassMap'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Program Files (x86)\wapt\waptservice\service.py", line 1907, in run
self.running_task.run()
File "C:\Program Files (x86)\wapt\waptservice\waptservice_common.py", line 710, in run
self._run()
File "C:\Program Files (x86)\wapt\waptservice\enterprise.py", line 216, in _run
self.result = wua.scan_updates_status(self.force)
File "C:\Program Files (x86)\wapt\waptwua\client.py", line 914, in scan_updates_status
for update in self.updates():
File "C:\Program Files (x86)\wapt\waptwua\client.py", line 822, in updates
search_job = self.update_searcher().BeginSearch(self.params.filter, scb_interface, None)
File "C:\Program Files (x86)\wapt\waptwua\client.py", line 784, in update_searcher
self._update_service = self.update_service_manager().AddScanPackageService("Offline Sync Service", self.wsusscn2)
File "C:\Program Files (x86)\wapt\waptwua\client.py", line 699, in update_service_manager
self._update_service_manager = CastTo(self.update_session().CreateUpdateServiceManager(), 'IUpdateServiceManager2')
File "C:\Program Files (x86)\wapt\waptwua\client.py", line 688, in update_session
self._update_session = CastTo(win32com_ensure_dispatch_patch("Microsoft.Update.Session"), 'IUpdateSession3')
File "C:\Program Files (x86)\wapt\setuphelpers_windows.py", line 4094, in win32com_ensure_dispatch_patch
shutil.rmtree(os.path.join(tempfile.gettempdir(), 'gen_py'))
File "shutil.py", line 740, in rmtree
File "shutil.py", line 599, in _rmtree_unsafe
File "shutil.py", line 596, in _rmtree_unsafe
FileNotFoundError: [WinError 3] The specified path could not be found: 'C:\\temp\\gen_py'
Thank you for your help.
Best regards.
Last edited by erems on June 2, 2023 - 10:01, edited 1 time.
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

May 25, 2023 - 1:49 PM

It's strange that it mixes between:

Code: Select all

C:\temp\
And

Code: Select all

C:\Windows\temp\
C:\temp\ does not normally exist in a standard system.

In the environment variables, you should look for TMP:

Code: Select all

echo %temp%
echo %tmp%
erems
Messages: 46
Registration: Apr 25, 2023 - 3:52 p.m.

June 1, 2023 - 09:53

Hello,
sorry for the delayed response. It seems that an environment variable, %TMPDIR%, was interfering with WAPT.
After deleting this variable, the WUA scan is working again on the machine.
Thank you for your help.
Best regards.
Locked