Octopus upgrade failed

Hi Support,

When I am trying to upgrade octopus from 2018.4.0 to 2019.3.1, I got below error

Executing .NET Database Server script ‘Octopus.Core.UpgradeScripts.Script0180BuiltInFeedMigration.cs’
Moving the existing built in packages feed into the Default space
Finding a suitable location for temporary package storage, trying for F:\Octopus\Packages/…/PackagesTemp
Found parent directory F:\Octopus
Ensuring Package Feed Location Exists F:\Octopus\Packages\Spaces-1\feeds-builtin
The destination F:\Octopus\Packages\Spaces-1\feeds-builtin already exists, probably because this migration has been attempted before. Attempting to move the individual files and sub directories instead. This might take a bit longer.
Moving subdirectories and files from F:\Octopus\Packages to F:\Octopus\Packages\Spaces-1\feeds-builtin
Moving subdirectory F:\Octopus\Packages\Spaces-1 to F:\Octopus\Packages\Spaces-1\feeds-builtin\Spaces-1
Moving the built in package feed failed. Unable to access a directory while moving: Access to the path ‘F:\Octopus\Packages\Spaces-1’ is denied… You can still move packages manually from F:\Octopus\Packages into the new location for the built in feed: F:\Octopus\Packages\Spaces-1\feeds-builtin, and then use the re-index feature as required. There may also be packages in F:\Octopus\PackagesTemp
Error occured when executing scripts, transaction will be rolled back
Error: Upgrade failed due to an unexpected exception:
Error: System.IO.IOException: Access to the path ‘F:\Octopus\Packages\Spaces-1’ is denied.
Error: at System.IO.DirectoryInfo.MoveTo(String destDirName)
Error: at Octopus.Core.UpgradeScripts.Script0180BuiltInFeedMigration.MovePackagesAndFiles(String sourceDirectory, String destinationDirectory)
Error: at Octopus.Core.UpgradeScripts.Script0180BuiltInFeedMigration.MoveSubdirectoriesAndFiles(String sourceDirectory, Maybe1 tempPackagesDirectory, String destinationDirectory) Error: at Octopus.Core.UpgradeScripts.Script0180BuiltInFeedMigration.Execute(IDbCommandExecutor commandExecutor, IUpgradeLog log) Error: at Octopus.Core.Initialization.DbCommandUpgradeScriptResolver.Execute(Func1 commandFactory, IUpgradeLog log)
Error: at Octopus.Core.Initialization.DatabaseUpgrader.OctopusUpgradeScriptExecutor.<>c__DisplayClass6_0.b__0(Func1 commandFactory) Error: at DbUp.Engine.Transactions.SingleTrasactionStrategy.Execute(Action1 action)
Error: at Octopus.Core.Initialization.DatabaseUpgrader.OctopusUpgradeScriptExecutor.ExecuteDbCommandUpgradeScript(IConnectionManager connectionManager, IJournal journal, IUpgradeLog log, IDbCommandUpgradeScript upgradeScript)
Error: at Octopus.Core.Initialization.DatabaseUpgrader.OctopusUpgradeScriptExecutor.Execute(SqlScript script, IDictionary2 variables) Error: at DbUp.Engine.UpgradeEngine.PerformUpgrade() Error: We encountered an error during the schema upgrade. The schema upgrade was stopped and rolled back. Don't worry, this means we haven't made any changes to your data, and you should be able to get back up and running quickly. Error: Here is the summary of the problems we encountered: Error: ----------------------------------------- Error: Access to the path 'F:\\Octopus\\Packages\Spaces-1' is denied. Error: System.IO.IOException Error: at System.IO.DirectoryInfo.MoveTo(String destDirName) Error: at Octopus.Core.UpgradeScripts.Script0180BuiltInFeedMigration.MovePackagesAndFiles(String sourceDirectory, String destinationDirectory) Error: at Octopus.Core.UpgradeScripts.Script0180BuiltInFeedMigration.MoveSubdirectoriesAndFiles(String sourceDirectory, Maybe1 tempPackagesDirectory, String destinationDirectory)
Error: at Octopus.Core.UpgradeScripts.Script0180BuiltInFeedMigration.Execute(IDbCommandExecutor commandExecutor, IUpgradeLog log)
Error: at Octopus.Core.Initialization.DbCommandUpgradeScriptResolver.Execute(Func1 commandFactory, IUpgradeLog log) Error: at Octopus.Core.Initialization.DatabaseUpgrader.OctopusUpgradeScriptExecutor.<>c__DisplayClass6_0.<ExecuteDbCommandUpgradeScript>b__0(Func1 commandFactory)
Error: at DbUp.Engine.Transactions.SingleTrasactionStrategy.Execute(Action1 action) Error: at Octopus.Core.Initialization.DatabaseUpgrader.OctopusUpgradeScriptExecutor.ExecuteDbCommandUpgradeScript(IConnectionManager connectionManager, IJournal journal, IUpgradeLog log, IDbCommandUpgradeScript upgradeScript) Error: at Octopus.Core.Initialization.DatabaseUpgrader.OctopusUpgradeScriptExecutor.Execute(SqlScript script, IDictionary2 variables)
Error: at DbUp.Engine.UpgradeEngine.PerformUpgrade()
Error: -----------------------------------------
Error: Beginning transaction
Error: Checking whether journal table exists…
Error: Executing .NET Database Server script ‘Octopus.Core.UpgradeScripts.Script0001RemoveTaskViewLogPermissionAgain.cs’
Error: Checking whether journal table exists…
Error: 0 User Roles will be upgraded to remove the TaskViewLog permission…
Error: 0 User Roles successfully upgraded to remove the TaskViewLog permission
Error: Executing .NET Database Server script ‘Octopus.Core.UpgradeScripts.Script0111AddDynamicInfrastructureFlagToEnvironments.cs’
Error: Adding Dynamic Infrastructure flag to Deployment Environments
Error: Executing .NET Database Server script ‘Octopus.Core.UpgradeScripts.Script0112DeleteOrphanedTenantTagsFromCertificates.cs’
Error: Deleting orphaned tenant tags from certificates.
Error: Executing TSQL Database Server script ‘Octopus.Core.UpgradeScripts.Script0113 - Add Worker Pools.sql’
Error: Executing .NET Database Server script ‘Octopus.Core.UpgradeScripts.Script0115AddFeatureToTurnOffBuiltinWorker.cs’
Error: Adding feature option to turn Built-in Worker on/off.
Error: Setting Built-in Worker to on.
Error: Executing TSQL Database Server script ‘Octopus.Core.UpgradeScripts.Script0116 - Add Machine Columns.sql’
Error: Creating new Machine table columns
Error: Setting CommunicationStyle column for Cloud Region
Error: Setting CommunicationStyle column for Tentacle
Error: Setting CommunicationStyle column for SSH
Error: Setting CommunicationStyle column for Offline
Error: Setting CommunicationStyle column for Azure
Error: Extracting Thumbprint to a column
Error: Extracting FingerPrint to a column
Error: Extracting RelatedDocumentIds to a column (Part 1/2)
Error: Extracting RelatedDocumentIds to a column (Part 2/2)
Error: Executing TSQL Database Server script ‘Octopus.Core.UpgradeScripts.Script0117 - Add RelatedDocuments.sql’
Error: Executing TSQL Database Server script ‘Octopus.Core.UpgradeScripts.Script0118 - Add Machine.DataVersion.sql’
Error: Executing TSQL Database Server script ‘Octopus.Core.UpgradeScripts.Script0118 - Rename RelatedDocuments Column.sql’
Error: Caution: Changing any part of an object name could break scripts and stored procedures.
Error: Caution: Changing any part of an object name could break scripts and stored procedures.
Error: Executing .NET Database Server script ‘Octopus.Core.UpgradeScripts.Script0118AddWorkerPermissionstoEnvironmentRoles.cs’
Error: Executing .NET Database Server script ‘Octopus.Core.UpgradeScripts.Script0118DeleteOrphanedVariableSetSnapshots.cs’
Error: Deleting orphaned library variable set snapshots.
Error: There are 1226 releases to check.
Error: Processed releases batch #1 out of 1
Error: No orphaned library variable set snapshots were found
Error: Phase 2, looking for orphaned project variables set snapshots
Error: No orphaned project variable snapshots were found
Error: Executing .NET Database Server script ‘Octopus.Core.UpgradeScripts.Script0118MigrateAzureWebAppTargetToNewSlotFormat.cs’
Error: Executing .NET Database Server script ‘Octopus.Core.UpgradeScripts.Script0118MigrationEnumSubTypes.cs’
Error: Migrating Account to string based subtyping
Error: Migrating DeploymentTarget endpoints to string based subtyping
Error: Migrating Worker endpoints to string based subtyping
Error: Migrating FeedType to string based subtyping
Error: Executing .NET Database Server script ‘Octopus.Core.UpgradeScripts.Script0118MoveFeedUriToJSON.cs’
Error: Processing feeds-builtin
Error: Processing feeds-builtin-releases
Error: Executing TSQL Database Server script ‘Octopus.Core.UpgradeScripts.Script0119 - AddClonedByProjectIdColumnToProjects.sql’
Error: Executing TSQL Database Server script ‘Octopus.Core.UpgradeScripts.Script0119 - DropFeedUri.sql’
Error: Executing TSQL Database Server script ‘Octopus.Core.UpgradeScripts.Script0119 - Release to VariableSet RelatedDocument.sql’
Error: Executing .NET Database Server script ‘Octopus.Core.UpgradeScripts.Script0120ConvertPackagePropertiesToPackagesCollection.cs’
Error: Converting deployment-action package properties into packages collection
Error: Processed 100 of 696
Error: Processed 200 of 696
Error: Processed 300 of 696
Error: Processed 400 of 696
Error: Processed 500 of 696
Error: Processed 600 of 696
Error: Converting action-template package properties into packages collection
Error: Executing .NET Database Server script ‘Octopus.Core.UpgradeScripts.Script0120PopulateRelatedDocumentTable.cs’
Error: 1246 rows in VariableSet (27.11MB)
Error: 0 rows in TenantVariable (0.00MB)
Error: 696 rows in DeploymentProcess (18.54MB)
Error: Extracting related document references. This will take about 1 minute(s) depending on server size.

Can you please help with the upgrade and advise how to proceed the upgrade.

Thanks & Regards,
Edmond

any update on this?

Hi Edmond,

Thanks for getting in touch! I’m very sorry to hear you’re hitting this trouble upgrading. When upgrade scripts are run, they’re run as the user who performed the upgrade. Does this user have access to the folder mentioned (F:\\Octopus\\Packages\Spaces-1)? If not, would you be able to intialize the upgrade with a different user and let me know if that gets the upgrade going correctly?

I look forward to hearing back and getting to the bottom of this one!

Best regards,

Kenny

Yes Kenny, the user running the upgrade is local administrator account.

any update? can anyone help to fix this?

Hi Edmond,

Thanks for following up and confirming that. I’m sorry to hear you’re still hitting this problem when upgrading. I’ve had a long discussion with my team regarding this issue, and we attempted to reproduce this based on some assumptions on how the upgrade scripts are moving the packages folder (the folder was moved with the introduction of spaces in 2019). However we haven’t had any luck reproducing this yet.

We’d like to offer to jump on a call with you to figure this out, though firstly have you been able to try the manual moving of your packages in the built-in repo as mentioned in the error message?

You can still move packages manually from F:\Octopus\Packages into the new location for the built in feed: F:\Octopus\Packages\Spaces-1\feeds-builtin, and then use the re-index feature as required.

If not, would you be able to give that a go and let us know if that fixes it for you?

I’m very sorry again about the inconvenience this issue has caused you, and I look forward to hearing back and getting to the bottom of this one.

Best regards,

Kenny

Hi Kenneth,

I don’t think the instruction works in our case. Can you please just let me know when you will be online today via the forum? I am happy to have a call and show you what the real challenge is.

Thanks & Regards,
Edmond

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.