salt icon indicating copy to clipboard operation
salt copied to clipboard

windows pkg.install fails

Open getabc opened this issue 12 years ago • 5 comments

Unable to get windows pkg.install to work and after command sent windows minion loops.

After the failure I have to restart the minion.

Windows salt-minion.exe 2014.1.13 (Hydrogen)

Linux salt-master 2014.1.13 (Hydrogen)

Test command

salt 'AO1-818190' pkg.refresh_db
salt 'AO1-818190' pkg.install 'Firefox'

/etc/salt/master

win_repo: '/srv/salt/base/win/repo'
win_repo_mastercachefile: '/srv/salt/base/win/repo/winrepo.p'
file_roots:
  base:
    - /srv/salt/base

Changes to win_repo* was made after finding https://github.com/saltstack/salt/issues/10894

File location

root@control:/srv/salt/base/win/repo/firefox# ls -l
total 59816
-rw-r--r-- 1 root root 29014160 Nov 13 12:34 Firefox_Setup_29_0_1.exe
-rw-r--r-- 1 root root 32229000 Nov 13 12:34 Firefox_Setup_31_0esr.exe
-rw-r--r-- 1 root root      565 Nov 13 12:49 init.sls
root@control:/srv/salt/base/win/repo/firefox# cat init.sls
Firefox:
  29.0.1:
    installer: 'salt://win/repo/firefox/Firefox_Setup_29_0_1.exe'
    full_name: 'Mozilla Firefox 29.0.1 (x86 en-US)'
    reboot: False
    install_flags: ' /s '
    uninstaller: 'C:\Program Files (x86)\Mozilla Firefox\uninstall\helper.exe'
    uninstall_flags: ' /S'
  31.0esr:
    installer: 'salt://win/repo/firefox/Firefox_Setup_31_0esr.exe'
    full_name: 'Mozilla Firefox 31.0 (x86 en-US)'
    reboot: False
    install_flags: ' /s '
    uninstaller: 'C:\Program Files (x86)\Mozilla Firefox\uninstall\helper.exe'
    uninstall_flags: ' /S'

Windows Minion Output

C:\salt>salt-minion.exe -l debug
[DEBUG   ] Reading configuration from c:\salt\conf\minion
[INFO    ] Using cached minion ID from c:\salt\conf\minion_id: AO1-818190
[DEBUG   ] Configuration file path: c:\salt\conf\minion
[INFO    ] Setting up the Salt Minion "AO1-818190"
[DEBUG   ] Created pidfile: c:\salt\var\run\salt-minion.pid
[DEBUG   ] Reading configuration from c:\salt\conf\minion
[DEBUG   ] Attempting to authenticate with the Salt Master at 10.156.47.20
[DEBUG   ] Loaded minion key: c:\salt\conf\pki\minion\minion.pem
[DEBUG   ] Loaded minion key: c:\salt\conf\pki\minion\minion.pem
[DEBUG   ] Decrypting the current master AES key
[DEBUG   ] Loaded minion key: c:\salt\conf\pki\minion\minion.pem
[INFO    ] Authentication with master at 10.156.47.20 successful!
[DEBUG   ] Loaded minion key: c:\salt\conf\pki\minion\minion.pem
[DEBUG   ] Decrypting the current master AES key
[DEBUG   ] Loaded minion key: c:\salt\conf\pki\minion\minion.pem
[DEBUG   ] Loaded minion key: c:\salt\conf\pki\minion\minion.pem
[DEBUG   ] Reading configuration from c:\salt\conf\minion
[DEBUG   ] Loaded win_shadow as virtual shadow
[DEBUG   ] Loaded win_ip as virtual ip
[DEBUG   ] Loaded win_disk as virtual disk
[DEBUG   ] Loaded win_status as virtual status
[DEBUG   ] Loaded sysmod as virtual sys
[DEBUG   ] Loaded win_autoruns as virtual autoruns
[DEBUG   ] Loaded win_system as virtual system
[DEBUG   ] Loaded win_firewall as virtual firewall
[DEBUG   ] Loaded zcbuildout as virtual buildout
[DEBUG   ] Loaded win_pkg as virtual pkg
[DEBUG   ] Loaded win_network as virtual network
[DEBUG   ] Loaded win_ntp as virtual ntp
[DEBUG   ] Loaded cmdmod as virtual cmd
[DEBUG   ] Loaded win_file as virtual file
[DEBUG   ] Loaded virtualenv_mod as virtual virtualenv
[DEBUG   ] Loaded djangomod as virtual django
[DEBUG   ] Loaded win_service as virtual service
[DEBUG   ] Loaded win_useradd as virtual user
[DEBUG   ] Loaded win_timezone as virtual timezone
[DEBUG   ] Loaded win_repo as virtual winrepo
[DEBUG   ] Loaded win_groupadd as virtual group
[DEBUG   ] Loaded couchdb_return as virtual couchdb
[DEBUG   ] Loaded carbon_return as virtual carbon
[DEBUG   ] Loaded sqlite3_return as virtual sqlite3
[DEBUG   ] schedule.clean_proc_dir: checking job {'tgt_type': 'glob', 'jid': '20141113134306452414', 'tgt': 'AO1-818190', 'pid': 2456, 'ret': '', 'user': 'sudo_andrewc', 'arg': ['Firefox', {'version': '31.0esr', '__kwarg__': True}], 'fun':
'pkg.install'} for process existence
[DEBUG   ] schedule.clean_proc_dir: checking job {'tgt_type': 'glob', 'jid': '20141113134355829971', 'tgt': 'AO1-818190', 'pid': 2456, 'ret': '', 'user': 'sudo_andrewc', 'arg': ['20141113134306452414'], 'fun': 'saltutil.find_job'} for proce
ss existence
[DEBUG   ] I am AO1-818190 and I am not supposed to start any proxies.
[INFO    ] Minion is starting as user 'Network Services'
[DEBUG   ] Minion 'AO1-818190' trying to tune in
[DEBUG   ] Minion PUB socket URI: tcp://127.0.0.1:4510
[DEBUG   ] Minion PULL socket URI: tcp://127.0.0.1:4511
[DEBUG   ] Generated random reconnect delay between '1000ms' and '11000ms' (6170)
[DEBUG   ] Setting zmq_reconnect_ivl to '6170ms'
[DEBUG   ] Setting zmq_reconnect_ivl_max to '11000ms'
[DEBUG   ] Running scheduled job: __mine_interval
[DEBUG   ] schedule: This job was scheduled with jid_include, adding to cache (jid_include defaults to True)
[DEBUG   ] schedule: This job was scheduled with a max number of 2
[DEBUG   ] Loaded win_shadow as virtual shadow
[DEBUG   ] Loaded win_ip as virtual ip
[DEBUG   ] Loaded win_disk as virtual disk
[DEBUG   ] Loaded win_status as virtual status
[DEBUG   ] Loaded sysmod as virtual sys
[DEBUG   ] Loaded win_autoruns as virtual autoruns
[DEBUG   ] Loaded win_system as virtual system
[DEBUG   ] Loaded win_firewall as virtual firewall
[DEBUG   ] Loaded zcbuildout as virtual buildout
[DEBUG   ] Loaded win_pkg as virtual pkg
[DEBUG   ] Loaded win_network as virtual network
[DEBUG   ] Loaded win_ntp as virtual ntp
[DEBUG   ] Loaded cmdmod as virtual cmd
[DEBUG   ] Loaded win_file as virtual file
[DEBUG   ] Loaded virtualenv_mod as virtual virtualenv
[DEBUG   ] Loaded djangomod as virtual django
[DEBUG   ] Loaded win_service as virtual service
[DEBUG   ] Loaded win_useradd as virtual user
[DEBUG   ] Loaded win_timezone as virtual timezone
[DEBUG   ] Loaded win_repo as virtual winrepo
[DEBUG   ] Loaded win_groupadd as virtual group
[DEBUG   ] Loaded couchdb_return as virtual couchdb
[DEBUG   ] Loaded carbon_return as virtual carbon
[DEBUG   ] Loaded sqlite3_return as virtual sqlite3
[DEBUG   ] schedule.handle_func: adding this job to the jobcache with data {'fun': 'mine.update', 'jid': '20141113134446
[DEBUG   ] Loaded minion key: c:\salt\conf\pki\minion\minion.pem
[DEBUG   ] Decrypting the current master AES key
[DEBUG   ] Loaded minion key: c:\salt\conf\pki\minion\minion.pem
[DEBUG   ] Loaded minion key: c:\salt\conf\pki\minion\minion.pem
[DEBUG   ] Loaded minion key: c:\salt\conf\pki\minion\minion.pem
[DEBUG   ] Decrypting the current master AES key
[DEBUG   ] Loaded minion key: c:\salt\conf\pki\minion\minion.pem
[INFO    ] User sudo_andrewc Executing command pkg.refresh_db with jid 20141113134501207965
[DEBUG   ] Command details {'tgt_type': 'glob', 'jid': '20141113134501207965', 'tgt': 'AO1-818190', 'ret': '', 'user': 'sudo_andrewc', 'arg': [], 'fun': 'pkg.refresh_db'}
[DEBUG   ] Loaded minion key: c:\salt\conf\pki\minion\minion.pem
[DEBUG   ] Decrypting the current master AES key
[DEBUG   ] Loaded minion key: c:\salt\conf\pki\minion\minion.pem
[DEBUG   ] Loaded minion key: c:\salt\conf\pki\minion\minion.pem
[DEBUG   ] Decrypting the current master AES key
[DEBUG   ] Loaded minion key: c:\salt\conf\pki\minion\minion.pem
[INFO    ] Returning information for job: 20141113134501207965
[INFO    ] User sudo_andrewc Executing command pkg.install with jid 20141113134512065179
[DEBUG   ] Command details {'tgt_type': 'glob', 'jid': '20141113134512065179', 'tgt': 'AO1-818190', 'ret': '', 'user': 'sudo_andrewc', 'arg': ['Firefox'], 'fun': 'pkg.install'}
[DEBUG   ] Initializing COM library
[DEBUG   ] Uninitializing COM library
[INFO    ] User sudo_andrewc Executing command saltutil.find_job with jid 20141113134517077987
[DEBUG   ] Command details {'tgt_type': 'glob', 'jid': '20141113134517077987', 'tgt': 'AO1-818190', 'ret': '', 'user': 'sudo_andrewc', 'arg': ['20141113134512065179'], 'fun': 'saltutil.find_job'}
[INFO    ] Returning information for job: 20141113134517077987
[DEBUG   ] Fetching file from saltenv 'base', ** attempting ** 'salt://win/repo/firefox/Firefox_Setup_31_0esr.exe'
[INFO    ] User sudo_andrewc Executing command saltutil.find_job with jid 20141113134522357408
[DEBUG   ] Command details {'tgt_type': 'glob', 'jid': '20141113134522357408', 'tgt': 'AO1-818190', 'ret': '', 'user': 'sudo_andrewc', 'arg': ['20141113134512065179'], 'fun': 'saltutil.find_job'}
[INFO    ] Returning information for job: 20141113134522357408
[INFO    ] User sudo_andrewc Executing command saltutil.find_job with jid 20141113134528279019
[DEBUG   ] Command details {'tgt_type': 'glob', 'jid': '20141113134528279019', 'tgt': 'AO1-818190', 'ret': '', 'user': 'sudo_andrewc', 'arg': ['20141113134512065179'], 'fun': 'saltutil.find_job'}
[INFO    ] Returning information for job: 20141113134528279019
[INFO    ] User sudo_andrewc Executing command saltutil.find_job with jid 20141113134534148276
[DEBUG   ] Command details {'tgt_type': 'glob', 'jid': '20141113134534148276', 'tgt': 'AO1-818190', 'ret': '', 'user': 'sudo_andrewc', 'arg': ['20141113134512065179'], 'fun': 'saltutil.find_job'}
[INFO    ] Returning information for job: 20141113134534148276
[INFO    ] User sudo_andrewc Executing command saltutil.find_job with jid 20141113134539957519
[DEBUG   ] Command details {'tgt_type': 'glob', 'jid': '20141113134539957519', 'tgt': 'AO1-818190', 'ret': '', 'user': 'sudo_andrewc', 'arg': ['20141113134512065179'], 'fun': 'saltutil.find_job'}
[INFO    ] Returning information for job: 20141113134539957519
[INFO    ] User sudo_andrewc Executing command saltutil.find_job with jid 20141113134545904964
[DEBUG   ] Command details {'tgt_type': 'glob', 'jid': '20141113134545904964', 'tgt': 'AO1-818190', 'ret': '', 'user': 'sudo_andrewc', 'arg': ['20141113134512065179'], 'fun': 'saltutil.find_job'}
[INFO    ] Returning information for job: 20141113134545904964
[INFO    ] User sudo_andrewc Executing command saltutil.find_job with jid 20141113134551367876
[DEBUG   ] Command details {'tgt_type': 'glob', 'jid': '20141113134551367876', 'tgt': 'AO1-818190', 'ret': '', 'user': 'sudo_andrewc', 'arg': ['20141113134512065179'], 'fun': 'saltutil.find_job'}
[INFO    ] Returning information for job: 20141113134551367876
[INFO    ] User sudo_andrewc Executing command saltutil.find_job with jid 20141113134556898132
[DEBUG   ] Command details {'tgt_type': 'glob', 'jid': '20141113134556898132', 'tgt': 'AO1-818190', 'ret': '', 'user': 'sudo_andrewc', 'arg': ['20141113134512065179'], 'fun': 'saltutil.find_job'}
[INFO    ] Returning information for job: 20141113134556898132
[INFO    ] User sudo_andrewc Executing command saltutil.find_job with jid 20141113134602290116
[DEBUG   ] Command details {'tgt_type': 'glob', 'jid': '20141113134602290116', 'tgt': 'AO1-818190', 'ret': '', 'user': 'sudo_andrewc', 'arg': ['20141113134512065179'], 'fun': 'saltutil.find_job'}
[INFO    ] Returning information for job: 20141113134602290116

getabc avatar Nov 13 '14 03:11 getabc

Unable to reproduce the issue using the same master and minion versions: 2014.1.13.

Is this happening all of the time? or on just one minion? or intermittent?

maybe try running: salt-run winrepo.update_git_repo to see if that helps clear things up.

Also, what version of Windows is your minion running on?

ssgward avatar Nov 14 '14 20:11 ssgward

Minon is running Windows 7/64bit and it is happening all the time with all our minions.

While playing around with the setting I also noticed the following,

[DEBUG   ] Loaded minion key: c:\salt\conf\pki\minion\minion.pem
[DEBUG   ] Fetching file from saltenv 'base', ** attempting ** 'salt://win/repo/firefox/Firefox_Setup_31_0esr.exe'
[DEBUG   ] Failed to authenticate message
[DEBUG   ] Loaded minion key: c:\salt\conf\pki\minion\minion.pem
[DEBUG   ] Decrypting the current master AES key
[DEBUG   ] Loaded minion key: c:\salt\conf\pki\minion\minion.pem
[ERROR   ] Unable to cache file 'salt://win/repo/firefox/Firefox_Setup_31_0esr.exe' from saltenv 'base'.
[INFO    ] Executing command '""  /s  ' in directory 'C:\\Users\\Network Services'
[ERROR   ] Command '""  /s  ' failed with return code: 1
[ERROR   ] output: '""' is not recognized as an internal or external command,
operable program or batch file.

I was unable to make the following settings work,

win_repo: '/srv/salt/base/repo/win/'
win_repo_mastercachefile: '/srv/salt/base/repo/win/winrepo.p'

seem like the minion only accepts the direcoty structure /win/repo/

Does the salt minion download the cache file to the c:\salt directory or the windows user profile?

Could there be an issue with the Network Services username and working directy containing a space?

# salt-run winrepo.update_git_repo
Function 'winrepo.update_git_repo' is unavailable

getabc avatar Nov 17 '14 05:11 getabc

Sorry, mislead on a typo above. The command should be salt-run winrepo.update_git_repos (with an 's' at the end).

If your fileserver_backend section of your master.conf is enabled, make sure it looks like the following:

fileserver_backend:
  - git
  - roots

Everything else looks good in your master.conf regarding your win repos and file_roots.

It is an interesting observation you make about minions only accepting the directory /win/repo/ as opposed to /repo/win. Maybe there is a bug with that...

My environments are using /win/repo/

ssgward avatar Nov 17 '14 23:11 ssgward

@getabc: any updates on your end. Are you still seeing this problem?

ssgward avatar Nov 24 '14 22:11 ssgward

Hi sshward,

I had to set the following in my master file,

fileserver_backend:
  - git
  - roots

followed by,

salt-run winrepo.update_git_repos

everything is working perfectly now.

Thanks you very much!

Andrew

getabc avatar Nov 26 '14 21:11 getabc