GithubHelp home page GithubHelp logo

Comments (11)

benzino77 avatar benzino77 commented on August 20, 2024

Hi,
The APP_MAX_FILE_SIZE parameter should be provided in bytes. 100B can be too small to let CRA work properly.
Try to change this value to something more realistic: 10MB should be a good starting point
10 * 1024 * 1024 = 10485760
APP_MAX_FILE_SIZE=10485760

The value in the example docker-compose.yaml file is 25MB for single file to scan

from clamav-rest-api.

kobayashi-m42 avatar kobayashi-m42 commented on August 20, 2024

@benzino77 Thanks for your comment.
I set APP_MAX_FILE_SIZE to 10MB (10485760) and tried a file larger than 10MB but got the same error.

api response:

{
  "success": false,
  "data": {
    "error": "File size limit exceeded. Max size of uploaded file is: 10485760 KB"
  }
}

from clamav-rest-api.

benzino77 avatar benzino77 commented on August 20, 2024

If you set a limit to 10MB and send file greater then 10MB... well it is correct behavior.
APP_MAX_FILE_SIZE is the upper size limit of a file which can be accepted by CRA.

from clamav-rest-api.

kobayashi-m42 avatar kobayashi-m42 commented on August 20, 2024

@benzino77 Container restarts when an error occurs. Is it also correct behavior for the container to exit?

from clamav-rest-api.

benzino77 avatar benzino77 commented on August 20, 2024

Sorry to hear it.
What is your setup? Are you trying to start CRA on docker or on k8s? Have you tried to use sample configuration from examples directory?
I've just tested CRA on docker and k8s on my side using samples provided in examples directory. Works without any problem - no restarts on uploading files exceeding size limit

For docker I'm on version:

docker --version
Docker version 25.0.3, build 4debf41

in case of k8s I've performed tests on 1.24.3 and 1.28.3 also works without restarts when file size limit is exceeded:

minikube profile list
|----------|-----------|---------|--------------|------|---------|---------|-------|--------|
| Profile  | VM Driver | Runtime |      IP      | Port | Version | Status  | Nodes | Active |
|----------|-----------|---------|--------------|------|---------|---------|-------|--------|
| cluster1 | docker    | docker  | 192.168.58.2 | 8443 | v1.28.3 | Running |     1 |        |
| minikube | docker    | docker  | 192.168.49.2 | 8443 | v1.24.3 | Stopped |     1 | *      |
|----------|-----------|---------|--------------|------|---------|---------|-------|--------|

from clamav-rest-api.

kobayashi-m42 avatar kobayashi-m42 commented on August 20, 2024

I tried CRA on Docker using samples provided in examples directory.

I use the same docker version.

docker --version
Docker version 25.0.3, build 4debf41

from clamav-rest-api.

benzino77 avatar benzino77 commented on August 20, 2024

Hmm. That is strange. I just tested CRA on two different environments and it works as expected. Can you provide more details about your setup?
What architecture you are running on? x86_64? ARM64 (Apple M1/M2/Mx)?
What OS you are running underneath? Windows? Linux? MacOS?
Do you introduce any changes to sample docker-compose.yaml file included in examples directory?

from clamav-rest-api.

kobayashi-m42 avatar kobayashi-m42 commented on August 20, 2024

I am using MacOS. I tried it in the following environments.

  • x86_64
  • ARM64(Apple M2)

All environments use Docker image benzino77/clamav-rest-api:1.2.2.

After a minute or two after the request, an error log is output and the system restarts. In some cases, it restarts immediately.

APP_MAX_FILE_SIZE in docker-compose.yaml is changed to 10485760. No other changes other than this.

from clamav-rest-api.

benzino77 avatar benzino77 commented on August 20, 2024

I have been trying to reproduce your problem but without luck.
I have setup CRA on two different machines with docker. Set the max upload file to 1MB and upload random files in a loop to CRA to scan them. Most of the files exceeded APP_MAX_FILE_SIZE. I haven't observed restarts.

Is it a "plain" docker installation or you introduce some "tweaks" in docker.json file?

from clamav-rest-api.

benzino77 avatar benzino77 commented on August 20, 2024

I think that finally I was able to reproduce your problem. Check the new docker image pushed to docker hub.

from clamav-rest-api.

benzino77 avatar benzino77 commented on August 20, 2024

Close this issue as there is no response from the reporter.

from clamav-rest-api.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.