linuxamazon-web-servicesunixconcourse

/sourcedir.tar.gz: Cannot write: Broken pipe


I am trying to deploy one of my code through concourse pipeline. The requirement is i will have a processing.py file checked in the git hub. While running the deployment, the deployment code should pick up the processing.py and convert the .py file to sourcedir.tar.gz and copy to s3 location. But the tar utility is throwing error

+++ pwd
++ cd_save=/tmp/build/fef6b5c1/source
++ cd templates/training/scripts
++ tar -czvf templates/training/scripts/sourcedir.tar.gz preprocessing.py
tar (child): templates/training/scripts/sourcedir.tar.gz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
preprocessing.py
tar: templates/training/scripts/sourcedir.tar.gz: Cannot write: Broken pipe
tar: Child returned status 2
tar: Error is not recoverable: exiting now

Solution

  • Your script does cd templates/training/scripts before running the tar command that writes to the same relative path. Either remove the cd or change the tar to tar -czvf ./sourcedir.tar.gz preprocessing.py. Which solution is correct depends on where the preprocessing.py file exists.