RuntimeBinderException when upgrading to 2018.4.3

Hello,

I’m getting a RuntimeBinderException, when upgrading:

2018-04-21 00:33:07.2538 1040 1 INFO ===================================================
2018-04-21 00:33:07.7225 1040 1 INFO Making sure it’s safe to upgrade the database schema…
2018-04-21 00:33:07.7538 1040 1 INFO Checking to see if database schema upgrade is required…
2018-04-21 00:33:07.8319 1040 1 INFO Database schema changes are required.
2018-04-21 00:33:07.9413 1040 1 INFO Executing pre-upgrade scripts…
2018-04-21 00:33:07.9725 1040 1 INFO Executing SQL Server script ‘Octopus.Core.UpgradeScriptsPre.Script0000 - Database options.sql’
2018-04-21 00:33:08.0350 1040 1 INFO Enabling read committed snapshot isolation on octopus
2018-04-21 00:33:08.0350 1040 1 INFO Read committed snapshot isolation is already on
2018-04-21 00:33:08.0975 1040 1 INFO Searching for indexes that might upset the database upgrade process…
2018-04-21 00:33:08.1131 1040 1 INFO Beginning transaction
2018-04-21 00:33:08.1288 1040 1 INFO Executing SQL Server script ‘Octopus.Core.UpgradeScripts.Script0045AddDefaultMachinePolicyToExistingTentacles.cs’
2018-04-21 00:33:08.6288 1040 1 INFO Processing Machines-1
2018-04-21 00:33:08.8944 1040 1 ERROR Upgrade failed due to an unexpected exception:
Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: Die Laufzeitbindung kann für einen NULL-Verweis nicht ausgeführt werden.
bei CallSite.Target(Closure , CallSite , Object , Type )
bei System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
bei Octopus.Core.UpgradeScripts.Script0045AddDefaultMachinePolicyToExistingTentacles.ApplyDefaultMachinePoliciesIfRequired(IDataRecord record, Func1 commandFactory, String tentacleMachinePolicyId) bei Octopus.Core.UpgradeScripts.Script0045AddDefaultMachinePolicyToExistingTentacles.ProvideScript(Func1 commandFactory)
bei DbUp.Engine.LazySqlScript.get_Contents()
bei DbUp.Support.SqlServer.SqlScriptExecutor.Execute(SqlScript script, IDictionary`2 variables)
bei DbUp.Engine.UpgradeEngine.PerformUpgrade()

Further the upgrade process seems not running transactional. When I’m executing the upgrade command a second time a primary key violation in the table MachinePolicy occurs, bacause the previous failed update already inserted a row in this table.

Best regards,
Sergej

I’m having the exact same problem. I’m upgrading from 3.3.10 to 2018.4.3.

I also saw that the upgrade didn’t proceed transactionally.

I thought the problem is that the Machine table had a MachinePolicyId column for which all of my Mahcines had null values. To test that hypothesis, I deleted the default machine policy row (to avoid a duplicate primary key exception when running the upgrade again) and added MachinePolicies-1 as the MachinePolicyId for each of my Machines. Same exception is thrown, perhaps because the TenantIds are also null. I thought of adding a default Tenant (that table is empty for me right now), but I thought I’d try a support discussion first :slight_smile:.

Since Tenants were added in 3.4. I also wonder if I should try upgrading from 3.3.10 to 3.4 first, then try 3.4 to 2018.4.3.

Hi Sergei and Louis,

Thanks for reaching out!

I can confirm that when upgrading from an older version of Octopus that you will need to perform some intermediate upgrades to get to latest. We currently recommend when upgrading from a pre 3.4 version to follow the following upgrade path:

Installed Version > 3.4.15 > 3.17.14 > Latest

@Sergej Are you able to confirm which version you are upgrading from and advise if it falls into this pattern?

Regards
Alex

Hi Alex,

I had version 3.3.27 running. I’ve installed 3.17.14 and then the newest release. Everything works fine now. Thank You for Your Support!

Sergej

Worked for me too. Though, I followed the recommended path of 3.4.15 > 3.17.14 > 2018.4.4.