I’m running an export of my Octopus configs through the command line so that I can version control the settings. I was previously running Octopus.3.0.7.2204-x64 and it was working fine. Once I updated to Octopus.3.0.12.2366-x64 I started getting a NullReferenceException during the export. It fails on trying to export the first “variable-set-snapshot.json”.
This is the command I’m running in a custom step:
&"$OctopusMigratorPath\Octopus.Migrator.exe" “export” “–console” “–instance” “"$OctopusServiceInstance
”" “–directory” “"$WorkingFolder
”" “–password” “"$MasterKey
”"
Here is the log entry:
2015-08-12 14:30:00.0368 1 FATAL System.NullReferenceException: Object reference not set to an instance of an object.
at Octopus.Migrator.ExportProcess.ExportController.WriteVariableSetSnapshotForRelease(ExportContext context, IRelationalTransaction transaction, Release release, String directoryPath) in Y:\work\refs\heads\master\source\Octopus.Migrator\ExportProcess\ExportController.cs:line 167
at Octopus.Migrator.ExportProcess.ExportController.WriteReleases(ExportContext context) in Y:\work\refs\heads\master\source\Octopus.Migrator\ExportProcess\ExportController.cs:line 143
at Octopus.Migrator.ExportProcess.ExportController.Export() in Y:\work\refs\heads\master\source\Octopus.Migrator\ExportProcess\ExportController.cs:line 93
at Octopus.Shared.Startup.AbstractCommand.Octopus.Shared.Startup.ICommand.Start(String[] commandLineArguments, ICommandRuntime commandRuntime, OptionSet commonOptions) in Y:\work\refs\heads\master\source\Octopus.Shared\Startup\AbstractCommand.cs:line 57
at Octopus.Shared.Startup.ConsoleHost.Run(Action1 start, Action shutdown) in Y:\work\refs\heads\master\source\Octopus.Shared\Startup\ConsoleHost.cs:line 34 2015-08-12 14:30:00.0680 1 FATAL Object reference not set to an instance of an object. System.NullReferenceException: Object reference not set to an instance of an object. at Octopus.Migrator.ExportProcess.ExportController.WriteVariableSetSnapshotForRelease(ExportContext context, IRelationalTransaction transaction, Release release, String directoryPath) in Y:\work\refs\heads\master\source\Octopus.Migrator\ExportProcess\ExportController.cs:line 167 at Octopus.Migrator.ExportProcess.ExportController.WriteReleases(ExportContext context) in Y:\work\refs\heads\master\source\Octopus.Migrator\ExportProcess\ExportController.cs:line 143 at Octopus.Migrator.ExportProcess.ExportController.Export() in Y:\work\refs\heads\master\source\Octopus.Migrator\ExportProcess\ExportController.cs:line 93 at Octopus.Shared.Startup.AbstractCommand.Octopus.Shared.Startup.ICommand.Start(String[] commandLineArguments, ICommandRuntime commandRuntime, OptionSet commonOptions) in Y:\work\refs\heads\master\source\Octopus.Shared\Startup\AbstractCommand.cs:line 57 at Octopus.Shared.Startup.ConsoleHost.Run(Action
1 start, Action shutdown) in Y:\work\refs\heads\master\source\Octopus.Shared\Startup\ConsoleHost.cs:line 81
at Octopus.Shared.Startup.OctopusProgram.Run() in Y:\work\refs\heads\master\source\Octopus.Shared\Startup\OctopusProgram.cs:line 73