on building docker image level=error msg="Can't close tar writer: io: read/write on closed pipe"

Aniket patel picture Aniket patel · Oct 27, 2017 · Viewed 12.3k times · Source
time="2017-10-27T07:39:20Z" level=error msg="Can't add file /var/app/current/app/content_classifier/forest.pickle to tar: io: read/write on closed pipe" 
time="2017-10-27T07:39:20Z" level=error msg="Can't close tar writer: io: read/write on closed pipe"
Failed to build Docker image aws_beanstalk/staging-app:  tar writer: io: read/write on closed pipe" 
Error response from daemon: Untar error on re-exec cmd: fork/exec /proc/self/exe: cannot allocate memory. Check snapshot logs for details. (Executor::NonZeroExitStatus)

I have a Pickle object in django_app/content_classifer object. There is a class to predict the result and it's initializing itself when celery tasks file gets initialised.

docker build keeps failing after giving an error message as in the title.

Answer

Luk3rson picture Luk3rson · Oct 28, 2017

I had same issue few minutes ago, when I found your issue :) I had some files opened = they were used by another application(GIT)

Please make sure that no files are being used.

Hope it will help.