Create Clone failed

giumaREgiumaRE Posts: 15 New member
Hi,

I'm receiving the error when I create the clone, but the clone not exist in the target SQL Server instance:

022-05-12 16:44:23.604 +02:00 [ERR] CreateCloneRequestEvent (clone name: "Rete") Operation 25417 failed with exception (CloneDatabaseNameAlreadyExists)
RedGate.SqlClone.Agent.Api.CloneDatabaseNameAlreadyExistsException: The name 'Rete' cannot be used to create a clone as a database with this name already exists in the target SQL Server instance. (CloneDatabaseNameAlreadyExistsException)
   at RedGate.SqlClone.Agent.Core.Sql.SqlCloneAttacher.AttachDb(String mountPath)
   at RedGate.SqlClone.Agent.Core.Sql.SqlCloner.CreateClone(String imageFile, CloneDirectoryPath cloneDirectoryPath, IProgress`1 cloneProgressReporter, CancellationToken cancellationToken)
   at RedGate.SqlClone.Agent.Core.Sql.SqlCloner.CreateClone(String imageFile, CloneDirectoryPath cloneDirectoryPath, IProgress`1 cloneProgressReporter, CancellationToken cancellationToken)
   at RedGate.SqlClone.Agent.Drivers.Vhd.SqlServerCloneFromVhdImageCreationDriver.CreateClone(String cloneName, IImageStorageDriver imageStorageDriver, Storage imageStorage, SqlServerInstanceLocationExpanded destinationLocation, IStorageDriver cloneStorageDriver, String cloneStorageResourceName, ModificationScriptCollectionWithVariables modificationScriptsWithVariables, IProgress`1 cloneProgressReporter, CancellationToken ct)
   at RedGate.SqlClone.Agent.AgentCloneService.CreateClone(CloneExpanded clone, CreateCloneContext context, CancellationToken ct)
   at RedGate.SqlClone.Agent.AgentCloneService.CreateClone(CloneExpanded clone, CreateCloneContext context, CancellationToken ct)
   at RedGate.SqlClone.Agent.OperationContext.OperationLifetimeManager.Run(Id`1 operationId, UsageInfo usageInfo, Func`2 action, AgentEvent agentEvent)

Is there a way to solve the error ?

Thanks a lot

Answers

  • TheMaskedDataTheMaskedData Posts: 53 Bronze 3
    Hey @giumaRE - quick question just to check, maybe a clone with that name doesn't already exist on that instance, but is there an already existing DB on that instance with the same name? Or any possibility of something similar?
    Thanks!
  • giumaREgiumaRE Posts: 15 New member
    Hi,
    No, nothing like that.
    There are only five clones:
    Marketing
    ScrignoV2
    Creditcheck
    DWH
    ChargeBack 

    I also checked querying sys.sysdatabases 
  • TheMaskedDataTheMaskedData Posts: 53 Bronze 3
    Interesting - so no clone (or non clone) DB doesn't exist on that Instance with the same name... is there a chance that there are some orphaned LDF/MDF files on the instance from a previous clone of the same name? Maybe one that was created before but not properly cleaned up?
  • giumaREgiumaRE Posts: 15 New member
    nothing, no file
  • giumaREgiumaRE Posts: 15 New member
    Is it possible there are some dirty data left in the SQLClone_Config database?
  • TheMaskedDataTheMaskedData Posts: 53 Bronze 3
    Are you able to attach the logs? I'm curious as to if this is a SQL Clone error or a SQL Server error - it could be the SQL Clone config DB, but I've only ever seen this come up as a SQL Server error.

    Does it show the Clone DB with that name having been deleted from the Clones table in the config db?
  • giumaREgiumaRE Posts: 15 New member
    Please find attached the log file and a csv with the contents of the table Clones filtered for "Rete" DB
  • TheMaskedDataTheMaskedData Posts: 53 Bronze 3
    Hmmm I'm not entirely sure what is causing the issue from the logs, it doesn't say exactly other than there is already a DB with that name on machine "SQLPROVV-TEST"...
    I would say you've got a couple of options - 1) you can raise a ticket with red gate support and see if they can help, or 2) you and I can take a look if you're happy to screen share - if you ping me a message on twitter @plantbasedsql or with your email and you're happy to speak at 12pm BST or 5pm BST then I can ping you a google meet invite

    Noting, of course, that 2) could invariably lead to 1) as I don't work for Redgate, but am a "Friend of RG" :wink:

    Entirely up to you!

  • giumaREgiumaRE Posts: 15 New member
    I'll open a ticket to Redgate and I'll keep you posted
    Many thanks for your help
Sign In or Register to comment.