Why does Bamboo + msbuild + DeployOnBuild create corrupt zip files?
Asked by Mitch Thompson:

I work for STTI, a nonprofit organization that qualified for your non-profit license agreement. We have pretty much every single atlassian product installed and currently being utilized.

I am working on a site-wide deployment solution for all of our websites. One of the steps is to utilize parameterized deployments. When I attempt to manually use msbuild on my development PC, the deployment zip files that are created are fine. When i have bamboo create the build, using our build agent PC, the same process creates corrupt deployment zip files (bad CRC errors on random files). Also, sometimes all artifacts are not created. I've tried all of the basic troubleshooting and even some advanced things, but all I keep returning to is that something with Java possibly is causing the msbuild's built in zip file creation to cause problems. FYI I've turned off parallel build but it didn't help any.

I've already confirmed I have the exact same version of msbuild on the dev and build agent computers. We are using the latest server operating systems from our MSDN licenses, hence everything is up to date. Has anyone come across this problem before?


Answers:
author: Mitch Thompson
body: I was asking the wrong question.. I should have been asking this:

Why are zip file artifacts corrupted, but are ok on my build agent? {#toc-hId-1818155741}
=========================================================================================

<https://answers.atlassian.com/questions/251415/why-are-zip-file-artifacts-corrupted-but-are-ok-on-my-build-agent>


author: Mitch Thompson
body: It ended up being a setting in the network card setup. The "Large Send Offload" needs to be set to Disabled for it to work properly. This setting is in "Advanced" un the network card -\> properties on the build agent.

A related problem of artifacts randomly not copying led us to this solution.

See [](https://confluence.atlassian.com/display/BAMKB/Windows+build+artifacts+are+not+copied)<https://confluence.atlassian.com/display/BAMKB/Windows+build+artifacts+are+not+copied>


author: Mitch Thompson
body: The logs don't say anything useful.... Also, the steps that do the copy are built into Bamboo, its the system that moves the actual artifact files around. Its nothing i've built that is custom.

We're going to upgrade to the latest version of bamboo (we're running 5.1 now and 5.3 is available) but i'm not having high hopes.

2014-01-10 11:13:19,067 INFO \[7-BAM::Default Agent::Agent:pool-20-thread-1\] \[AbstractArtifactManager\] Publishing \[Parameters\] for MANAGE-DEV-JOB1-108: 3 file(s) matching \[\*\*STTIEnvironments/\*.xml\] in directory C:\\bamboo-home\\xml-data\\build-dir\\MANAGE-DEV-JOB1\\code  
2014-01-10 11:13:19,067 INFO \[7-BAM::Default Agent::Agent:pool-20-thread-1\] \[AbstractArtifactManager\] Publishing \[PowerShell\] for MANAGE-DEV-JOB1-108: 4 file(s) matching \[\*\*/\*.ps1\] in directory C:\\bamboo-home\\xml-data\\build-dir\\MANAGE-DEV-JOB1\\PowerShell\\SiteDeploy  
2014-01-10 11:13:19,083 INFO \[7-BAM::Default Agent::Agent:pool-20-thread-1\] \[ExecutionPhaseServiceImpl\] Management Site - Management Site - Default Job #108 (MANAGE-DEV-JOB1-108) execution finished  
2014-01-10 11:13:19,083 INFO \[7-BAM::Default Agent::Agent:pool-20-thread-1\] \[DefaultBuildExecutionManager\] onExecutionFinishedTimingPoint for MANAGE-DEV-JOB1-108  
2014-01-10 11:13:19,083 INFO \[7-BAM::Default Agent::Agent:pool-20-thread-1\] \[LocalBuildResultProcessor\] Processing build result MANAGE-DEV-JOB1-108...  
2014-01-10 11:13:19,083 INFO \[7-BAM::Default Agent::Agent:pool-20-thread-1\] \[ExecutionPhaseServiceImpl\] Management Site - Management Site - Default Job #108 (MANAGE-DEV-JOB1-108) execution finished


author: Mitch Thompson
body: I had noticed that this problem is confined to the 'copy' of artifacts from the build agent to the bamboo machine. The zip files are always fine on the build agent, but after they are moved to the shared dirs on bamboo, they are corrupt. This was just discovered this morning.


author: Gretchen
body: What do your logs tell you about this? Specifically in the steps that do the copy. Check to make sure your parameters don't have extra characters (spaces etc.) if they are variabilized (new word, I just made it up). Also how different is the file size between the corrupt and the non-corrupt version?


author: Gretchen
body: I can't imagine how Bamboo can be the cause of the issue since it just executes the commands you give it. I did google this for you (slow day) and found similar problems reported elsewhere like here: [](http://forums.iis.net/t/1160014.aspx.)<http://forums.iis.net/t/1160014.aspx>. It specifically talks to parameterized deployments (I think, not being a MS expert but it looks like it to me.)

Incidentally, questions on this site are generally responded to by other users although frequently Atlassian employees will also jump in. By your description (since this appeared to be addressed to Atlassian specifically) it seems as though you might think this is the primary support site. It's not. Just thought I'd point that out so your expectations are set appropriately. Hope the link helps.

comments: author: Mitch Thompson
body: I had noticed that this problem is confined to the 'copy' of artifacts from the build agent to the bamboo machine. The zip files are always fine on the build agent, but after they are moved to the shared dirs on bamboo, they are corrupt. This was just discovered this morning.