Import of data from 1.6 fails on error about non-unique machine name

qa-test-1 is not used by any active project configurations. It was used by one we deleted.

dev-sql-2 is a database server shared by a number of our environments (dev, qa etc.).

Done writing to server
The name of machine ‘qa-test-1’, (id = machines-193) is not unique; please rename the machine and create a new backup before running the import again.
The name of machine ‘dev-sql-2’, (id = machines-262) is not unique; please rename the machine and create a new backup before running the import again.
The name of machine ‘dev-sql-2’, (id = machines-97) is not unique; please rename the machine and create a new backup before running the import again.

A fatal exception occurred
System.Exception: One or more items require modification in the source Octopus database before the migration can proceed.
at Octopus.Server.Legacy.LegacyOctopusImporter.MakeSureEverythingIsReadyToBeMigrated() in c:\TeamCity\buildAgent\work\1116bd9da9e239fd\source\Octopus.Server\Legacy\LegacyOctopusImporter.cs:line 1058
at Octopus.Server.Legacy.LegacyOctopusImporter.ImportFromBackup(String ravenDbBackupFilePath, Nullable1 tentaclePort, String upnSuffix) in c:\TeamCity\buildAgent\work\1116bd9da9e239fd\source\Octopus.Server\Legacy\LegacyOctopusImporter.cs:line 90 at Octopus.Server.Commands.MigrateCommand.Start() in c:\TeamCity\buildAgent\work\1116bd9da9e239fd\source\Octopus.Server\Commands\MigrateCommand.cs:line 116 at Octopus.Shared.Startup.ConsoleHost.Run(Action1 start, Action shutdown) in c:\TeamCity\buildAgent\work\1116bd9da9e239fd\source\Octopus.Shared\Startup\ConsoleHost.cs:line 36

Error: The previous command returned a non-zero exit code of: 100
Error: The command that failed was: “D:\Program Files (x86)\Octopus 2.0\Server\Octopus.Server.exe” migrate --instance=“OctopusServer” --no-prompt --backup=“D:\Backups\octopus\20140113-110225.octobak” --tentacle-port=“10933”

I have a similar issue where I have duplicated entries in my database as well.

Hi,

In this instance the best thing to do is go to Octopus 1.6, find the machines, and just append a suffix like “-dupe1”, “-dupe2” to the affected machines.

Then, take a new backup of 1.6 and perform the import again.

In Octopus 2.0, a single machine can be mapped to multiple environments, so after migrating, delete the duplicates and map a single copy of the machine to all the environments it appears in. This can be done from the Environment > (Machine) settings page.

Hope this helps,
Nick

This really only affects the name that shows up in the Environments page right?

Well, as long as you use roles in any property assignments. That’s how we
set it up and no problems on the old 1.6 install after the change. If you
have properties assigned to machines, you probably would have to create a
role and use that instead.

The data did go in after that. We have now run into a problem with 2.0
unable to communicate with the tentacles. New discussion started on that.

Property assignment is that like a variable in the UI? That what you mean by property assignment?

Yes, variable. I crossed up the terminology with another system we use.
Sorry.

Ok now after doing the rename of the machines in my raven db and attempting another import I now get this error:


Finished writing all results to server

A fatal exception occurred
System.AggregateException: One or more errors occurred. —> System.Net.WebException: The request was aborted: The request was canceled.

Server stack trace:
at System.Net.HttpWebRequest.BeginGetResponse(AsyncCallback callback, Object state)
at System.Threading.Tasks.TaskFactory1.FromAsyncImpl(Func3 beginMethod, Func2 endFunction, Action1 endAction, Object state, TaskCreationOptions creationOptions)
at AsyncCompatLibExtensions.<>c__DisplayClass30.b__2f()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()

Exception rethrown at [0]:
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccess(Task task)
at Raven.Client.Connection.HttpJsonRequest.d__4b.MoveNext() in c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Connection\HttpJsonRequest.cs:line 933

Exception rethrown at [1]:
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Raven.Client.Document.RemoteBulkInsertOperation.d__18.MoveNext() in c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Document\RemoteBulkInsertOperation.cs:line 289

Exception rethrown at [2]:
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccess(Task task)
at Raven.Smuggler.SmugglerApi.d__6.MoveNext() in c:\Builds\RavenDB-Stable\Raven.Smuggler\SmugglerApi.cs:line 96
— End of inner exception stack trace —
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at Octopus.Server.Legacy.LegacyOctopusImporter.ImportTheRavenBackup(String ravenDbBackup) in c:\TeamCity\buildAgent\work\1116bd9da9e239fd\source\Octopus.Server\Legacy\LegacyOctopusImporter.cs:line 945
at Octopus.Server.Legacy.LegacyOctopusImporter.ImportFromBackup(String ravenDbBackupFilePath, Nullable1 tentaclePort) in c:\TeamCity\buildAgent\work\1116bd9da9e239fd\source\Octopus.Server\Legacy\LegacyOctopusImporter.cs:line 87 at Octopus.Server.Commands.MigrateCommand.Start() in c:\TeamCity\buildAgent\work\1116bd9da9e239fd\source\Octopus.Server\Commands\MigrateCommand.cs:line 87 at Octopus.Shared.Startup.ConsoleHost.Run(Action1 start, Action shutdown) in c:\TeamCity\buildAgent\work\1116bd9da9e239fd\source\Octopus.Shared\Startup\ConsoleHost.cs:line 36
—> (Inner Exception #0) System.Net.WebException: The request was aborted: The request was canceled.

Server stack trace:
at System.Net.HttpWebRequest.BeginGetResponse(AsyncCallback callback, Object state)
at System.Threading.Tasks.TaskFactory1.FromAsyncImpl(Func3 beginMethod, Func2 endFunction, Action1 endAction, Object state, TaskCreationOptions creationOptions)
at AsyncCompatLibExtensions.<>c__DisplayClass30.b__2f()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()

Exception rethrown at [0]:
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccess(Task task)
at Raven.Client.Connection.HttpJsonRequest.d__4b.MoveNext() in c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Connection\HttpJsonRequest.cs:line 933

Exception rethrown at [1]:
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Raven.Client.Document.RemoteBulkInsertOperation.d__18.MoveNext() in c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Document\RemoteBulkInsertOperation.cs:line 289

Exception rethrown at [2]:
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccess(Task task)
at Raven.Smuggler.SmugglerApi.d__6.MoveNext() in c:\Builds\RavenDB-Stable\Raven.Smuggler\SmugglerApi.cs:line 96<—


Error: The previous command returned a non-zero exit code of: 100
Error: The command that failed was: “D:\Program Files (x86)\Octopus 2.0\Server\Octopus.Server.exe” migrate --instance “OctopusServer” --no-prompt --backup “C:\20140114-102143.octobak” --tentacle-port “10934”

Hi Thom,

This looks like a timeout in the process that’s restoring the 1.6 backup.

It is happening at an earlier point than the previous duplicate machine warning will have been raised, so re-trying (perhaps with the server under as little load as possible) might get you past this while we try to find the timeout that needs to be increased.

Thanks,
Nick

Nick I’m on a machine that has absolutely no traffic. The only thing taking place is the import. I tried the same import twice with the same results.

Ah, no good then - the only other option might be to run it on a faster machine.

I’ve increased the per-request timeout from the default 30s to a staggering 1hr, so from the next build on this should be fixed.

Cheers,
Nick

Ok I doublechecked my version… Seems that I may have been on the earlier version from 2.0.9.1020 when I installed this version and re-ran the same backup the routine now operated properly.

Thom

Excellent, thanks for letting us know.

Nick

We’re getting a similar problem. The import script is complaining of duplicate names, and when we go into Raven and search for those names, there are no duplicates. I suffixed a ‘’ to the end of the affected hosts, and then three of the seven showed up in the UI with the '’ in their names, but four did not. After making that change, the next attempt to import fails with an error from “c:\TeamCity\buildAgent\work\1116bd9da9e239fd\source\Octopus.Server\Legacy\LegacyOctopusImporter.cs:line 87” saying that the step name ‘Start / install service’ contains invalid characters. I’m not sure where to even begin digging into that. Is that a TeamCity naming problem, or a Raven problem, or something in Octopus 2?

We’re trying to import from 1.6.3.1723 to 2.3.6.1385.

Hi Brian,

Thanks for reporting this. The quickest way to resolve this might be to do a screen sharing session. If you have Skype, you can add me (paulstovell) and I can walk you through it, otherwise let me know of an alternative screen sharing solution you’d like to use and a time that works for you.

Paul

I will be out of the office the 28th April to the 5th of May.

Hi Paul, I am trying to migrate from 1.6 to 2.0. I am getting below error when I try to import the 1.6 backup

The name of machine '**’, (id = machines-) is not unique; please rename the machine and create a new backup before running the import again.
Do you have any documents which tell us the steps to resolve this issue?

Thanks,
Sakthi

Hi Sakthi,

Thanks for getting in touch! Sorry you are having issues upgrading. We do not have any documents to help here but lets see if I can guide you on how to resolve this.
This may be caused by you having the same machine in multiple environments - thus named the same. In 2.0 you can have one machine in multiple environments with only 1 database entry now.
So to remedy:
You need to find any machines (tentacles) on your environments page with the name given in your error message. You need to rename any machines that have the same machine say add a -dup1 -dup2 etc to the end of the machine names for each.
Once you have found each of these instances of machine and renamed them, you will need to take another backup.
It is with this backup you will need to try your migration again.

Please let me know if you come across any further issues.
Vanessa

Thanks Vanessa. It works now.