Long file names when exporting data


(adrianweetman) #1

Hi there,

We perform a nightly export of Octopus content using the Octopus.Migrator tool.
We hit an issue this week where the file path of one (of the many) items it creates on disk failed because the filepath was over 260 characters.

Specificially, the file path was
C:\windows\temp\20180611\Projects\UK_CYGNET_PPPSPostilionHostImport_QueueSetup\UK_CYGNET_PPPSPostilionHostImport_QueueSetup - MSMQ - Create Transactional Queues if not present - MSMQ - Create Transactional Queues if not present - Script.ps1.meta

Error message from the Migrator tool was:
System.IO.DirectoryNotFoundException: Could not find a part of the path ‘C:\windows\temp\20180611\Projects\UK_CYGNET_PayPoint.Utilities.MessageRouter_QueueSetup\UK_CYGNET_PayPoint.Utilities.MessageRouter_QueueSetup - MSMQ - Create Transactional Queues if not present - MSMQ - Create Transactional Queues if not present - Script.ps1.meta’.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
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)
at System.IO.FileStream…ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
at Octopus.Shared.Util.OctopusPhysicalFileSystem.Replace(String oldFilePath, Stream newStream, Int32 overwriteFileRetryAttempts)
at Octopus.Migrator.ExportProcess.ExportWriter.WriteAnyObjectToFile(String directory, String filename, IId obj)
at Octopus.Migrator.ExportProcess.ExportWriter.WriteFile(String directory, String filename, IId obj)
at Octopus.Migrator.ExportProcess.ExportController.WriteScriptMetadata(String directory, String filename, ScriptMetadata metadata)
Created C:\windows\temp\20180611\Channels\UK_CYGNET_PayPoint.Utilities.MessageRouter_QueueSetup\Default.json
Created C:\windows\temp\20180611\Projects\UK_CYGNET_PayPoint.Utilities.MessageRouter106_QueueSetup\UK_CYGNET_PayPoint.Utilities.MessageRouter106_QueueSetup.json
Created C:\windows\temp\20180611\Projects\UK_CYGNET_PayPoint.Utilities.MessageRouter106_QueueSetup\UK_CYGNET_PayPoint.Utilities.MessageRouter106_QueueSetup-VariableSet.json
Created C:\windows\temp\20180611\Projects\UK_CYGNET_PayPoint.Utilities.MessageRouter106_QueueSetup\UK_CYGNET_PayPoint.Utilities.MessageRouter106_QueueSetup-DeploymentProcess.json
Reader took 211150ms (12ms until the first record) in transaction ‘’: SELECT *
FROM dbo.[Project]

This was related

  • to a project with name: UK_CYGNET_PayPoint.Utilities.MessageRouter_QueueSetup
  • to a step with name: MSMQ - Cr​eate Transactional Queues if not present

Note that the step consumes a step template.

I guess I’ve a couple of questions related to the long file path:

  • Why is the project step name repeated in the file path (is it something to do with the fact that the step uses a step template)?
  • Is there anything we can do about these long names other than ensure we use short(ish) projects and step names?