e-m-b-a / embark

EMBArk - The firmware security scanning environment
https://www.securefirmware.de
MIT License
319 stars 46 forks source link

Request Entity Too Large #40

Closed keesj-exset closed 2 years ago

keesj-exset commented 2 years ago

Screenshot from 2022-04-19 13-37-26 Describe the bug

While uploading "large" files the upload UI is not very clear on why an upload is failing. Doing some debugging in the web console I was able to see "Request Entity Too Large". Pressing the upload button a few times also causes the progress bar to go.. weird

is there a setting to allow larger files? is there also a setting to allow to queue more analysis ?

To Reproduce Steps to reproduce the behavior:

  1. EMBArk installation (using EMBABox)
  2. Start EMBArk: sudo ./run-server.sh
  3. Use the firmware available here:430 MB file (ota update)
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

Not sure but I also got this message (perhaps a race condition while uploading?)

2022-04-19 10:21:09,597 INFO     Listening on TCP address 0.0.0.0:8001                                    
Error notifying listener                             
Traceback (most recent call last):                   
  File "/home/vagrant/embark/.venv/lib/python3.9/site-packages/apscheduler/schedulers/base.py", line 836, in _dispatch_event
    cb(event)                                        
  File "/home/vagrant/embark/.venv/lib/python3.9/site-packages/django_apscheduler/jobstores.py", line 100, in handle_execution_event
    job_execution = DjangoJobExecution.atomic_update_or_create(                                           
  File "/home/vagrant/embark/.venv/lib/python3.9/site-packages/django_apscheduler/util.py", line 99, in func_wrapper
    result = func(*args, **kwargs)                   
  File "/home/vagrant/embark/.venv/lib/python3.9/site-packages/django_apscheduler/models.py", line 165, in atomic_update_or_create
    job_execution = DjangoJobExecution.objects.select_for_update().get(                                   
  File "/home/vagrant/embark/.venv/lib/python3.9/site-packages/django/db/models/query.py", line 443, in get
    raise self.model.MultipleObjectsReturned(                                                             
django_apscheduler.models.DjangoJobExecution.MultipleObjectsReturned: get() returned more than one DjangoJobExecution -- it returned 2!
keesj-exset commented 2 years ago

It looks like the size can be increased in the startup script .

https://github.com/e-m-b-a/embark/blob/main/run-server.sh#L26

m-1-k-3 commented 2 years ago

is it now working? I will include a note in the wiki

keesj-exset commented 2 years ago

Increasing the limit does appear to work (hence good to document how to increase the limit) but I will do more testing tomorrow. The UI issue remain. it appears it is possible to press the upload button multiple times causing multiple uploads (arguably this is a different issue) but still related to large files