saltstack / salt

Software to automate the management and configuration of any infrastructure or application at scale. Get access to the Salt software package repository here:
https://repo.saltproject.io/
Apache License 2.0
14.15k stars 5.48k forks source link

[ERROR ] Exception 'close_fds is not supported on Windows platforms if you redirect stdin/stdout/stderr' #27220

Closed TheBigBear closed 9 years ago

TheBigBear commented 9 years ago

@terminalmage hi Erik, sorry just ran into anohter glitch on a 2015.8 standalone masterless windows salt-minion.

When trying to run salt-call --local winrepo.update_git_repos

it gives me the following error:

C:\salt>salt-call --local winrepo.update_git_repos
[ERROR   ] Exception 'close_fds is not supported on Windows platforms if you red
irect stdin/stdout/stderr' caught while fetching winrepo remote 'https://github.
com/saltstack/salt-winrepo.git'
[ERROR   ] Exception 'close_fds is not supported on Windows platforms if you red
irect stdin/stdout/stderr' caught while fetching winrepo remote 'https://github.
com/saltstack/salt-winrepo-ng.git'
local:
    ----------
    https://github.com/saltstack/salt-winrepo-ng.git:
        c:\salt\srv\salt\win\repo-ng\salt-winrepo-ng
    https://github.com/saltstack/salt-winrepo.git:
        c:\salt\srv\salt\win\repo\salt-winrepo
jfindlay commented 9 years ago

@TheBigBear, thanks for the report.

TheBigBear commented 9 years ago

@jfindlay just woke up to realise that this is my own fault. I was doing this with a windows salt-minion that had been compiled on the basis of python 2.7.10 (to prove that it solved the SSL SNI problem - https://github.com/saltstack/salt/issues/27081 - and it did/does) , but 2.7.10 surfaces this error.

@twangboy this would be one of the things that would need to be worked around before we could upgrade the version of python embedded in the windows salt-minion up from 2.7.8 to 2.7.10.

this will have to be looked at by https://github.com/saltstack/salt/issues/25440#issuecomment-141584217

twangboy commented 9 years ago

@TheBigBear That command is running fine on my minion.... Is there some special configuration I'm missing for masterless? Shouldn't the --local be enough?

TheBigBear commented 9 years ago

@twangboy, OK, I recked my brain as to what might be different as I definitly am still getting this. And I have found a way to replicate it. My windows minion already has 'pygit2' support in it. and with pygit2 support it does give me this error message, I guess using pygit2 uses some IO redirection under windows which does not support "close_fds".

The easiest way to add pygit2 support is, taking it from a ready made python wheel from Christoph Gohlke's famous python wheel site at http://www.lfd.uci.edu/~gohlke/pythonlibs/ (to get the pygit2 one got to http://www.lfd.uci.edu/~gohlke/pythonlibs/#pygit2 and choose the correct bitness of the python 27 one)

then run the pip.exe that comes with the windows salt minion to install it. (in my case it is)

C:\salt\bin\Scripts\pip.exe install \Users\sysadmin.uk\Downloads\pygit2-0.21.3-cp27-none-win_amd64.whl

and to verify that it installed correctly salt-call --versions and double check that pygit2 shows version 0.21.3.

I think @terminalmage (Erik), might be quite familiar with this part of the code and possibly know how to best navigate this? He did say that pygit2 under windows should be considered a 'experimental' feature in Berryllium, and he was right. ;-)

twangboy commented 9 years ago

@terminalmage Could you look at this one?

twangboy commented 9 years ago

@terminalmage A few possible fixes: https://github.com/ipython/ipython/commit/14b007d906604eba9638dff85b3bc38a48d5504e https://trac-hacks.org/changeset/5399

terminalmage commented 9 years ago

Should be fixed by #27473.

cachedout commented 9 years ago

Fix merged.