Cannot install agent on a VM I copied in VMWare Workstation

Step to reproduce :
1. Clean the VM e.g. 
  - Uninstall & Unregisted SQL Clone agent
  -  Change VM name
  - Shutdown the VM

2. We clone of the VM in VMWare Wks (right click VM > Manage > Clone)
3. Start and rename the VM
4. The installation of the agent stall. The service installs but does not start.
5. We try starting it manually but the start up stalls

We made sure the networking is OK. 
It works well with an original Windows (not cloned)
No log on the server.

Here the installation log on the agent machine 
2018-09-06 16:02:28Z | SQL Clone agent installer bootstrap version 2.7.3.11463
2018-09-06 16:02:28Z | Status update: 
2018-09-06 16:02:29Z | Status update: Preparing...
2018-09-06 16:02:30Z | Status update: Installing SQL Clone Agent... 

Nothing else ...
Tagged:

Answers

  • Is the VM on a domain?
    Software developer
    Redgate Software
  • I assume by "Unregistered the SQL Clone agent" you mean running the Remove-SqlCloneMachine cmdlet?
    I have run the steps you gave, starting with a non-domain clean install of Windows 7, and did not have a problem installing an agent on the clone. That said, if I ran the original machine from a snapshot before I removed the clone that didn't work; SQL Clone got confused as to which machine was which.
    If you're going to clone a VM that previously had a SQL Clone agent running on it, I would recommend removing the agent certificate and the agent settings.json file as well as uninstalling the agent before cloning:
    • Open the Windows Certificates snap-in (Run mmc.exe, go to File -> Add/Remove Snap-in, choose Certificates on the left, click Add, choose Computer account, click Next, click Finish, click OK)
    • Go to Certificates (Local Computer) -> Personal -> Certificates, and delete the SQL Clone Agent certificate
    • Remove the "settings.json" file under "%allusersprofile%\Red Gate\SQL Clone Agent" folder
    If the snapshot you clone from has no agent installed, no agent certificate, and no settings.json, you should be able to clone as many times as you like and install agents on the clones.
    Software developer
    Redgate Software
  • BenethorBenethor Posts: 22 Bronze 1
    We will test and get back to you. Thank you
  • Unfortunatly it does not work. The following log was supplied to me by the team member having the problem : 

    2018-09-10 11:22:41.062 -04:00 [Warning] Error isn't known to be transient, not retrying
    System.Threading.Tasks.TaskCanceledException: A task was canceled.
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at RedGate.SqlClone.Agent.ManagementServiceClient.JsonHttpClient.<Post>d__5`1.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at RedGate.SqlClone.Agent.ManagementServiceClient.RetryBackoffJsonClient.<>c__DisplayClass9_0.<<QueueRequest>b__0>d.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at RedGate.SqlClone.Common.ActionRunner.<RetryAndBackoff>d__5`1.MoveNext()
    2018-09-10 11:22:41.102 -04:00 [Information] SQL Clone agent version 2.7.3.11463 starting
    2018-09-10 11:22:41.112 -04:00 [Information] Running as STEPHANO\Administrator on Stephano.dev.uni
    2018-09-10 11:22:41.152 -04:00 [Information] SQL Clone agent version 2.7.3.11463 shutting down
    2018-09-10 11:22:41.265 -04:00 [Error] UNHANDLED EXCEPTION
    System.InvalidOperationException: Cannot open log for source 'SqlCloneAgent_2.7.3.11463'. You may not have write access. ---> System.ComponentModel.Win32Exception: The RPC server is unavailable
       --- End of inner exception stack trace ---
       at System.Diagnostics.EventLogInternal.OpenForWrite(String currentMachineName)
       at System.Diagnostics.EventLogInternal.InternalWriteEvent(UInt32 eventID, UInt16 category, EventLogEntryType type, String[] strings, Byte[] rawData, String currentMachineName)
       at System.Diagnostics.EventLogInternal.WriteEntry(String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData)
       at System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType type)
       at RedGate.SqlClone.Common.EventLogExtensions.DoAndRecordErrors(EventLog eventLog, Action action)
    2018-09-10 11:50:42.827 -04:00 [Warning] Error isn't known to be transient, not retrying
    System.Threading.Tasks.TaskCanceledException: A task was canceled.
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at RedGate.SqlClone.Agent.ManagementServiceClient.JsonHttpClient.<Post>d__5`1.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at RedGate.SqlClone.Agent.ManagementServiceClient.RetryBackoffJsonClient.<>c__DisplayClass9_0.<<QueueRequest>b__0>d.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at RedGate.SqlClone.Common.ActionRunner.<RetryAndBackoff>d__5`1.MoveNext()
    2018-09-10 11:50:42.855 -04:00 [Information] SQL Clone agent version 2.7.3.11463 starting
    2018-09-10 11:50:42.859 -04:00 [Information] Running as STEPHANO\Administrator on Stephano.dev.uni
    2018-09-10 11:50:42.869 -04:00 [Information] Found 0 old agent(s).
    2018-09-10 13:14:15.202 -04:00 [Warning] Error isn't known to be transient, not retrying
    System.Threading.Tasks.TaskCanceledException: A task was canceled.
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at RedGate.SqlClone.Agent.ManagementServiceClient.JsonHttpClient.<Post>d__5`1.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at RedGate.SqlClone.Agent.ManagementServiceClient.RetryBackoffJsonClient.<>c__DisplayClass9_0.<<QueueRequest>b__0>d.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at RedGate.SqlClone.Common.ActionRunner.<RetryAndBackoff>d__5`1.MoveNext()
    2018-09-10 13:14:15.225 -04:00 [Information] SQL Clone agent version 2.7.3.11463 starting
    2018-09-10 13:14:15.229 -04:00 [Information] Running as STEPHANO\Administrator on Stephano.dev.uni
    2018-09-10 13:14:15.239 -04:00 [Information] Found 0 old agent(s).

  • Unfortunatly it does not work. The following log was supplied to me by the team member having the problem : 

    2018-09-10 11:22:41.062 -04:00 [Warning] Error isn't known to be transient, not retrying
    System.Threading.Tasks.TaskCanceledException: A task was canceled.
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at RedGate.SqlClone.Agent.ManagementServiceClient.JsonHttpClient.<Post>d__5`1.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at RedGate.SqlClone.Agent.ManagementServiceClient.RetryBackoffJsonClient.<>c__DisplayClass9_0.<<QueueRequest>b__0>d.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at RedGate.SqlClone.Common.ActionRunner.<RetryAndBackoff>d__5`1.MoveNext()
    2018-09-10 11:22:41.102 -04:00 [Information] SQL Clone agent version 2.7.3.11463 starting
    2018-09-10 11:22:41.112 -04:00 [Information] Running as STEPHANO\Administrator on Stephano.dev.uni
    2018-09-10 11:22:41.152 -04:00 [Information] SQL Clone agent version 2.7.3.11463 shutting down
    2018-09-10 11:22:41.265 -04:00 [Error] UNHANDLED EXCEPTION
    System.InvalidOperationException: Cannot open log for source 'SqlCloneAgent_2.7.3.11463'. You may not have write access. ---> System.ComponentModel.Win32Exception: The RPC server is unavailable
       --- End of inner exception stack trace ---
       at System.Diagnostics.EventLogInternal.OpenForWrite(String currentMachineName)
       at System.Diagnostics.EventLogInternal.InternalWriteEvent(UInt32 eventID, UInt16 category, EventLogEntryType type, String[] strings, Byte[] rawData, String currentMachineName)
       at System.Diagnostics.EventLogInternal.WriteEntry(String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData)
       at System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType type)
       at RedGate.SqlClone.Common.EventLogExtensions.DoAndRecordErrors(EventLog eventLog, Action action)
    2018-09-10 11:50:42.827 -04:00 [Warning] Error isn't known to be transient, not retrying
    System.Threading.Tasks.TaskCanceledException: A task was canceled.
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at RedGate.SqlClone.Agent.ManagementServiceClient.JsonHttpClient.<Post>d__5`1.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at RedGate.SqlClone.Agent.ManagementServiceClient.RetryBackoffJsonClient.<>c__DisplayClass9_0.<<QueueRequest>b__0>d.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at RedGate.SqlClone.Common.ActionRunner.<RetryAndBackoff>d__5`1.MoveNext()
    2018-09-10 11:50:42.855 -04:00 [Information] SQL Clone agent version 2.7.3.11463 starting
    2018-09-10 11:50:42.859 -04:00 [Information] Running as STEPHANO\Administrator on Stephano.dev.uni
    2018-09-10 11:50:42.869 -04:00 [Information] Found 0 old agent(s).
    2018-09-10 13:14:15.202 -04:00 [Warning] Error isn't known to be transient, not retrying
    System.Threading.Tasks.TaskCanceledException: A task was canceled.
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at RedGate.SqlClone.Agent.ManagementServiceClient.JsonHttpClient.<Post>d__5`1.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at RedGate.SqlClone.Agent.ManagementServiceClient.RetryBackoffJsonClient.<>c__DisplayClass9_0.<<QueueRequest>b__0>d.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at RedGate.SqlClone.Common.ActionRunner.<RetryAndBackoff>d__5`1.MoveNext()
    2018-09-10 13:14:15.225 -04:00 [Information] SQL Clone agent version 2.7.3.11463 starting
    2018-09-10 13:14:15.229 -04:00 [Information] Running as STEPHANO\Administrator on Stephano.dev.uni
    2018-09-10 13:14:15.239 -04:00 [Information] Found 0 old agent(s).

  • Hmm, unfortunately those stack traces don't actually say what the agent was trying to do when it failed :( Is that the entire log file?
    Software developer
    Redgate Software
Sign In or Register to comment.