Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 820
Aniket patel Avatar asked Oct 27 '17 08:10

Aniket patel


2 Answers

if you are on Mac, make sure docker hub is running

like image 110
rezan21 Avatar answered Sep 17 '22 14:09

rezan21


The problem faced because the process that generates the pickle object has a diffrent user assigned then process that was accessing the pickle object.

I define the location for pickle object in the setting file.

picklefile = "usr/local/webapp/forest.pickle"

I simply added the step as following in Dockerfile.

RUN chown -R /user/local/webapp/ 
like image 40
Aniket patel Avatar answered Sep 18 '22 14:09

Aniket patel