CI/CD Release


(Amrendra Prasad) #1

HI,
I am facing an issue during DI/CD deployment. Actually i am using Synonyms in my DB projects for Cross referencing. DB projects is running fine and deployment is also running using DB project menu. But when we are using same code using octopus CI/CD deployment then it showing some error message. but when we removed the reference of Synonyms from db projects then CI/CD deployment is running perfectly. Any one suggest to me how we will fix the issue.

Exception : System.Management.Automation.MethodInvocationException: Exception calling “Deploy” with “4”
argument(s): “An error occurred during deployment plan generation. Deployment cannot continue.”
—> Microsoft.SqlServer.Dac.DacServicesException: An error occurred during deployment plan
generation. Deployment cannot continue. —>
Microsoft.Data.Tools.Schema.Sql.Deployment.DeploymentFailedException: The Element or Annotation
class PersistedResolvableAnnotation does not contain the Property class Length. —>
Microsoft.Data.Tools.Schema.SchemaModel.ModelSerializationException: The Element or Annotation
class PersistedResolvableAnnotation does not contain the Property class Length.
at Microsoft.Data.Tools.Schema.SchemaModel.DataSchemaModel.ModelStoreDeserializerState.ReadPrope
rty(IModelPropertyContainer propertyContainer, ModelPropertyContainerClass propertyContainerClass,
String propertyContainerClassName)
at Microsoft.Data.Tools.Schema.SchemaModel.DataSchemaModel.AnnotationState.ProcessStartElement()
at Microsoft.Data.Tools.Schema.SchemaModel.XmlDeserializerEngine.ReadData(DeserializerState
initialState, Boolean keepCurrentReaderPosition)
at Microsoft.Data.Tools.Schema.SchemaModel.DataSchemaModel.DeserializeXml(TextReader input,
ErrorManager errors, String source, Action3 constructorParametersSetter) at Microsoft.Data.Tools.Schema.SchemaModel.DataSchemaModel.DeserializePackage(SqlPackage package, ErrorManager errors, Action3 constructorParametersSetter)
at
Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeploymentEndpointPackage.LoadModel(ErrorManager
errors)
— End of inner exception stack trace —
at
Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeploymentEndpointPackage.LoadModel(ErrorManager
errors)
at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeploymentEndpointPackage.OnLoad(ErrorManager
errors, DeploymentEngineContext context)
at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeployment.PrepareModels()
at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeployment.InitializePlanGeneratator()
at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeployment.CreateController(Action1 msgHandler) at Microsoft.SqlServer.Dac.DacServices.CreateController(SqlDeployment deploymentEngine, ErrorManager errorManager) --- End of inner exception stack trace --- at Microsoft.SqlServer.Dac.DacServices.CreateController(SqlDeployment deploymentEngine, ErrorManager errorManager) at Microsoft.SqlServer.Dac.DeployOperation.<>c__DisplayClass3.<>c__DisplayClass5.<CreatePlanInit ializationOperation>b__1() at Microsoft.Data.Tools.Schema.Sql.Dac.OperationLogger.Capture(Action action) at Microsoft.SqlServer.Dac.DeployOperation.<>c__DisplayClass3.<CreatePlanInitializationOperation >b__0(Object operation, CancellationToken token) at Microsoft.SqlServer.Dac.Operation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context) at Microsoft.SqlServer.Dac.ReportMessageOperation.Microsoft.SqlServer.Dac.IOperation.Run(Operati onContext context) at Microsoft.SqlServer.Dac.OperationExtension.CompositeOperation.Microsoft.SqlServer.Dac.IOperat ion.Run(OperationContext context) at Microsoft.SqlServer.Dac.OperationExtension.CompositeOperation.Microsoft.SqlServer.Dac.IOperat ion.Run(OperationContext context) at Microsoft.SqlServer.Dac.DeployOperation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context) at Microsoft.SqlServer.Dac.OperationExtension.Execute(IOperation operation, DacLoggingContext loggingContext, CancellationToken cancellationToken) at Microsoft.SqlServer.Dac.DacServices.InternalDeploy(IPackageSource packageSource, Boolean isDacpac, String targetDatabaseName, DacDeployOptions options, CancellationToken cancellationToken, DacLoggingContext loggingContext) at Microsoft.SqlServer.Dac.DacServices.Deploy(DacPackage package, String targetDatabaseName, Boolean upgradeExisting, DacDeployOptions options, Nullable1 cancellationToken)
at CallSite.Target(Closure , CallSite , Object , Object , Object , Boolean , Object )
— End of inner exception stack trace —
at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext
funcContext, Exception exception)
at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)
at
System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame
frame)
at
System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame
frame)
TargetObject :
CategoryInfo : NotSpecified: (:slight_smile: [], MethodInvocationException
FullyQualifiedErrorId : DacServicesException
ErrorDetails :
InvocationInfo : System.Management.Automation.InvocationInfo
ScriptStackTrace : at , C:\Deploy.ps1: line 79
PipelineIterationInfo : {}
PSMessageDetails :


(Cameron MacFarland) #2

Hi,

Thanks for contacting us. I’m not too sure what tools your talking about. When you say DB project is that the project in your Octopus server? Could you export the steps for the project and send them to me? From the process page there is a Download as JSON option.

Thanks
Cameron


(Amrendra Prasad) #3

Thanks for reply

Actually I am using Microsoft SQL DB project to maintain the dacpac details.
But i am using octopus for code deployment on server. My problem is when we creates the Synonyms in DB projects then Octopus showing Error message . if when we remove the Synonyms from solution file then octopus running fine. So Issue is in Synonyms so please suggest to me how can use synonyms in octopus deployment.

System.UnauthorizedAccessException: File
…\Deploy.ps1 cannot be
loaded because running scripts is disabled on this system. For more information, see
about_Execution_Policies at http://go.microsoft.com/fwlink/?LinkID=135170.
TargetSite : Void ShouldRunInternal(System.Management.Automation.CommandInfo,
System.Management.Automation.CommandOrigin, System.Management.Automation.Host.PSHost)
HelpLink :
Source : System.Management.Automation
HResult : -2146233087


(Cameron MacFarland) #4

Hi,

It doesn’t look like the problem has anything to do with synonyms. That error is reporting that the script won’t run because the powershell execution policies won’t allow it.

What happens if you try to run the script directly on a tentacle?

Thanks


(Amrendra Prasad) #5

Hi
When we run directly then it is working fine. But problem is that when when we add the references of another database in a scripts then it is showing error message. so please advise me how we can handle the linked server concepts in octopus.