-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[BUG] Minion upgrade to 3006.9 fails on Windows with "specified service already exists" error #67054
Comments
I've done a bit more testing with this and can say with more (not complete) confidence that this is definitely a bug or regression introduced in
Next, I spun up an EC2 instance running Windows Server 2019, installed version
This returned immediately, so assumed it was running in the background. I waited a few minutes and then did a I went to the remove programs list, and the minion was showing installed as version So, I uninstalled the minion completely from my EC2 instance, reinstalled version
I decided to do one more test with an even earlier version just to make sure I wasn't crazy:
This time, I was on the VM with the task manager open, and I watched with my own eyes as it installed -- I saw a process with name I am extremely confident that this is a regression with version |
Description
After upgrading our Salt master to
3006.9
, we have turned our attention to getting our minions upgraded to3006.9
as well. We are having difficulties with our Windows minions, as the silent install/upgrade does not complete successfully. When upgrading manually, it errors out at the very end of the installation because thesalt-minion
service already exists. Just to be clear, when I say upgrade, I mean that we already have the Salt minion installed and running at an older version, and are just installing from a newer Salt minion binary (this has worked for us in the past).Apologies for submitting this as a bug, but I couldn't find a more appropriate type.
Setup
We have many Windows machines in our organization running various versions of Windows Server -- some as old as 2012 (very few) but most are 2016 or 2019. All of our minions are currently on version
3004.2
, and we are attempting a silent upgrade using the following simple Salt state:And applying with
salt -L my-minion.foo.bar state.apply minion.upgrade
. For reference, this is the exact same state we used to upgrade our Windows minions to3004.2
, obviously using that binary. It is expected that this state will fail, as the minion restarts during the installation.After applying this state, if I do a

salt -L my-minion.foo.bar grains.get saltversion
it is still on3004.2
-- if I hop onto the machine, and look intoC:\Program Files\Salt Project\Salt
I can see that the directory structure has been updated -- e.g. there issalt-call.exe
instead ofsalt-call.bat
-- but there are also still relics from the old3004.2
installation, including thebin/
directory:If I inspect the

salt-minion
service, I can see that it is still pointed toC:\Program Files\Salt Project\Salt\bin\ssm.exe
instead ofC:\Program Files\Salt Project\Salt\salt-minion.exe
like I would expect:To my eyes, it looks as though the minion is in a "half-state" between

3004.2
and3006.9
. So, I uninstalled the Salt minion, re-installed at3004.2
, then manually did an upgrade to3006.9
(basically, just run the.exe
and click through the screens). It almost got to the end of the install when it failed with the following error:It would appear that this binary cannot handle the scenario where the
salt-minion
service already exists -- in my experience, this was not the case when upgrading to3004.2
. As a result, we are kind of stuck automating the upgrade of our Windows minions as I cannot find a way to workaround this.For this testing I am using an on-prem machine, and I have also tried using my own laptop and gotten the same result.
Expected behavior
I would expect the
Salt-Minion-3006.9-Py3-AMD64-Setup.exe
binary to be able to handle the use-case where thesalt-minion
service already exists, and upgrade/re-configure it accordingly.One workaround I tried was to script the upgrade by executing a PowerShell script with
cmd.run
in the background -- so basically, the master will kick off this script and then return immediately, not waiting for it to complete:This is not working for me either -- my
ssm.exe
commands to edit the service configuration are not taking effect, and the script abruptly stops as soon as thesalt-minion
service is stopped or restarted (I have a hunch that even though the script is running in the background, its parent process is still the Salt minion service, so killing the service kills the script). This is also editing the service while that same service is running, so I don't even know if this is a legitimate approach -- either way, it's not working and as you can see, I'm getting desperate.Is there a recommended or more graceful way to silently upgrade Windows minions? We simply have too many to upgrade them manually.
The text was updated successfully, but these errors were encountered: