Unexpected upgrade history detected when updating single node server from 2021.3.13150 to 2022.1.*

Trying sequentially upgrade Octopus Server from 2021.3.12132 to the latest.
First successfully upgraded to 2021.3.13150:

And when upgrading version 2021.3.13150 to 2022.1.3264 got error:

2022-09-20 13:15:17.7322   1652     10 FATAL  Unhandled AppDomain exception occurred: Unexpected upgrade history detected. You probably need to upgrade to a later version of Octopus Server. Extra upgrade script(s) found: Script0321DeleteQueuedCleanupTasks
Octopus.Shared.ControlledFailureException: Unexpected upgrade history detected. You probably need to upgrade to a later version of Octopus Server. Extra upgrade script(s) found: Script0321DeleteQueuedCleanupTasks

Then tried to upgrade first to the lower version 2022.1.2121 got similar error:

2022-09-20 13:28:49.1133   5064      1 FATAL  Unexpected upgrade history detected. You probably need to upgrade to a later version of Octopus Server. Extra upgrade script(s) found: Script0319RepairEntityJsonBlobs, Script0320RepairMachineAndActionTemplateJsonBlobs, Script0321DeleteQueuedCleanupTasks

Right now server is downgraded back to last successful version 2021.3.13150.

Hi @RinatGilmanov,

Thanks for reaching out, and welcome to the Octopus community! I’m sorry to see that you are running into these upgrade issues.

The 2021.3.13150 release was released outside of our regular LTS cadence. This seems to be causing the issues you are seeing attempting to upgrade to a more recent release. I tested some upgrades in-house, and unfortunately, I could not get past this same error on the latest releases.

I will raise this with our engineering team to see if we can identify the problem and develop a plan to help move forward. I will reach out when I have more information, but please let me know if you have any questions in the meantime.

Thanks!
Dan

1 Like

That’s because I started upgrading my old version 2021.3.12132 to the latest.
I found some similar errors on this forum but there are no solutions in there.

Thank you for helping!

Hi @RinatGilmanov,

Sorry for the confusion. I meant that this particular release was branched after we ended support for 2021.3, which we think is why this issue is occurring. Certainly nothing wrong with what you were attempting by upgrading to that version.

I’ve reached out to our engineering team, so I will let you know as soon as I have more info. They are based in Australia, so I likely won’t have an update until tomorrow. Please don’t hesitate to reach out if you have any other questions.

Thanks!
Dan

Also the same error when upgrading from 2021.3.13150 to 2022.3.10530:

2022-09-20 19:48:24.5771   4236      1 FATAL  Unexpected upgrade history detected. You probably need to upgrade to a later version of Octopus Server. Extra upgrade script(s) found: Script0321DeleteQueuedCleanupTasks
Octopus.Shared.ControlledFailureException: Unexpected upgrade history detected. You probably need to upgrade to a later version of Octopus Server. Extra upgrade script(s) found: Script0321DeleteQueuedCleanupTasks

If it is important in all cases Octopus was in Maintenance mode. Octopus server uses SQL Express as database server. If you need more information about environment tell me.

After installing version 2022.3.10530 and having the issue I found this table [dbo].[SchemaVersions] in Octopus database.
If DatabaseUpgradeCoordinator means that script Script0321DeleteQueuedCleanupTasks is unexpected, I deleted it from history:

delete from [octopus].[dbo].[SchemaVersions] where Id = 480 and ScriptName = N'Script0321DeleteQueuedCleanupTasks'
go

and after that run upgrade again:

.\Octopus.Server.exe database --instance OctopusServer --upgrade

Validation error disappeared! Profit.

I think release 2021.3.13150 has some fix that is not applicable for 2022.* releases, that’s because installers not expected that script Script0321DeleteQueuedCleanupTasks.

Now I have the latest release 2022.3. Thank you for your support!

2 Likes

Hi @RinatGilmanov,

I just wanted to update you that one of our engineers found the cause of this issue and has created a new GitHub issue here. Thanks for your help as we worked through this issue, and please let us know if you need anything else.

Thanks!
Dan

I am glad to be helpful! :+1:

1 Like