Error on Dynamic Database Upgrade

Automated deployment for web applications and databases

Moderators: Mike Upton, justin.caldicott, Sean.newham, csmith, chirayu, DavidSimner, david.conlin

Error on Dynamic Database Upgrade

Postby shanejokeeffe » Thu Jan 23, 2014 6:42 pm

Hi,

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

Code: Select all
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
shanejokeeffe
 
Posts: 14
Joined: Thu Dec 12, 2013 8:05 pm

Postby shanejokeeffe » Thu Jan 23, 2014 6:50 pm

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.
shanejokeeffe
 
Posts: 14
Joined: Thu Dec 12, 2013 8:05 pm

Postby james.billings » Fri Jan 24, 2014 9:44 am

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?
james.billings
 
Posts: 1144
Joined: Wed Jun 16, 2010 11:10 am
Location: My desk.

Postby shanejokeeffe » Fri Jan 24, 2014 10:54 am

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.
shanejokeeffe
 
Posts: 14
Joined: Thu Dec 12, 2013 8:05 pm

Postby james.billings » Fri Jan 24, 2014 10:59 am

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)
james.billings
 
Posts: 1144
Joined: Wed Jun 16, 2010 11:10 am
Location: My desk.

Postby shanejokeeffe » Fri Jan 24, 2014 11:08 am

Image

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"
shanejokeeffe
 
Posts: 14
Joined: Thu Dec 12, 2013 8:05 pm

Postby james.billings » Fri Jan 24, 2014 11:19 am

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.
james.billings
 
Posts: 1144
Joined: Wed Jun 16, 2010 11:10 am
Location: My desk.

Postby shanejokeeffe » Fri Jan 24, 2014 11:54 am

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!
shanejokeeffe
 
Posts: 14
Joined: Thu Dec 12, 2013 8:05 pm

Postby james.billings » Fri Jan 24, 2014 11:55 am

Ah, that sounds like it. Nice find!
james.billings
 
Posts: 1144
Joined: Wed Jun 16, 2010 11:10 am
Location: My desk.


Return to Deployment Manager

Who is online

Users browsing this forum: No registered users and 0 guests