Why does my .tar file produces hundreds of PaxHeader files?
Asked Answered
L

1

8

I am setting up an AutoCI -> Jenkins -> Octopus automated build process. I use a package called octopackjs & gulp-octo to pack my node.js project up into a .tar file like so:

return gulp.src(['**/*', '!gulpfile.js'])
      .pipe(octo.pack("tar.gz"))
      .pipe(octo.push({apiKey: 'API-SUPERCOOLKEY', host: 'https://octopus.supercooldomain.net', replace: true}));

I am able to pack it up, and it is pushed to the right place in the Octopus server. However, when I examine the contents of that .tar file, it is polluted with hundreds of a file called "PaxHeader". From some looking around, that file is meant to contain metadata for the .tar package. When Octopus tries to extract that file to my target environment, it throws with the following error trace:

System.IO.IOException: Cannot create /home/opsteam/.octopus/Applications/OctopusServer/Dev.Corporate/webapp/2.0.10/PaxHeader because a file with the same name already exists.
09:46:34Error
  at System.IO.Directory.CreateDirectory (System.String path) <0x7fdc9e79db50 + 0x00167> in <filename unknown>:0 
09:46:34Error
  at SharpCompress.Reader.IReaderExtensions.WriteEntryToDirectory (IReader reader, System.String destinationDirectory, ExtractOptions options) <0x4033e800 + 0x00260> in <filename unknown>:0 
09:46:34Error
  at Calamari.Integration.Packages.TarPackageExtractor.Extract (System.String packageFile, System.String directory, Boolean suppressNestedScriptWarning) <0x4033b4f0 + 0x000f3> in <filename unknown>:0 
09:46:34Error
  at Calamari.Integration.Packages.GenericPackageExtractor.Extract (System.String packageFile, System.String directory, Boolean suppressNestedScriptWarning) <0x4033b4a0 + 0x0003b> in <filename unknown>:0 
09:46:34Error
  at Calamari.Deployment.Conventions.ExtractPackageConvention.Install (Calamari.Deployment.RunningDeployment deployment) <0x40335ac0 + 0x000bb> in <filename unknown>:0 
09:46:34Error
  at Calamari.Deployment.ConventionProcessor.RunInstallConventions () <0x4030aaa0 + 0x00065> in <filename unknown>:0 
09:46:34Error
  at Calamari.Deployment.ConventionProcessor.RunConventions () <0x4030a940 + 0x0001f> in <filename unknown>:0 

What is going on? Why does my .tar file have these artifacts?

edit: The content of these PaxHeader files, when opened up as text, ranges from package.json contents for the modules in the project, to random licensing information, to directories, lists of strings, etc...

Lakisha answered 17/6, 2016 at 20:33 Comment(0)
N
1

Had the same issue and what solved it for me was upgrading npm to latest version (3.10.7 as of the moment) as suggested in one of final posts under http://help.octopusdeploy.com/discussions/problems/46332-deploy-to-linux-centos7-deploy-failing.

Not sure if you are or Windows but I used npm-windows-upgrade as suggested under this SO post: How do I update node and npm on windows?.

Then flushed all node_modules and did fresh npm install on the project. The result archive not only now does not include duplicated PaxHeader files but also took faster to generate.

Newkirk answered 24/8, 2016 at 12:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.