RedGate.Versioning.Automation.Shared.Errors.TerminatingException: Failed to clean database
Nandu
Posts: 2 New member
Hello,
We are trying to automate the process of creating a SQL Clone and deploy the database changes using SQL Chang Automation using Azure Pipelines.
We are able to create the SQL Clone successfully, however we are facing issue when the SQL project is build as part of the SQL Change Automation.
From the logs we can see that the latest version of SQL Change Automation is pulled whenever available.
New-DatabaseConnection, SQL Change Automation 4.6.23115.1242, Copyright © Red Gate Software Ltd 2014-2023
We are getting the error "RedGate.Versioning.Automation.Shared.Errors.TerminatingException: Failed to clean database" when the .sql proj file is being built.
We are not sure what the error "An error occurred while trying to initialize the authenticated on current request properties" mean. We tried with Windows Authentication and well as SQL Authentication and were able to confirm from the logs that the correct user was used as part of the connection string.
I saw a similar question on the forum and the resolution to that was to set correct permissions (https://forum.red-gate.com/discussion/86145/redgate-versioning-automation-shared-errors-terminatingexception-failed-to-clean-the-database). Can you please let me know what those permissions have to be?
Also, we keep repeatedly get the Failed to load any version of "RedGate.SqlClone.Server.Domain" assembly. We are not sure if this is the cause of the error. How do we get this assembly to load so that the error/warnings go away.
We are not sure what the error "An error occurred while trying to initialize the authenticated on current request properties" mean. We tried with Windows Authentication and well as SQL Authentication and were able to confirm from the logs that the correct user was used as part of the connection string.
I saw a similar question on the forum and the resolution to that was to set correct permissions (https://forum.red-gate.com/discussion/86145/redgate-versioning-automation-shared-errors-terminatingexception-failed-to-clean-the-database). Can you please let me know what those permissions have to be?
Also, we keep repeatedly get the Failed to load any version of "RedGate.SqlClone.Server.Domain" assembly. We are not sure if this is the cause of the error. How do we get this assembly to load so that the error/warnings go away.
Tagged:
Answers
The account running the SQL Change Automation requires db_owner permissions to the shadow database for it to be cleaned.
Many Thanks
Eddie
Senior Product Support Engineer
Redgate Software Ltd
Email: support@red-gate.com
Thank you for the quick response.
The Service Account that I am using has sysadmin access on the database for the time being until we sort out the permission issue.
I am still facing the same issue.
Also, when I run this step in Azure, there is no Shadow database created at this stage. Am I missing something?
Do you know if we have any documentation around setting up SQL Change Automation using Azure DevOps, please?
I've just reached out to you directly via a support ticket regarding this issue!
We have the following documentation related to Azure DevOps with SQL Change Automation: https://documentation.red-gate.com/sca/deploying-database-changes/add-ons/azure-devops
Kind regards
Dan Calver | Redgate Software
Have you visited our Help Center?