Failure to run storage plugins - OSError: [WinError -2147417850] Cannot change thread mode after it is set

Bug #1840659 reported by Adrian Vladu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloudbase-init
Fix Released
Undecided
Adrian Vladu

Bug Description

When the pythoncom module gets initialized, the thread mode is already being set and cannot be changed afterwards.

Error:
OSError: [WinError -2147417850] Cannot change thread mode after it is set

Full logs:

2019-08-19T13:24:43.9577749Z 2019-08-19 13:24:36.452 6408 INFO cloudbaseinit.init [-] Executing plugin 'SANPolicyPlugin'
2019-08-19T13:24:43.9579093Z 2019-08-19 13:24:36.452 6408 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.osutils.windows.WindowsUtils' load_class c:\hostedtoolcache\windows\python\3.6.8\x64\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2019-08-19T13:24:43.9580003Z 2019-08-19 13:24:36.452 6408 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.utils.windows.storage.vds_storage_manager.VDSStorageManager' load_class c:\hostedtoolcache\windows\python\3.6.8\x64\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2019-08-19T13:24:43.9581104Z 2019-08-19 13:24:36.452 6408 DEBUG comtypes [-] CoInitializeEx(None, 0) CoInitializeEx c:\hostedtoolcache\windows\python\3.6.8\x64\lib\site-packages\comtypes\__init__.py:155
2019-08-19T13:24:43.9583074Z 2019-08-19 13:24:36.452 6408 ERROR cloudbaseinit.init [-] plugin 'SANPolicyPlugin' failed with error '[WinError -2147417850] Cannot change thread mode after it is set': OSError: [WinError -2147417850] Cannot change thread mode after it is set
2019-08-19T13:24:43.9584220Z 2019-08-19 13:24:36.452 6408 ERROR cloudbaseinit.init [-] [WinError -2147417850] Cannot change thread mode after it is set: OSError: [WinError -2147417850] Cannot change thread mode after it is set
2019-08-19T13:24:43.9585326Z 2019-08-19 13:24:36.452 6408 ERROR cloudbaseinit.init Traceback (most recent call last):
2019-08-19T13:24:43.9586541Z 2019-08-19 13:24:36.452 6408 ERROR cloudbaseinit.init File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\site-packages\cloudbaseinit\init.py", line 67, in _exec_plugin
2019-08-19T13:24:43.9587476Z 2019-08-19 13:24:36.452 6408 ERROR cloudbaseinit.init shared_data)
2019-08-19T13:24:43.9589086Z 2019-08-19 13:24:36.452 6408 ERROR cloudbaseinit.init File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\site-packages\cloudbaseinit\plugins\windows\sanpolicy.py", line 38, in execute
2019-08-19T13:24:43.9590076Z 2019-08-19 13:24:36.452 6408 ERROR cloudbaseinit.init storage_manager = storage_factory.get_storage_manager()
2019-08-19T13:24:43.9591400Z 2019-08-19 13:24:36.452 6408 ERROR cloudbaseinit.init File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\site-packages\cloudbaseinit\utils\windows\storage\factory.py", line 37, in get_storage_manager
2019-08-19T13:24:43.9592423Z 2019-08-19 13:24:36.452 6408 ERROR cloudbaseinit.init return cl.load_class(class_paths["VDS"])()
2019-08-19T13:24:43.9593587Z 2019-08-19 13:24:36.452 6408 ERROR cloudbaseinit.init File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\site-packages\cloudbaseinit\utils\classloader.py", line 29, in load_class
2019-08-19T13:24:43.9594492Z 2019-08-19 13:24:36.452 6408 ERROR cloudbaseinit.init module = __import__(parts[0], fromlist=parts[1])
2019-08-19T13:24:43.9596054Z 2019-08-19 13:24:36.452 6408 ERROR cloudbaseinit.init File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\site-packages\cloudbaseinit\utils\windows\storage\vds_storage_manager.py", line 21, in <module>
2019-08-19T13:24:43.9596356Z 2019-08-19 13:24:36.452 6408 ERROR cloudbaseinit.init from cloudbaseinit.utils.windows import vds
2019-08-19T13:24:43.9596912Z 2019-08-19 13:24:36.452 6408 ERROR cloudbaseinit.init File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\site-packages\cloudbaseinit\utils\windows\vds.py", line 15, in <module>
2019-08-19T13:24:43.9598443Z 2019-08-19 13:24:36.452 6408 ERROR cloudbaseinit.init import comtypes
2019-08-19T13:24:43.9599533Z 2019-08-19 13:24:36.452 6408 ERROR cloudbaseinit.init File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\site-packages\comtypes\__init__.py", line 165, in <module>
2019-08-19T13:24:43.9600784Z 2019-08-19 13:24:36.452 6408 ERROR cloudbaseinit.init CoInitializeEx()
2019-08-19T13:24:43.9602109Z 2019-08-19 13:24:36.452 6408 ERROR cloudbaseinit.init File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\site-packages\comtypes\__init__.py", line 156, in CoInitializeEx
2019-08-19T13:24:43.9603431Z 2019-08-19 13:24:36.452 6408 ERROR cloudbaseinit.init _ole32.CoInitializeEx(None, flags)
2019-08-19T13:24:43.9603839Z 2019-08-19 13:24:36.452 6408 ERROR cloudbaseinit.init File "_ctypes/callproc.c", line 940, in GetResult
2019-08-19T13:24:43.9604782Z 2019-08-19 13:24:36.452 6408 ERROR cloudbaseinit.init OSError: [WinError -2147417850] Cannot change thread mode after it is set
2019-08-19T13:24:43.9605548Z 2019-08-19 13:24:36.452 6408 ERROR cloudbaseinit.init [00

Revision history for this message
Adrian Vladu (avladu) wrote :

Affected plugins: ExtendVolumesPlugin and SANPolicyPlugin

Changed in cloudbase-init:
assignee: nobody → Adrian Vladu (avladu)
status: New → Confirmed
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cloudbase-init (master)

Fix proposed to branch: master
Review: https://review.opendev.org/677205

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cloudbase-init (master)

Reviewed: https://review.opendev.org/677205
Committed: https://git.openstack.org/cgit/x/cloudbase-init/commit/?id=86fe66a2fd7e33a8150821c51a5634f78a1b1ab4
Submitter: Zuul
Branch: master

commit 86fe66a2fd7e33a8150821c51a5634f78a1b1ab4
Author: Adrian Vladu <email address hidden>
Date: Mon Aug 19 16:31:45 2019 +0300

    Fix pythoncom thread model error

    The pythoncom thread model is set when pythoncom is imported
    and cannot be changed afterwards.

    The removed code was supposed to fix the Windows Nano server,
    which is currently unsupported by cloudbase-init and thus,
    no longer necessary.

    Error log:
    [WinError -2147417850] Cannot change thread mode after it is set

    Closes-Bug: #1840659

    Change-Id: If278b77a057553c61cada860861e349b2b1fac69

Changed in cloudbase-init:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.