Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I remove the 5MB upload limit #680

Closed
cheng-orange opened this issue Dec 15, 2021 · 8 comments
Closed

How can I remove the 5MB upload limit #680

cheng-orange opened this issue Dec 15, 2021 · 8 comments

Comments

@cheng-orange
Copy link

No description provided.

@pospielov
Copy link
Collaborator

The limit is defined in nginx config.
You can find the default config here:
https://github.com/exadel-inc/CompreFace/blob/master/ui/nginx/conf.d/nginx.conf
see the line client_max_body_size 5000K;
You can replace this config without building a new version of CompreFace.
All you need is to create a volume for compreface-core container in docker-compose file. The path inside the container is "/etc/nginx/conf.d"
Then you will need to place in this volume your own nginx config.

@nvkhiem
Copy link

nvkhiem commented Dec 28, 2021

Hi @pospielov,
I configured client_max_body_size to 50M but not success. I got <Response [413]> (413 = payload too large) when recognizing images above 5MB size. I tried with both normal and mobile builds.
Do you have any ideas?

P/s: I'm sure that I changed this config by use this command: docker cp compreface-core:/etc/nginx/conf.d C:\nginx and then check the file C:\nginx\nginx.conf that having line client_max_body_size 50M;
Thanks,

@pospielov
Copy link
Collaborator

Hi, does the error is the same as before you changed the config?
Could you try to break that nginx.conf somehow and check that CompreFace stopped working at all?

@nvkhiem
Copy link

nvkhiem commented Jan 4, 2022

Hi @pospielov, the error is the same as before. I recognized that this change should apply for compreface-ui but not compreface-core. It passed this error after apply your fix for compreface-ui.
But new error relates to size limit occurred:
org.springframework.web.multipart.MaxUploadSizeExceededException: Maximum upload size exceeded; nested exception is java.lang.IllegalStateException: org.apache.tomcat.util.http.fileupload.impl.SizeLimitExceededException: the request was rejected because its size (24345940) exceeds the configured maximum (10485760) compreface-api | at org.springframework.web.multipart.support.StandardMultipartHttpServletRequest.handleParseFailure(StandardMultipartHttpServletRequest.java:122) compreface-api | at org.springframework.web.multipart.support.StandardMultipartHttpServletRequest.parseRequest(StandardMultipartHttpServletRequest.java:115) compreface-api | at org.springframework.web.multipart.support.StandardMultipartHttpServletRequest.<init>(StandardMultipartHttpServletRequest.java:88) compreface-api | at org.springframework.web.multipart.support.StandardServletMultipartResolver.resolveMultipart(StandardServletMultipartResolver.java:87)
It somehow relates to Spring setting. Could you please check? Thanks.

@pospielov
Copy link
Collaborator

Bad news, looks like it is hardcoded in application.yml with 10Mb value:
https://github.com/exadel-inc/CompreFace/blob/master/java/api/src/main/resources/application.yml
For now you can only change it and rebuild CompreFace. I'll create a task to make it dynamic

@nvkhiem
Copy link

nvkhiem commented Jun 1, 2022

I fixed this problem by follow steps:

    1. Edit file nginx.conf: Set client_max_body_size 50M;
    2. Edit file docker-compose.yml, add volumes to compreface-core:
            volumes:
                - nginx_conf_volume:/etc/nginx/conf.d
            nginx_conf_volume should be also declared on top of file:
            volumes:
                - nginx_conf_volume:
    3. Run command: docker-compose up
    4. Copy nginx.conf: docker cp /path/to/nginx.conf compreface-ui:/etc/nginx/conf.d
    5. Restart compose.

@mykeehu
Copy link

mykeehu commented Nov 4, 2023

How can I change limit under Windows?

@mykeehu
Copy link

mykeehu commented Oct 2, 2024

Under Windows, how can I change the limit on Docker Desktop?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants