Page 1 of 1

WUA ''ValueError: time data '' does not match format '%m/%d/%Y''

Published: March 27, 2024 - 08:58
by tux
Good morning

On some Windows 10 and Windows Server machines, I am getting errors with WUA.
Last error status: ValueError: time data '' does not match format '%m/%d/%Y'

Is this problem fixed in the latest version of WAPT?

Logs for the Install Windows Update task:

Code: Select all

Ensure wuauserv Auto Update option is disabled
Scanning with windows updates rules:
{
 "direct_download":false,
 "default_allow":false,
 "include_potentially_superseded_updates":false,
 "filter":"Type='Software' or Type='Driver'",
 "download_scheduling":"12h",
 "install_scheduling":"6h",
 "install_delay":"",
 "postboot_delay":"10m"
}
   Connecting to local update searcher using offline wsusscn2 file...
   Offline Update searcher ready...
Bypassing scan, no change since last successful scan
Looking for updates with filter: Type='Software' or Type='Driver'
Waiting for WUA search to complete
WUA Search completed !
Done searching
Updates scan done.
re-enabling wuauserv previous state: 0
time data '' does not match format '%m/%d/%Y'
Traceback (most recent call last):
  File "C:\Program Files (x86)\wapt\waptwua\client.py", line 931, in update_local_status_as_dict
    install_date = str(datetime.datetime.strptime(kbw['InstalledOn'], '%d/%m/%Y'))
  File "_strptime.py", line 568, in _strptime_datetime
  File "_strptime.py", line 349, in _strptime
ValueError: time data '' does not match format '%d/%m/%Y'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files (x86)\wapt\waptservice\service.py", line 1934, in run
    self.running_task.run()
  File "C:\Program Files (x86)\wapt\waptservice\waptservice_common.py", line 737, in run
    self._run()
  File "C:\Program Files (x86)\wapt\waptservice\enterprise.py", line 288, in _run
    self.result = wua.install_updates(self.force, uuids=self.uuids)
  File "C:\Program Files (x86)\wapt\waptwua\client.py", line 1640, in install_updates
    self.scan_updates_status()
  File "C:\Program Files (x86)\wapt\waptwua\client.py", line 1260, in scan_updates_status
    dict_update_status[self.update_local_status_as_dict(u, _update_history,wmi_installed_windows_updates_result=wmi_installed_windows_updates_result)['update_id']] = self.update_local_status_as_dict(u, _update_history,wmi_installed_windows_updates_result=wmi_installed_windows_updates_result)
  File "C:\Program Files (x86)\wapt\waptwua\client.py", line 933, in update_local_status_as_dict
    install_date = str(datetime.datetime.strptime(kbw['InstalledOn'], '%m/%d/%Y'))
  File "_strptime.py", line 568, in _strptime_datetime
  File "_strptime.py", line 349, in _strptime
ValueError: time data '' does not match format '%m/%d/%Y'

ValueError: time data '' does not match format '%m/%d/%Y'
Traceback (most recent call last):
  File "C:\Program Files (x86)\wapt\waptwua\client.py", line 931, in update_local_status_as_dict
    install_date = str(datetime.datetime.strptime(kbw['InstalledOn'], '%d/%m/%Y'))
  File "_strptime.py", line 568, in _strptime_datetime
  File "_strptime.py", line 349, in _strptime
ValueError: time data '' does not match format '%d/%m/%Y'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files (x86)\wapt\waptservice\service.py", line 1934, in run
    self.running_task.run()
  File "C:\Program Files (x86)\wapt\waptservice\waptservice_common.py", line 737, in run
    self._run()
  File "C:\Program Files (x86)\wapt\waptservice\enterprise.py", line 288, in _run
    self.result = wua.install_updates(self.force, uuids=self.uuids)
  File "C:\Program Files (x86)\wapt\waptwua\client.py", line 1640, in install_updates
    self.scan_updates_status()
  File "C:\Program Files (x86)\wapt\waptwua\client.py", line 1260, in scan_updates_status
    dict_update_status[self.update_local_status_as_dict(u, _update_history,wmi_installed_windows_updates_result=wmi_installed_windows_updates_result)['update_id']] = self.update_local_status_as_dict(u, _update_history,wmi_installed_windows_updates_result=wmi_installed_windows_updates_result)
  File "C:\Program Files (x86)\wapt\waptwua\client.py", line 933, in update_local_status_as_dict
    install_date = str(datetime.datetime.strptime(kbw['InstalledOn'], '%m/%d/%Y'))
  File "_strptime.py", line 568, in _strptime_datetime
  File "_strptime.py", line 349, in _strptime
ValueError: time data '' does not match format '%m/%d/%Y'

Re: WUA ''ValueError: time data '' does not match format '%m/%d/%Y''

Published: March 28, 2024 - 7:25 PM
by dcardon
Hi Sébastien,

oops, I think there's a bug here. It seems that neither Windows Update nor WMI has any information about the installation date. This can happen if you deleted the C:\Windows\SoftwareDistribution\ folder and there's another bug at the same time, like the one we just encountered.

We'll look into it tomorrow at the office.

Best regards,

Denis

Re: WUA ''ValueError: time data '' does not match format '%m/%d/%Y''

Published: April 12, 2024 - 11:40 AM
by tux
Hello,

just so you know, the c:\windows\softwaredistribution\ folder is indeed present on the affected machines.
Have you identified a workaround for this problem?