Red Gate forums :: View topic - Error on Dynamic Database Upgrade
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
Deployment Manager
Deployment Manager forum

Error on Dynamic Database Upgrade

Search in Deployment Manager forum
Post new topic   Reply to topic
Jump to:  
Author Message
shanejokeeffe



Joined: 12 Dec 2013
Posts: 11

PostPosted: Thu Jan 23, 2014 6:42 pm    Post subject: Error on Dynamic Database Upgrade Reply with quote

Hi,

I'm getting the following error when performing a deployment of a database package for the first time:

Code:

2014-01-23 17:21:35 +00:00 INFO   The last deployment details were not found in the target database. Static upgrade is not available
2014-01-23 17:21:35 +00:00 INFO   Upgrade script not available; performing dynamic database upgrade
2014-01-23 17:21:35 +00:00 INFO   Loading source database from db\state
2014-01-23 17:21:35 +00:00 INFO    - Using SOC filter file at db\state\Filter.scpf
2014-01-23 17:21:35 +00:00 INFO    - Using default Compare options
2014-01-23 17:21:35 +00:00 INFO    - Loading as case-insensitive (based on target database)
2014-01-23 17:21:35 +00:00 INFO   Registering target database
2014-01-23 17:21:38 +00:00 INFO   Registering scripts folder
2014-01-23 17:21:39 +00:00 ERROR  Error while executing job: Dynamic deployment failed
2014-01-23 17:21:39 +00:00 ERROR  A duplicate definition was found for the stored procedure [dbo].[<ProcedureName>]. Ensure that case sensitivity options are set correctly and all object creation scripts are valid. If the problem persists, contact our support.


If I re-run the deployment, I get a different object name each time. The database I'm deploying to is marked as collation insensitive (CI) and accent sensitive (AS).

Any thoughts on how I can resolve this?

Thanks in advance.

Shane O'Keeffe
Back to top
View user's profile Send private message
shanejokeeffe



Joined: 12 Dec 2013
Posts: 11

PostPosted: Thu Jan 23, 2014 6:50 pm    Post subject: Reply with quote

Some additional info that might be relevant:

- The target database already contains objects and is in fact already in sync with the source database that I have checked in to TFS

- I'm running the latest version of Deployment Manager (v2.3.20.2)

- When I run SQL Compare GUI version it finds no differences in the databases

Regards,

Shane.
Back to top
View user's profile Send private message
james.billings



Joined: 16 Jun 2010
Posts: 1119
Location: My desk.

PostPosted: Fri Jan 24, 2014 9:44 am    Post subject: Reply with quote

How did you create the package? Usually, this error occurs when there's more than one create statement for the object mentioned in the error (perhaps through a duplicate file)
If you look in the nuget package using Winzip / Nuget explorer, are there multiple sets of scripts?
Back to top
View user's profile Send private message
shanejokeeffe



Joined: 12 Dec 2013
Posts: 11

PostPosted: Fri Jan 24, 2014 10:54 am    Post subject: Reply with quote

The package was create as part of a TeamCity build using the TeamCity plugin.

When I look in the package file, there are two sets of scripts: one in the \db\state folder and one in the \db\state\Database folder. There is definitely only one set of scripts in TFS.
Back to top
View user's profile Send private message
james.billings



Joined: 16 Jun 2010
Posts: 1119
Location: My desk.

PostPosted: Fri Jan 24, 2014 10:59 am    Post subject: Reply with quote

Hmm, that may be relevant- in my packages the files all live under "State" directly, with no 'database' subfolder.
Can you post a screenshot of your repo folder structure, and also let us know how the VCS root is set up for the TeamCity build (i.e. where in the folder structure the build-step is referring to)
Back to top
View user's profile Send private message
shanejokeeffe



Joined: 12 Dec 2013
Posts: 11

PostPosted: Fri Jan 24, 2014 11:08 am    Post subject: Reply with quote



VCS Root is $/<ProjectName>/Development/Database

Under the plugin, I've set the "Database folder is a subfolder of my build VCS root [?]" option to be "Database"
Back to top
View user's profile Send private message
james.billings



Joined: 16 Jun 2010
Posts: 1119
Location: My desk.

PostPosted: Fri Jan 24, 2014 11:19 am    Post subject: Reply with quote

Do all your packages exhibit the same duplicate files? It's a little strange as everything looks correct from what I can tell.

One suggestion would be to create a new VCS root that goes right down to the second database folder, and then leave the plugin setting at VCS root. This will tell us if there's some weird bug in the plugin where the two folders with the same name cause trouble.
Back to top
View user's profile Send private message
shanejokeeffe



Joined: 12 Dec 2013
Posts: 11

PostPosted: Fri Jan 24, 2014 11:54 am    Post subject: Reply with quote

James, I think I've cracked the issue and it's on our configuration side.

My build configuration had seperate VCS roots for my database and applications but there are both technically under the same project. The database scripts were being checked out as part of both VCS roots and ending up in different folders so hence the duplicate set of files.

I've simplified the VCS root to be a single location pointing to $/<projectname> and set the plugin to use Database/Database as it's location and I think I'm back on track.

I had to manually delete the previously created packages from the NuGet feed as they contained duplicate script files and the build process started failing at the SQL Compare stage but I think it's all ok now!

Thanks for help!
Back to top
View user's profile Send private message
james.billings



Joined: 16 Jun 2010
Posts: 1119
Location: My desk.

PostPosted: Fri Jan 24, 2014 11:55 am    Post subject: Reply with quote

Ah, that sounds like it. Nice find!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group