3

I'm running a Flask API inside a Docker Container.

My application has to download files from Google Cloud, and sometimes, after some minutes of execution, my container exits with the following message: pm-api exited with code 247

I am not sure, but I think it might be related to the size of the data I'm trying to download from GCP, becuse I'm using a query and I don't seem to have any problem whem limiting the number of rows I get from it.

Could be data-size related? And if so, how can I configure my docker container to not break when downloading/saving large files?

Mikhail Berlyant
  • 165,386
  • 8
  • 154
  • 230
GennSev
  • 1,586
  • 4
  • 20
  • 29

3 Answers3

3

In order to solve this problem I had to increase the size of my docker container. This is found in settings resources. Increasing the memory removed this issue.

hambo
  • 31
  • 4
1

Yes, possibly due to the large file size.

You may have to define FILE_UPLOAD_MAX_MEMORY_SIZE larger than your downloading file.What is code 247

Also refer max-memory-vs-data-upload-max-memory

Sachith Muhandiram
  • 2,819
  • 10
  • 45
  • 94
  • 1
    All those links refer to projects using Django. I'm **not** using Django. – GennSev Mar 24 '21 at 18:14
  • 1
    Is independant the exit code that you have with the language that you use. django and flask use python. the difference is framwork but the issue is related. – Jorge P. Mar 24 '21 at 22:44
  • Well, it might be, but I can't define a value for FILE_UPLOAD_MAX_MEMORY_SIZE because it is from Django. – GennSev Mar 25 '21 at 13:14
0

I have a similar issue. docker container (python code processing some data) exited

command terminated with exit code 247

my docker container is running on k8s.

the issue was caused because I set the k8s resources memory limit to 4GB, but the python container needs to use >4GB memory. after I increase the memory limit to 8GB, the issue is sovled.

but about why the exit code is 247, I don't find the answer. from the docker exit code, it doesn't have code 247.

Dongsheng
  • 11
  • 1