Salt: [BUG] wua.uptodate broken in Windows 10 2004

Created on 23 Jun 2020  路  2Comments  路  Source: saltstack/salt

Description
wua.uptodate always fails after installing Windows 10 2004 update.
No issues on 1909 build.

          ID: update_system
    Function: wua.uptodate
      Result: False
     Comment: An exception occurred in this state: Traceback (most recent call last):
                File "c:\salt\bin\lib\site-packages\salt-3001-py3.7.egg\salt\state.py", line 2154, in call
                  *cdata["args"], **cdata["kwargs"]
                File "c:\salt\bin\lib\site-packages\salt-3001-py3.7.egg\salt\loader.py", line 2087, in wrapper
                  return f(*args, **kwargs)
                File "c:\salt\bin\lib\site-packages\salt-3001-py3.7.egg\salt\states\win_wua.py", line 444, in uptodate
                  severities=severities,
                File "c:\salt\bin\lib\site-packages\salt-3001-py3.7.egg\salt\utils\win_update.py", line 528, in available
                  salt.utils.data.is_true(update.InstallationBehavior.RebootBehavior)
                File "c:\salt\bin\lib\site-packages\win32com\client\dynamic.py", line 527, in __getattr__
                  raise AttributeError("%s.%s" % (self._username_, attr))
              AttributeError: <unknown>.RebootBehavior
     Started: 17:22:47.786660
    Duration: 54843.747 ms
     Changes:

Setup
First noted on salt master and minion 3000.3, reproduced in 3001.

```update_system:
wua.uptodate:
- skip_reboot: False
- drivers: True


**Steps to Reproduce the behavior**
Run state.apply with listed above code in sls.

**Expected behavior**
Latest updates installed, if any available:
```----------
          ID: update_system
    Function: wua.uptodate
      Result: True
     Comment: Updates installed successfully
     Started: 17:56:20.113411
    Duration: 82240.744 ms
     Changes:                 ----------
              installed:
                  ----------
                  60de8631-05d4-4adb-b881-17e58aca37e0:
                      ----------
                      Title:
                          袨薪芯胁谢械薪薪褟 屑械褏邪薪褨蟹屑褍 胁懈褟胁谢械薪薪褟 蟹邪谐褉芯蟹 写谢褟...
                      NeedsReboot:
                          False
                      KBs:
                          - KB2267602

Versions Report
For both systems minion installed from same installer:

Salt Version:
           Salt: 3001

Dependency Versions:
           cffi: 1.12.2
       cherrypy: 17.4.1
       dateutil: 2.8.0
      docker-py: Not Installed
          gitdb: 2.0.5
      gitpython: Not Installed
         Jinja2: 2.10.1
        libgit2: Not Installed
       M2Crypto: Not Installed
           Mako: 1.0.7
   msgpack-pure: Not Installed
 msgpack-python: 0.5.6
   mysql-python: Not Installed
      pycparser: 2.19
       pycrypto: Not Installed
   pycryptodome: 3.9.7
         pygit2: Not Installed
         Python: 3.7.4 (tags/v3.7.4:e09359112e, Jul  8 2019, 19:29:22) [MSC v.1916 32 bit (Intel)]
   python-gnupg: 0.4.4
         PyYAML: 5.1.2
          PyZMQ: 18.0.1
          smmap: 2.0.5
        timelib: 0.2.4
        Tornado: 4.5.3
            ZMQ: 4.3.1

System Versions:
           dist:
         locale: cp1251
        machine: x86
        release: 10
         system: Windows
        version: 10 10.0.19041 SP0

Server versions:

Salt Version:
           Salt: 3001

Dependency Versions:
           cffi: Not Installed
       cherrypy: unknown
       dateutil: 2.6.1
      docker-py: Not Installed
          gitdb: 2.0.3
      gitpython: 2.1.8
         Jinja2: 2.11.2
        libgit2: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.5.6
   mysql-python: 1.3.10
      pycparser: Not Installed
       pycrypto: 2.6.1
   pycryptodome: 3.4.7
         pygit2: Not Installed
         Python: 3.6.9 (default, Apr 18 2020, 01:56:04)
   python-gnupg: 0.4.1
         PyYAML: 3.12
          PyZMQ: 17.1.2
          smmap: 2.0.3
        timelib: Not Installed
        Tornado: 4.5.3
            ZMQ: 4.2.5

System Versions:
           dist: ubuntu 18.04 Bionic Beaver
         locale: UTF-8
        machine: x86_64
        release: 4.15.0-106-generic
         system: Linux
        version: Ubuntu 18.04 Bionic Beaver
Bug Magnesium Windows team-windows

Most helpful comment

I also get this error on a fresh install of Windows 10 - Build 2004. This actually occurs at the win_wua module level as well when using the list function.

root@ubuntu:/home/tyler# salt 'salt10' win_wua.list
salt10:
    The minion function caused an exception: Traceback (most recent call last):
      File "c:\salt\bin\lib\site-packages\salt-3001-py3.7.egg\salt\minion.py", line 1870, in _thread_return
        opts, data, func, args, kwargs
      File "c:\salt\bin\lib\site-packages\salt-3001-py3.7.egg\salt\executors\direct_call.py", line 12, in execute
        return func(*args, **kwargs)
      File "c:\salt\bin\lib\site-packages\salt-3001-py3.7.egg\salt\modules\win_wua.py", line 509, in list
        severities=severities,
      File "c:\salt\bin\lib\site-packages\salt-3001-py3.7.egg\salt\utils\win_update.py", line 528, in available
        salt.utils.data.is_true(update.InstallationBehavior.RebootBehavior)
      File "c:\salt\bin\lib\site-packages\win32com\client\dynamic.py", line 527, in __getattr__
        raise AttributeError("%s.%s" % (self._username_, attr))
    AttributeError: <unknown>.RebootBehavior

After fiddling with Microsoft.Update.Session COMObject search results via PowerShell I noticed I am unable to pull the InstallationBehavior information from the returned updates of WUA Searcher (on 2004, works fine on 1809). I did some googling and noticed some related discussions to this topic. Unfortunately this looks to be a Windows 10 - 2004 bug... not a Salt one for better or for worse.

https://social.technet.microsoft.com/Forums/en-US/f9753821-74d3-40e1-8958-3716143d600e/ztiwindowsupdate-skipping-all-updates-on-windows-10-build-2004?forum=mdt

https://www.reddit.com/r/MDT/comments/gwnk6l/ztiwindowsupdate_skipping_all_updates_on_windows/

All 2 comments

@cmcmarrow could you look into it?

I also get this error on a fresh install of Windows 10 - Build 2004. This actually occurs at the win_wua module level as well when using the list function.

root@ubuntu:/home/tyler# salt 'salt10' win_wua.list
salt10:
    The minion function caused an exception: Traceback (most recent call last):
      File "c:\salt\bin\lib\site-packages\salt-3001-py3.7.egg\salt\minion.py", line 1870, in _thread_return
        opts, data, func, args, kwargs
      File "c:\salt\bin\lib\site-packages\salt-3001-py3.7.egg\salt\executors\direct_call.py", line 12, in execute
        return func(*args, **kwargs)
      File "c:\salt\bin\lib\site-packages\salt-3001-py3.7.egg\salt\modules\win_wua.py", line 509, in list
        severities=severities,
      File "c:\salt\bin\lib\site-packages\salt-3001-py3.7.egg\salt\utils\win_update.py", line 528, in available
        salt.utils.data.is_true(update.InstallationBehavior.RebootBehavior)
      File "c:\salt\bin\lib\site-packages\win32com\client\dynamic.py", line 527, in __getattr__
        raise AttributeError("%s.%s" % (self._username_, attr))
    AttributeError: <unknown>.RebootBehavior

After fiddling with Microsoft.Update.Session COMObject search results via PowerShell I noticed I am unable to pull the InstallationBehavior information from the returned updates of WUA Searcher (on 2004, works fine on 1809). I did some googling and noticed some related discussions to this topic. Unfortunately this looks to be a Windows 10 - 2004 bug... not a Salt one for better or for worse.

https://social.technet.microsoft.com/Forums/en-US/f9753821-74d3-40e1-8958-3716143d600e/ztiwindowsupdate-skipping-all-updates-on-windows-10-build-2004?forum=mdt

https://www.reddit.com/r/MDT/comments/gwnk6l/ztiwindowsupdate_skipping_all_updates_on_windows/

Was this page helpful?
0 / 5 - 0 ratings