Database Deployment - An error occurred during deployment plan generation. Deployment cannot continue
Hi,
I wondered if someone could perhaps help save my sanity by telling me what I'm missing here. The background first.
We have 5 database projects in TC, each with a build step and then a deploy step. 4 out of these 5 projects build and deploy perfectly.
The 5th however build ok but then raises the following error during deployment to the its SQL Server;
"*** An error occurred during deployment plan generation. Deployment cannot continue."
The Element or Annotation class PersistedResolvableAnnotation does not contain the Property class Length.
[08:32:52][Exec] C:\TeamCity\BuildAgent3\work\c3c1bdeecddf68ca\.Build\dbdeploy_single.proj(9, 5): error MSB3073: The command ""C:\Program Files (x86)\Microsoft SQL Server\120\DAC\Bin\sqlpackage.exe" /Action:Publish /sf:"../DB-ExampleData/ExampleData/bin/Release/ExampleData.dacpac" /pr:"../DB-ExampleData/ExampleData/UAT.publish.xml" /TargetServerName:IP.IP.IP.111" exited with code 1.
During my investigation I compared the UAT.publish.xml to one that works and they seem identical. I've tried Windows Authentication and SQL Authentication and that makes no difference either. The publish file works fine when run from within Visual Studio as well.
I've checked the deploy settings between the projects that work and this one and the only difference I can see is in the database name which is expected.
Has anyone got any ideas on what this may be caused by and how I can resolve it. I have logs and screenshots if needed.
Thanks for taking the time to read this.
Nic
Please sign in to leave a comment.
The issue appears to be with sqlpackage when called for the dacpac it gives the error regardless of publish file.
Other deployments done directly with sqlpackage are successful.
I've no idea how to resolve it so I'm going to try and ensure its the latest version (if I can find the download link).
Hello,
As far as deployment is performed successfully for some build configurations and fails for others, it looks like environment issue and not the issue on TeamCity side.
What build runner do you use? Could you please try to run the same build via command line on the agent machine as noted in the guidelines? Does it run successfully? If the build succeeds from the console but still fails in TeamCity, please use a command line runner in TeamCity to launch the same command as in the console. If it still behaves differently in TeamCity, most probably this is an environment or a tool issue.
If the command line runner works but the dedicated runner does not while the options are all the same, please create a new issue in our tracker detailing the case. Please attach all the build step settings, the build log, all agent logs covering the build, the command you used in the console to run the build and the full console output of the build.
Hi,
Hi,
I'm using sqlpackage to deploy the dacpac built in the step before and if I run sqlpackage from the cmd line I get the same error, so the issue is with sqlpackage.
I've done a bit of playing around and the database project contains some SQL synonyms, if I exclude these from the build then everything seems to work fine.
The other databases don't have the synonyms which is why they work.
The question is why sqlpackage has this issue? but you are correct its not a TeamCity as such. I'm going to update our sqlpackage to the latest version and try that on a development server where I can replicate the issue. If that works then I'll update it on the production server.
Thanks for the response.
Nic