Monday, June 22, 2020

ElasticSearch–Upgrade error - System.IO.IOException: Source and destination path must have identical roots.

When trying to update an ElasticSearch cluster through the Windows Installer(MSI) it always seemed to fail.

In the error logs I found the following message:

System.IO.IOException: Source and destination path must have identical roots. Move will not work across volumes.

   at System.IO.Directory.InternalMove(String sourceDirName, String destDirName, Boolean checkHost)

   at System.IO.Abstractions.DirectoryWrapper.Move(String sourceDirName, String destDirName)

   at Elastic.InstallerHosts.Elasticsearch.Tasks.Install.CreateDirectoriesTask.CreateConfigDirectory(FileSystemAccessRule rule)

   at Elastic.InstallerHosts.Elasticsearch.Tasks.Install.CreateDirectoriesTask.ExecuteTask()

   at Elastic.InstallerHosts.SessionExtensions.Handle(Session session, Func`1 action)

There is a problem with the installer when you are using different volumes for your ElasticSearch application and your ElasticSearch data(which I think is a good practice).  In that case the installer always fails as he tries to copy some files from one disk to another.

As a workaround(I tried multiple versions of the Windows installer but all got the same issue) I installed the ElasticSearch application on the data disk.