Troubleshooting Salt Software Packaging
Here are some helpful commands when troubleshooting Salt Software Packaging failures or issues.
List recent job IDs¶
salt-run jobs.list_jobs | head
Look up a specific job¶
salt-run jobs.lookup_jid <JID>
Terminate a job¶
salt 'the-minion-id' saltutil.kill_job <JID>
Check salt-minion is still checking in (running)¶
salt 'the-minion-id' saltutil.running
Restart the salt minion¶
salt 'the-minion-id' service.restart salt-minion
Get minion logs¶
This command will show the last 200 lines of the minion log.
salt 'the-minion-id' cmd.run \
'powershell -NoProfile -Command "
Get-Content ''C:\ProgramData\Salt Project\Salt\var\log\salt\minion'' -Tail 200
"'
Test download¶
This command mimics how the salt minion downloads the file.
salt 'the-minion-id' cp.get_file \
https://<artifactory-or-fileserver-path>/7z2501-x64.msi \
'C:\Windows\Temp\7z2501-x64.msi' \
makedirs=True
Check for stuck process¶
This command uses powershell to list all msiexec processes running on the minion.
You can replace msiexec with any other process name.
salt 'the-minion-id' cmd.run \
'powershell -NoProfile -Command "
Get-Process msiexec -ErrorAction SilentlyContinue |
Select-Object Id,ProcessName,StartTime,Path |
Format-Table -Auto
"'
Check for any log files¶
This command looks for any MSI*.log files in $ENV:Temp and lists their details.
You can adjust the filter to any other log/text file format.
salt 'the-minion-id' cmd.run \
'powershell -NoProfile -Command "
Get-ChildItem ''$env:TEMP'' -Filter ''MSI*.log'' -ErrorAction SilentlyContinue |
Sort-Object LastWriteTime -Descending |
Select-Object -First 5 FullName,LastWriteTime |
Format-Table -Auto
"'
Check installer flags by running manually¶
Get the install section from the software package state file and manually run msiexec with those flags on the minion.
If the manual run shows any prompts or dialog boxes the install will hang waiting on user input that will never happen.