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

Error 500 on analytics #613

Open
pvassalligs opened this issue Jul 4, 2024 · 9 comments
Open

Error 500 on analytics #613

pvassalligs opened this issue Jul 4, 2024 · 9 comments
Assignees
Labels
question Further information is requested

Comments

@pvassalligs
Copy link

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):

  • Device: ubuntu
  • OS: 24.04
  • Browser chrome
  • Version 126.0.6478.127 version 64 bit
@eric-intuitem
Copy link
Collaborator

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

@ab-smith ab-smith added the question Further information is requested label Jul 6, 2024
@pvassalligs
Copy link
Author

Unfortunately the error is persistent...

@pvassalligs
Copy link
Author

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
Copy link

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
Copy link
Contributor

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
Copy link
Author

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_raw_body (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
Copy link
Contributor

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

@nas-tabchiche
Copy link
Contributor

nas-tabchiche commented Aug 19, 2024

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
Copy link
Author

@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.

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

No branches or pull requests

5 participants