Uploaded image for project: 'Leatherman'
  1. Leatherman
  2. LTH-98

Fix WMI setup on Microsoft Nano Server

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • None
    • LTH 0.7.2
    • 1

    Description

      Ruby and Puppet currently call CoInitialize and OleInitialize, which setup single-threaded apartments (STA, or COINIT_APARTMENTTHREADED) on Windows. This is incompatible with COINIT_MULTITHREADED (MTA), which is the only supported option on Nano Server.

      On Nano Server, CoInitializeEx returns an error if you try to initialize with STA. CoInitialize and OleInitialize appear to do something special to continue working there, but https://bugs.ruby-lang.org/issues/12371 may result in changing to explicitly using MTA in Ruby.

      Update Leatherman's WMI setup to fallback to MTA when STA fails. If COM was previously initialized, we still proceed as if CoInitializeEx succeeded; we support this two-tier attempt so that we'll use whichever Ruby and Puppet will end up using (as Facter may be initialized first). This will likely need to change again if Ruby/Puppet change how they initialize COM.

      Attachments

        Issue Links

          Activity

            People

              ethan Ethan Brown
              michael.smith Michael Smith
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support