flcdrg / au-packages

David's Chocolatey Automatic Packages
MIT License
18 stars 52 forks source link

Upgrading sql-server-express after changing version from 2019 to 2022 fails #142

Closed juliank closed 1 year ago

juliank commented 1 year ago

After changing the target version for the sql-server-express package from 2019 to 2022 (#139), upgrading the package fails:

C:\> cup sql-server-express -y
Chocolatey v1.2.0
Upgrading the following packages:
sql-server-express
By upgrading, you accept licenses for the packages.

You have sql-server-express v2019.20200409 installed. Version 2022.16.0.1000 is available based on your source(s).
Progress: Downloading sql-server-express 2022.16.0.1000... 100%

sql-server-express v2022.16.0.1000 [Approved]
sql-server-express package files upgrade completed. Performing other installation steps.
C:\Users\julian\AppData\Local\Temp\chocolatey\sql-server-express\2022.16.0.1000\SQLEXPR.exe
Extracting...
Installing...
Installing sql-server-express...
ERROR: Running ["C:\Users\julian\AppData\Local\Temp\chocolatey\sql-server-express\2022.16.0.1000\SQLEXPR\setup.exe" /IACCEPTSQLSERVERLICENSETERMS /Q /ACTION=install /INSTANCEID=SQLEXPRESS /INSTANCENAME=SQLEXPRESS /UPDATEENABLED=FALSE ] was not successful. Exit code was '-2054422508'. See log for possible error messages.
The upgrade of sql-server-express was NOT successful.
Error while running 'C:\ProgramData\chocolatey\lib\sql-server-express\tools\chocolateyinstall.ps1'.

From SQL Server's own installation log file (c:\Program Files\Microsoft SQL Server\160\Setup Bootstrap\Log\Summary.txt) I can see the following:

Overall summary:
  Final result:                  Failed: see details below
  Exit code (Decimal):           -2054422508
  Exit facility code:            1420
  Exit error code:               20
  Exit message:                  Instance name 'SQLEXPRESS' is already in use. To continue, specify a unique instance name.
  Start time:                    2022-11-28 08:13:22
  End time:                      2022-11-28 08:13:37
  Requested action:              Install

Is this expected (do one simply have to uninstall the old package and re-install it), or should it be able to handle the upgrade from 2019 to 2022?

flcdrg commented 1 year ago

yeah.. that is kind of expected. Historically (by the previous maintainer) this package has been updated to the latest version available, even though it hasn't really supported upgrading between versions.