Error on Dynamic Database Upgrade

shanejokeeffeshanejokeeffe Posts: 19 New member
edited January 24, 2014 5:55AM in Deployment Manager
Hi,

I'm getting the following error when performing a deployment of a database package for the first time:
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

Comments

  • 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.
  • 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?
    Systems Software Engineer

    Redgate Software

  • shanejokeeffeshanejokeeffe Posts: 19 New member
    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.
  • 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)
    Systems Software Engineer

    Redgate Software

  • shanejokeeffeshanejokeeffe Posts: 19 New member
    1ToUwgK.jpg

    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"
  • 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.
    Systems Software Engineer

    Redgate Software

  • shanejokeeffeshanejokeeffe Posts: 19 New member
    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!
  • Ah, that sounds like it. Nice find!
    Systems Software Engineer

    Redgate Software

Sign In or Register to comment.