0

I have a web service in a Docker image to which I am trying to upload two files: a 6MB file and an 18MB file.

When running in my local Docker service, both files upload fine.

With the same image in ECS, only the 6MB file successfully uploads.

Successful 6MB upload:

C:\>curl -v -F file=@6mb.zip http://52.xxx.xxx.xxx:5000/api/v1/add_model
*   Trying 52.xxx.xxx.xxx...
* TCP_NODELAY set
* Connected to 52.xxx.xxx.xxx (52.xxx.xxx.xxx) port 5000 (#0)
> POST /classifierService/api/v1/add_model HTTP/1.1
> Host: 52.xxx.xxx.xxx:5000
> User-Agent: curl/7.57.0
> Accept: */*
> Content-Length: 6526998
> Content-Type: multipart/form-data; boundary=------------------------51a3998e86a60e5c
> Expect: 100-continue
>
* Done waiting for 100-continue
< HTTP/1.1 200 OK
< Content-Type: application/json
< Content-Length: 68178
<
<response body>

The 18MB file, however, fails with an empty response.

Unsuccessful 18MB upload:

C:\>curl -v -F file=@18mb.zip http://52.xxx.xxx.xxx:5000/api/v1/add_model
*   Trying 52.xxx.xxx.xxx...
* TCP_NODELAY set
* Connected to 52.xxx.xxx.xxx (52.xxx.xxx.xxx) port 5000 (#0)
> POST /classifierService/api/v1/add_model HTTP/1.1
> Host: 52.xxx.xxx.xxx:5000
> User-Agent: curl/7.57.0
> Accept: */*
> Content-Length: 18436586
> Content-Type: multipart/form-data; boundary=------------------------65717bbb45c3da52
> Expect: 100-continue
>
* Done waiting for 100-continue
* Empty reply from server
* Connection #0 to host 52.xxx.xxx.xxx left intact
curl: (52) Empty reply from server

Any ideas what might be wrong, or how I can debug this problem?

ladenedge
  • 146
  • 1
  • 10

1 Answers1

1

There are many reasons that can cause this. The most obvious of which is the environment you setup on the server. Many (if not all) web frameworks set max upload limits to prevent DoS attacks and other similar exploits.

PHP (for example) sets the limit at 10mb I believe. You'll need to modify the appropriate php.ini adjusting parameters like the following:

memory_limit = 32M
upload_max_filesize = 10M
post_max_size = 20M

... or you might be able to modify the values in a .htaccess file:

php_value upload_max_filesize 10M
php_value post_max_size 20M
php_value memory_limit 32M

Ultimately, we need more information about the environment to give a more specific answer.

TheCompWiz
  • 7,349
  • 16
  • 23
  • Great thought, however the very same Docker image accepts the larger file when running locally. I suppose any relevant configuration values must therefore be set to allow larger uploads..? (I edited the question to clarify this.) – ladenedge May 09 '18 at 17:50
  • 1
    Once again... leaving out more details. Sheesh. Aaand... no. Just because it is a docker image does not ensure that the settings are the same. – TheCompWiz May 09 '18 at 17:53
  • Oh! I had no idea configuration might change in an image. That's presumably the answer, then: I need to go learn these details for myself. Thank you! – ladenedge May 09 '18 at 17:55
  • ... more information would probably help you get a more specific answer. Is it PHP? built on which base-image? what do the logs show? etc... – TheCompWiz May 09 '18 at 18:04