Hi,

I'm trying to create a database release and deploy it through Octopus.
Unfortunately, after extracting the build to the location, the create database release step cannot find the specified package.
Deploy of package (Download Database Package):
10:02:02   Info     |       Deploying package:    D:\Octopus\Tentacles\SQL_UAT\Files\AccountsDb.Metering@S1.0.4@1BD081527BDE4E4699D858E245E52DCC.nupkg<br>10:02:03   Verbose  |       Extracting package to: D:\Octopus\Tentacles\SQL_UAT\Applications\UAT\AccountsDb.Metering\1.0.4<br>10:02:03   Verbose  |       Extracted 2 files<br>10:02:03   Verbose  |       The package has been installed to: D:\Octopus\Tentacles\SQL_UAT\Applications\UAT\AccountsDb.Metering\1.0.4<br>10:02:03   Verbose  |       If you would like the package to be installed to an alternative location, please use the 'Custom installation directory' feature<br>10:02:03   Verbose  |       Adding journal entry:<br>10:02:03   Verbose  |       <Deployment Id="5f2c8327-200a-412d-b096-e2eb25d05302" EnvironmentId="Environments-2" TenantId="" ProjectId="Projects-1406" InstalledOn="2020-07-06 08:02:03" RetentionPolicySet="Environments-2/Projects-1406/Step-Download Database Package/Machines-642/&lt;default&gt;" ExtractedTo="D:\Octopus\Tentacles\SQL_UAT\Applications\UAT\AccountsDb.Metering\1.0.4" CustomInstallationDirectory="D:\Octopus\Tentacles\SQL_UAT\Applications\UAT\AccountsDb.Metering\1.0.4" WasSuccessful="True"><br>10:02:03   Verbose  |       <Package PackageId="AccountsDb.Metering" PackageVersion="1.0.4" DeployedFrom="D:\Octopus\Tentacles\SQL_UAT\Files\AccountsDb.Metering@S1.0.4@1BD081527BDE4E4699D858E245E52DCC.nupkg" /><br>10:02:03   Verbose  |       </Deployment>
Error in Create database release
10:03:08   Info     |       Path: D:\Octopus\Tentacles\SQL_UAT\Applications\UAT\AccountsDb.Metering\1.0.4<br>10:03:08   Error    |       Import-DatabaseBuildArtifact : The file or folder is not a valid build artifact: 'D:\Octopus\Tentacles\SQL_UAT\Applicat<br>10:03:08   Error    |       ions\UAT\AccountsDb.Metering\1.0.4'<br>10:03:08   Error    |       At D:\Octopus\Tentacles\SQL_UAT\Work\20200706080207-708781-98\Script.ps1:288 char:26<br>10:03:08   Error    |       + ... portedBuildArtifact = Import-DatabaseBuildArtifact -Path $packagePath<br>10:03:08   Error    |       +                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>10:03:08   Error    |       + CategoryInfo          : InvalidData: (D:\Octopus\Tent....Metering\1.0.4:String) [Import-DatabaseBuildArtifact],<br>10:03:08   Error    |       TerminatingException<br>10:03:08   Error    |       + FullyQualifiedErrorId : InvalidBuildArtifact,RedGate.Versioning.Automation.PowerShell.Commands.ImportDatabaseBui<br>10:03:08   Error    |       ldArtifactCommand<br>10:03:08   Verbose  |       Process C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in D:\Octopus\Tentacles\SQL_UAT\Work\20200706080207-708781-98 exited with code 1<br>10:03:19   Verbose  |       Updating manifest with output variables<br>10:03:19   Verbose  |       Updating manifest with action evaluated variables<br>10:03:19   Fatal    |       The remote script failed with exit code 1<br>10:03:19   Fatal    |       The action Redgate - Create Database Release on VMWAUTSQLA01 Jumpbox UAT failed
Any help would be greatly appreciated.

Thanks in advance!

[Edit] I added the log file to be sure.
thibault
0

Comments

13 comments

  • DanC
    Hi Thibault

    Sorry to hear you're experience this issue!

    I've noticed that the two paths are slightly different and end up cutting off  after "D:\Octopus\Tentacles\SQL_UAT"

    Can you verify if that's the case?
    DanC
    0
  • Thibault
    I don't see any cutting off.
    "D:\Octopus\Tentacles\SQL_UAT\Applications\UAT\AccountsDb.Metering\1.0.4"
    this path seems to be the same everywhere.
    Or am I missing one?
    Thibault
    0
  • DanC
    Hi @Thibault

    Apologies, Ignore my last remark I got confused with the pathing.

    So looking at the logs it looks like the following is occurring

    Deploying package:    D:\Octopus\Tentacles\SQL_UAT\Files\AccountsDb.Metering@S1.0.4@1BD081527BDE4E4699D858E245E52DCC.nupkg

    Extracting package to: D:\Octopus\Tentacles\SQL_UAT\Applications\UAT\AccountsDb.Metering\1.0.4

    The package has been installed to: D:\Octopus\Tentacles\SQL_UAT\Applications\UAT\AccountsDb.Metering\1.0.4

    Path: D:\Octopus\Tentacles\SQL_UAT\Applications\UAT\AccountsDb.Metering\1.0.4

    The file or folder is not a valid build artifact: 'D:\Octopus\Tentacles\SQL_UAT\Applications\UAT\AccountsDb.Metering\1.0.4'

    If you go to that folder location does the package exist and is it a ".nupkg"?


    DanC
    0
  • Thibault
    The package seems to be there, but I checked the nupgk, and if I check it against similar builds there seems to be a folder 'db' missing from the package.
    I don't know how to fix this.

    Thibault
    0
  • DanC
    Hi @Thibault

    That's very odd and I suspect there's something going on with the package creation. 

    Can I ask how you're creating the package?
    DanC
    0
  • Thibault
    We are building the package using the TeamCity templates for creating a nuget package.
    Thibault
    0
  • DanC
    Hi @Thibault

    Thanks for that, could you send me TeamCity logs for the creation of that package?
    DanC
    0
  • Thibault
    Hi @DanC

    Certainly!

    Thibault
    0
  • DanC
    Hi @Thibault

    Thanks for sharing that with me!

    Can I check with you, are you using a SQL Source Control project as the source?
    DanC
    0
  • Thibault
    We are using a SQL Change Automation project
    Thibault
    0
  • DanC
    Hi @Thibault

    Thanks for confirming that for me! so from the logs it looks like you're potentially using the wrong Runner type as it's looking for a SQL Source Control project.
    Validating SQL Source Control project 'D:\TeamCity\BuildAgent1\work\98432a360a2ad247'.

    Could you check that's the case for me?

    The following documentation should help: https://documentation.red-gate.com/sca/deploying-database-changes/add-ons/teamcity/use-the-teamcity-plugin-with-a-sql-change-automation-project
    DanC
    0
  • Thibault
    Hi @DanC

    We have found the problem, it was building the Master branch and not my pull request..
    My bad!
    Thank you for all your help!

    Thibault
    0
  • DanC
    Hi @Thibault

    Ah brilliant, glad you managed to find the issue!

    You're most welcome and if you have any other issues don't hesitate to contact us at Redgate Support!
    DanC
    0

Add comment

Please sign in to leave a comment.