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

Internal Server Error: /dashboard/ #158

Closed
jarylc opened this issue Jun 25, 2021 · 4 comments
Closed

Internal Server Error: /dashboard/ #158

jarylc opened this issue Jun 25, 2021 · 4 comments

Comments

@jarylc
Copy link
Contributor

jarylc commented Jun 25, 2021

Version

official docker image - v0.10.0

Stacktrace

ERROR Internal Server Error: /dashboard/
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/lib/python3.9/site-packages/django/views/generic/base.py", line 70, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/django/contrib/auth/mixins.py", line 52, in dispatch
    return super().dispatch(request, *args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/django/views/generic/base.py", line 98, in dispatch
    return handler(request, *args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/django/views/generic/list.py", line 157, in get
    context = self.get_context_data()
  File "/usr/src/shynet/dashboard/views.py", line 39, in get_context_data
    service.stats = service.get_core_stats(
  File "/usr/src/shynet/core/models.py", line 116, in get_core_stats
    main_data = self.get_relative_stats(start_time, end_time)
  File "/usr/src/shynet/core/models.py", line 203, in get_relative_stats
    chart_data, chart_tooltip_format, chart_granularity = self._get_chart_data(
  File "/usr/src/shynet/core/models.py", line 295, in _get_chart_data
    chart_data[k["date"]]["hits"] = k["count"]
KeyError: datetime.date(2021, 6, 26)

Remediation

I had to delete some session data and was able to access the dashboard again, should've investigated which data exactly was causing this, but the data is gone now.

@haaavk
Copy link
Contributor

haaavk commented Jun 26, 2021

Thanks for bug report.
I will investigate this.

@haaavk
Copy link
Contributor

haaavk commented Jun 26, 2021

The problem are days with hits and without sessions. It's quite rare case.
It may occur if today's hit is related to session from yesterday and there is no new session today.
I see two solutions:

  1. Add extra if statement and display days with hits and without sessions.
    (It will never occur with AGGRESSIVE_HASH_SALTING = True)
  2. Categorize hits by related session start_time.

I will choose first solution unless someone has different opinion.

@milesmcc
Copy link
Owner

The problem are days with hits and without sessions. It's quite rare case.
It may occur if today's hit is related to session from yesterday and there is no new session today.
I see two solutions:

  1. Add extra if statement and display days with hits and without sessions.
    (It will never occur with AGGRESSIVE_HASH_SALTING = True)
  2. Categorize hits by related session start_time.

I will choose first solution unless someone has different opinion.

Solution 1 sounds good!

@wvffle
Copy link
Contributor

wvffle commented Jul 22, 2021

Shouldn't this be closed by now?

@haaavk: If you put fix #158 in the commit message or PR body, it will close the issue automatically when the PR is merged.
As far as I remember, it also works on close, closes, resolve and resolves

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