intuitem / ciso-assistant-community

CISO Assistant is a one-stop-shop for GRC, covering Risk, AppSec and Audit Management and supporting +70 frameworks worldwide with auto-mapping: NIST CSF, ISO 27001, SOC2, CIS, PCI DSS, NIS2, CMMC, PSPF, GDPR, HIPAA, Essential Eight, NYDFS-500, DORA, NIST AI RMF, 800-53, 800-171, CyFun, CJIS, AirCyber, NCSC, ECC, SCF and so much more
https://intuitem.com
Other
1.18k stars 166 forks source link

Error 500 on analytics #613

Open pvassalligs opened 4 months ago

pvassalligs commented 4 months ago

Describe the bug Error 500 - Internal Error

To Reproduce On login I get the side menu and the links are working properly but all at sudden I get the error on the overview-> Analytics page

Expected behavior The right page and the analytics working.

Screenshots image

Environment (please complete the following information):

eric-intuitem commented 4 months ago

Is it transient (i.e. when you refresh the error is gone), or is it persistent?

pvassalligs commented 4 months ago

Unfortunately the error is persistent...

pvassalligs commented 4 months ago

I have checked the logs. Here they are:

docker-compose logs Traceback (most recent call last): File "/usr/lib/python3/dist-packages/docker/api/client.py", line 214, in _retrieve_server_version return self.version(api_version=False)["ApiVersion"] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/docker/api/daemon.py", line 181, in version return self._result(self._get(url), json=True) ^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/docker/utils/decorators.py", line 46, in inner return f(self, *args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/docker/api/client.py", line 237, in _get return self.get(url, self._set_request_timeout(kwargs)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/requests/sessions.py", line 602, in get return self.request("GET", url, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/requests/sessions.py", line 589, in request resp = self.send(prep, send_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/requests/sessions.py", line 703, in send r = adapter.send(request, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/requests/adapters.py", line 486, in send resp = conn.urlopen( ^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 791, in urlopen response = self._make_request( ^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 497, in _make_request conn.request( TypeError: HTTPConnection.request() got an unexpected keyword argument 'chunked'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/bin/docker-compose", line 33, in sys.exit(load_entry_point('docker-compose==1.29.2', 'console_scripts', 'docker-compose')()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 81, in main command_func() File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 200, in perform_command project = project_from_options('.', options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/compose/cli/command.py", line 60, in project_from_options return get_project( ^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/compose/cli/command.py", line 152, in get_project client = get_client( ^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/compose/cli/docker_client.py", line 41, in get_client client = docker_client( ^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/compose/cli/docker_client.py", line 170, in docker_client client = APIClient(use_ssh_client=not use_paramiko_ssh, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/docker/api/client.py", line 197, in init self._version = self._retrieve_server_version() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/docker/api/client.py", line 221, in _retrieve_server_version raise DockerException( docker.errors.DockerException: Error while fetching server API version: HTTPConnection.request() got an unexpected keyword argument 'chunked'

CyberPoly1000 commented 4 months ago

Have you experienced the issue after an upgrade of the system ? When upgrading to a new version, I often stumble upon this kind of error. I solve it by running the migrations via Docker command line :

#To get the name of your backend, by default it is 'backend', we'll call it $BACKEND_NAME here
$ docker ps
$ docker exec -it $BACKEND_NAME python manage.py migrate

Keep us updated if it helped

ab-smith commented 4 months ago

Hello @pvassalligs , closing this ticket for now as it looks like a transient migration issue. Feel free to reopen it if something comes up :)

pvassalligs commented 3 months ago

docker exec -it $BACKEND_NAME python manage.py migrate

Hi @ab-smith and @CyberPoly1000: it's not a migration issue and I can't reopen the ticket...

It's related, as I can see from logs to a Content-length limit:

__Listening on 0.0.0.0:3000 SvelteKitError: Content-length of 23845526 exceeds limit of 20000000 bytes. at Object.start (file:///app/build/handler.js:984:19) at setupReadableStreamDefaultController (node:internal/webstreams/readablestream:2460:23) at setupReadableStreamDefaultControllerFromSource (node:internal/webstreams/readablestream:2492:3) at new ReadableStream (node:internal/webstreams/readablestream:280:7) at get_rawbody (file:///app/build/handler.js:973:9) at getRequest (file:///app/build/handler.js:1054:7) at Array.ssr (file:///app/build/handler.js:1248:19) at handle (file:///app/build/handler.js:1318:23) at file:///app/build/handler.js:1318:40 at Array. (file:///app/build/handler.js:1237:4) { status: 413, text: 'Payload Too Large' }

Can you please tell me how to increase that limit? Thank you :)

ab-smith commented 3 months ago

@nas-tabchiche I think we had a discussion about BODY_SIZE_LIMIT at some point isn't it?

nas-tabchiche commented 3 months ago

We did talk about that regarding file uploads indeed. Here it seems no POST is made, something must make the payload's size explode because there is no reason for it to ever reach 20+MB.

@pvassalligs The error is thrown right when you attempt to open the analytics page, right? Also, can you provide me with a rough overview of what your instance looks like (number of domains, applied controls, projects, risk assessments, audits...)?

pvassalligs commented 3 months ago

@nas-tabchiche the error appears when I press the upload button, the json file is 23MB: 2 domains, no applied controls, no projects, no risk assessments, no audits. Just started in playing around and loaded a tons of libraries to view the controls. 2 users with their password.