Trailing spaces in step template names permanently break the Export feature

If you accidentally have a trailing space in a template step that you add, it will appear to work fine within the OD site, but the “Export data” feature breaks with

Reader took 4041ms (0ms until the first record) in transaction '<unknown>': SELECT *
FROM dbo.[ActionTemplateVersion]
ORDER BY [Id]
Error: ===============================================================================
Error: Could not find a part of the path 'C:\Backups\June2018c\ActionTemplateVersions\Initialization Check - Custom Website \11.json'.
Error: System.IO.DirectoryNotFoundException
Error:    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
Error:    at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
Error:    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
Error:    at Octopus.Shared.Util.OctopusPhysicalFileSystem.Replace(String oldFilePath, Stream newStream, Int32 overwriteFileRetryAttempts)
Error:    at Octopus.Migrator.ExportProcess.ExportWriter.WriteAnyObjectToFile(String directory, String filename, IId obj)
Error:    at Octopus.Migrator.ExportProcess.ExportWriter.WriteFile(String directory, String filename, IId obj)
Error:    at Octopus.Migrator.ExportProcess.ExportController.WriteActionTemplateVersions(IEnumerable`1 actionTemplateVersions)
Error:    at Octopus.Migrator.ExportProcess.ExportController.Export()
Error:    at Octopus.Shared.Startup.AbstractCommand.Start(String[] commandLineArguments, ICommandRuntime commandRuntime, OptionSet commonOptions)
Error:    at Octopus.Shared.Startup.ConsoleHost.Run(Action`1 start, Action shutdown)
Error:    at Octopus.Shared.Startup.OctopusProgram.Run()
Error: ------------------------------------------------------

Renaming the step doesn’t fix the export process.

My workaround: Manually update the Name in the ActionTemplateVersion table

Hi Chris, sorry for the slow response.

I have managed to reproduce the issue and have created a github isse which you can use to track the progress.

We apologize for any inconvenience this may have caused.

Regards,
Shaun Marx

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