Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2016.11.x windows minion fails to start on Windows 2003 #39940

Closed
lubyou opened this issue Mar 10, 2017 · 4 comments
Closed

2016.11.x windows minion fails to start on Windows 2003 #39940

lubyou opened this issue Mar 10, 2017 · 4 comments
Labels
Pending-Discussion The issue or pull request needs more discussion before it can be closed or merged
Milestone

Comments

@lubyou
Copy link
Contributor

lubyou commented Mar 10, 2017

Description of Issue/Question

Hi,

The windows minion of the 2016.11 branch fails to start on windows 2003.

I tested both Salt-Minion-2016.11.0-x86-Setup.exe and Salt-Minion-2016.11.3-x86-Setup.exe on an English Windows 2003.

pywintypes imports fine:

C:\salt\bin>dir
 Volume in drive C has no label.
 Volume Serial Number is 386C-5561

 Directory of C:\salt\bin

10/03/2017  11:28    <DIR>          .
10/03/2017  11:28    <DIR>          ..
10/03/2017  11:28    <DIR>          DLLs
10/03/2017  11:28    <DIR>          include
10/03/2017  11:31    <DIR>          Lib
22/11/2016  19:49         1 362 432 libeay32.dll
10/03/2017  11:28    <DIR>          libs
22/11/2016  19:49           488 448 libsodium.dll
27/06/2016  16:22            38 591 LICENSE.txt
22/11/2016  19:49           970 912 msvcr120.dll
22/11/2016  19:49             6 404 OpenSSL_License.txt
27/06/2016  16:20            27 136 python.exe
27/06/2016  16:19         2 631 168 python27.dll
27/06/2016  16:20            27 648 pythonw.exe
10/03/2017  11:28    <DIR>          Scripts
22/11/2016  19:49           357 888 ssleay32.dll
27/06/2016  16:20           111 616 w9xpopen.exe
              10 File(s)      6 022 243 bytes
               7 Dir(s)  33 686 130 688 bytes free

C:\salt\bin>python
Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:19:22) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pywintypes
>>> pywintypes.error
<class 'pywintypes.error'>
>>>

The 2016.3 minion works fine.

Steps to Reproduce Issue

C:\salt>salt-minion.bat -ltrace
[DEBUG   ] Reading configuration from c:\salt\conf\minion
[DEBUG   ] Including configuration from 'c:\salt\conf\minion.d\_schedule.conf'
[DEBUG   ] Reading configuration from c:\salt\conf\minion.d\_schedule.conf
[TRACE   ] The required configuration section, 'fluent_handler', was not found the in the configuration. Not loading the fluent logging hand
lers module.
[TRACE   ] None of the required configuration sections, 'logstash_udp_handler' and 'logstash_zmq_handler', were found in the configuration.
Not loading the Logstash logging handlers module.
[DEBUG   ] Configuration file path: c:\salt\conf\minion
[ERROR   ] An un-handled exception was caught by salt's global exception handler:
NameError: global name 'pywintypes' is not defined
Traceback (most recent call last):
  File "C:\salt\bin\Scripts\salt-minion", line 26, in <module>
    salt_minion()
  File "C:\salt\bin\lib\site-packages\salt\scripts.py", line 159, in salt_minion
    minion.start()
  File "C:\salt\bin\lib\site-packages\salt\cli\daemons.py", line 340, in start
    super(Minion, self).start()
  File "C:\salt\bin\lib\site-packages\salt\utils\parsers.py", line 947, in start
    self.prepare()
  File "C:\salt\bin\lib\site-packages\salt\cli\daemons.py", line 282, in prepare
    pki_dir=self.config['pki_dir'],
  File "C:\salt\bin\lib\site-packages\salt\utils\verify.py", line 202, in verify_env
    dirs, get_current_user(), permissive, pki_dir, skip_extra)
  File "C:\salt\bin\lib\site-packages\salt\utils\win_functions.py", line 150, in get_current_user
    except pywintypes.error as exc:
NameError: global name 'pywintypes' is not defined
Traceback (most recent call last):
  File "C:\salt\bin\Scripts\salt-minion", line 26, in <module>
    salt_minion()
  File "C:\salt\bin\lib\site-packages\salt\scripts.py", line 159, in salt_minion
    minion.start()
  File "C:\salt\bin\lib\site-packages\salt\cli\daemons.py", line 340, in start
    super(Minion, self).start()
  File "C:\salt\bin\lib\site-packages\salt\utils\parsers.py", line 947, in start
    self.prepare()
  File "C:\salt\bin\lib\site-packages\salt\cli\daemons.py", line 282, in prepare
    pki_dir=self.config['pki_dir'],
  File "C:\salt\bin\lib\site-packages\salt\utils\verify.py", line 202, in verify_env
    dirs, get_current_user(), permissive, pki_dir, skip_extra)
  File "C:\salt\bin\lib\site-packages\salt\utils\win_functions.py", line 150, in get_current_user
    except pywintypes.error as exc:
NameError: global name 'pywintypes' is not defined

Versions Report

Salt Version:
           Salt: 2016.11.0

Dependency Versions:
           cffi: 1.7.0
       cherrypy: 7.1.0
       dateutil: 2.5.3
          gitdb: 0.6.4
      gitpython: 2.0.8
          ioflo: 1.5.5
         Jinja2: 2.8
        libgit2: Not Installed
        libnacl: 1.4.5
       M2Crypto: Not Installed
           Mako: 1.0.4
   msgpack-pure: Not Installed
 msgpack-python: 0.4.8
   mysql-python: Not Installed
      pycparser: 2.14
       pycrypto: 2.6.1
         pygit2: Not Installed
         Python: 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:19:22) [MSC v.1500 32 bit (Intel)]
   python-gnupg: 0.3.8
         PyYAML: 3.11
          PyZMQ: 16.0.1
           RAET: Not Installed
          smmap: 0.9.0
        timelib: 0.2.4
        Tornado: 4.4.1
            ZMQ: 4.1.6

System Versions:
           dist:
        machine: x86
        release: UNKServer
         system: Windows
        version: UNKServer 5.2.3790 SP2 Uniprocessor Free
@lubyou
Copy link
Contributor Author

lubyou commented Mar 10, 2017

Hi,

It seems that the real import failure (psutil) is masked.
The psutil import fails, and as such all libraries following psutil are not going to be imported.

https://github.com/saltstack/salt/blob/2016.11/salt/utils/win_functions.py#L10

# Import 3rd Party Libs
try:
    import ntsecuritycon
    import psutil
    import pywintypes
    import win32api
    import win32net
    import win32security
    HAS_WIN32 = True
except ImportError:
    HAS_WIN32 = False

After removing the try/except, the trace looks like this now:

C:\salt>salt-minion.bat -ltrace
[DEBUG   ] Reading configuration from c:\salt\conf\minion
[DEBUG   ] Including configuration from 'c:\salt\conf\minion.d\_schedule.conf'
[DEBUG   ] Reading configuration from c:\salt\conf\minion.d\_schedule.conf
[TRACE   ] The required configuration section, 'fluent_handler', was not found the in the configuration. Not loading the fluent logging hand
lers module.
[TRACE   ] None of the required configuration sections, 'logstash_udp_handler' and 'logstash_zmq_handler', were found in the configuration.
Not loading the Logstash logging handlers module.
[DEBUG   ] Configuration file path: c:\salt\conf\minion
[ERROR   ] An un-handled exception was caught by salt's global exception handler:
ImportError: cannot import name _common
Traceback (most recent call last):
  File "C:\salt\bin\Scripts\salt-minion", line 26, in <module>
    salt_minion()
  File "C:\salt\bin\lib\site-packages\salt\scripts.py", line 159, in salt_minion
    minion.start()
  File "C:\salt\bin\lib\site-packages\salt\cli\daemons.py", line 340, in start
    super(Minion, self).start()
  File "C:\salt\bin\lib\site-packages\salt\utils\parsers.py", line 996, in start
    self.prepare()
  File "C:\salt\bin\lib\site-packages\salt\cli\daemons.py", line 282, in prepare
    pki_dir=self.config['pki_dir'],
  File "C:\salt\bin\lib\site-packages\salt\utils\verify.py", line 200, in verify_env
    from salt.utils.win_functions import get_current_user
  File "C:\salt\bin\lib\site-packages\salt\utils\win_functions.py", line 15, in <module>
    import psutil
  File "C:\salt\bin\lib\site-packages\psutil\__init__.py", line 28, in <module>
    from . import _common
ImportError: cannot import name _common
Traceback (most recent call last):
  File "C:\salt\bin\Scripts\salt-minion", line 26, in <module>
    salt_minion()
  File "C:\salt\bin\lib\site-packages\salt\scripts.py", line 159, in salt_minion
    minion.start()
  File "C:\salt\bin\lib\site-packages\salt\cli\daemons.py", line 340, in start
    super(Minion, self).start()
  File "C:\salt\bin\lib\site-packages\salt\utils\parsers.py", line 996, in start
    self.prepare()
  File "C:\salt\bin\lib\site-packages\salt\cli\daemons.py", line 282, in prepare
    pki_dir=self.config['pki_dir'],
  File "C:\salt\bin\lib\site-packages\salt\utils\verify.py", line 200, in verify_env
    from salt.utils.win_functions import get_current_user
  File "C:\salt\bin\lib\site-packages\salt\utils\win_functions.py", line 15, in <module>
    import psutil
  File "C:\salt\bin\lib\site-packages\psutil\__init__.py", line 28, in <module>
    from . import _common
ImportError: cannot import name _common

@Ch3LL
Copy link
Contributor

Ch3LL commented Mar 10, 2017

I know that we do not support windows 2003 , but maybe we can get @twangboy 's input here. Do you see an obvious solution to this or is there something in windows 2003 that is preventing these imports that you are aware of?

@Ch3LL Ch3LL added the Pending-Discussion The issue or pull request needs more discussion before it can be closed or merged label Mar 10, 2017
@Ch3LL Ch3LL added this to the Blocked milestone Mar 10, 2017
@twangboy
Copy link
Contributor

@lubyou This guy fixed something similar by downgrading psutil to version 2.2.0... I guess you could try that...
giampaolo/psutil#348 (comment)

@lubyou
Copy link
Contributor Author

lubyou commented Mar 13, 2017

Hi @twangboy, I downgraded psutil to 3.4.2 (last version that supports 2003) and the minion now starts.

Thanks for the help!

@lubyou lubyou closed this as completed Mar 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Pending-Discussion The issue or pull request needs more discussion before it can be closed or merged
Projects
None yet
Development

No branches or pull requests

3 participants