3

I have an application that uploads a file which works fine on Heroku and on local developer machines - but on AWS EB, the upload is interrupted and doesn't complete.

I've set the nginx directives as follows

.ebextensions/00_project.config

files:
    "/etc/nginx/conf.d/proxy.conf" :
        mode: "000755"
        owner: root
        group: root
        content: |
            client_max_body_size 2000M
            client_body_buffer_size 2000M
option_settings:
  "aws:elasticbeanstalk:container:python":
    WSGIPath: server:application

.platform/nginx/conf.d/proxy.conf

client_max_body_size 2000M;
client_body_buffer_size 2000M;

.platform/nginx/00_myconf.config

container_commands:
  01_reload_nginx:
    command: "service nginx reload"

This is running python3.8 and using a plotly/react framework called Dash. https://dash.plotly.com/introduction

As mentioned, it's only not working on AWS so it appears to be a system config issue. To confirm this, I uploaded a large file to a public bucket and had this app read from the bucket instead of the upload and it worked fine.

I've exhausted all options so any help muchly appreciated!

  • What error code do you get, when the upload is interrupted? This will help you understand, if it is an nginx or a python issue. – kgiannakakis Dec 08 '21 at 06:14
  • there isn't an error to speak of. least none I can see... But your question prompted me to check the beanstalk logs where I saw this. Dec 8 05:58:47 ip-172-31-7-149 web: MemoryError – John Christian Dec 08 '21 at 06:44
  • and that error is in the web.stdout.log file. the nginx log looks ok but I did see this warning (however innocuous it looks) 2021/12/08 05:57:22 [warn] 3988#3988: *158 an upstream response is buffered to a temporary file /var/lib/nginx/tmp/proxy/4/00/0000000004 while reading upstream, client: 172.31.12.108, server: , request: "GET /_dash-component-suites/dash/dcc/async-plotlyjs.js HTTP/1.1", upstream: "http://127.0.0.1:8000/_dash-component-suites/dash/dcc/async-plotlyjs.js", host: ".removed.ap-southeast-2.elasticbeanstalk.com", referrer: "" – John Christian Dec 08 '21 at 06:46
  • Increasing the instance size fixed it! kgiannakakis if you want to answer "upgrade your instance size by paying more money to AWS" then I will mark that as correct. If it wasnt for your comment I wouldn't have seen that error in the logs. – John Christian Dec 08 '21 at 06:59
  • 1
    It would be more appropriate for you to write an answer and accept it. It is fine to answer your own questions. This may help others in the future. – kgiannakakis Dec 08 '21 at 07:07

1 Answers1

1

After prompting from kgiannakakis, I checked the logs and was found a "web: MemoryError" line in the web.stdout.log file.

So I upgraded the EB instance to something a bit bigger and it managed to fix the issue... so essentially I was running out of memory and needed to pay AWS more money to get more memory.