Build from Source Control using Azure DevOps fails - Nuget package created with 0 bytes.
Lucian
Posts: 5 Bronze 1
Hi everyone,
Recently our builds on Azure DevOps started to fail with the following error message:
##[error]Cannot generate NuGetPackage. File path: C:\windows\ServiceProfiles\NetworkService\AppData\Local\Temp\DLM Automation\
The NuGet package (artifact) is created but it's empty (0 bytes).
Thanks in advance!
Log output on the build step:
Recently our builds on Azure DevOps started to fail with the following error message:
##[error]Cannot generate NuGetPackage. File path: C:\windows\ServiceProfiles\NetworkService\AppData\Local\Temp\DLM Automation\
The NuGet package (artifact) is created but it's empty (0 bytes).
Thanks in advance!
Log output on the build step:
- Starting: Build DBPackage==============================================================================Task : Redgate SQL Change Automation: BuildDescription : Build and test databases with Redgate SQL Change AutomationVersion : 4.0.1Author : Redgate Software==============================================================================Setting ErrorActionPreference to "Stop" because no -ErrorAction argument was providedNew-DatabaseConnection, SQL Change Automation 4.2.20112.19442, Copyright © Red Gate Software Ltd 2014-2019Use of this functionality requires a SQL Toolbelt license.If you are unsure of your current user license entitlement please contact licensing@red-gate.comInvoke-DatabaseBuild, SQL Change Automation 4.2.20112.19442, Copyright © Red Gate Software Ltd 2014-2019Cleaning database 'XXX_Test_CI' on server 'XXX'.Validating SQL Source Control project 'C:\Agents\Agent1\_work\1\s'.Schema validation successful.New-DatabaseBuildArtifact, SQL Change Automation 4.2.20112.19442, Copyright © Red Gate Software Ltd 2014-2019Export-DatabaseBuildArtifact, SQL Change Automation 4.2.20112.19442, Copyright © Red Gate Software Ltd 2014-2019.\db\state\.git\objects\pack\pack-4025e9990e6c431fcbee6c6b4eb1087d2fb92e3c.pack##[error]Cannot generate NuGetPackage. File path: C:\windows\ServiceProfiles\NetworkService\AppData\Local\Temp\DLM Automation\pumhamrk.0o4. Package: DBPackage. Version: 1.0.35869, Description: .Finishing: Build DBPackage
Tagged:
Answers
Kind regards
Dan Calver | Redgate Software
Have you visited our Help Center?
Problem exists on our 2 biggest databases (~7000 and ~14000 objects), on databases smaller than 3000 objects nuget is created successfuly.
Using task version 3.* solves above problem, but I would prefer using 4.* accross all builds.
I solved it by adding a task to delete the .git folder. I found out that it includes the .git folder by trying it on another source controlled database with a smaller .git folder and the generated NuGet package includes everything in the source folder, not just *.sql files. You can see this yourself by changing the extension of the NuGet package to .zip and opening in Windows Explorer.
I am planning to move our database scripts folder to a sub-folder of the VCS root and then we won't need a task to delete the .git folder. Also, it's just a cleaner solution as we are then free to store other files/folders in our VCS root and they won't affect database package creation.
Just to keep you in the loop there's currently an issue in version 4.* where if a NuGet package exceeds a certain size it's causing failure, it's currently being investigated by the team with the bug reference: SCA-2717. As mentioned above by other customers discoveries, the current workaround is to use version 3.*
Hope this helps clear up the situation and we will do our best to let you know when a fix comes around!
Kind regards
Dan Calver | Redgate Software
Have you visited our Help Center?