[GH-ISSUE #895] Internal server error for the docs page #632

Closed
opened 2026-02-25 23:43:07 +03:00 by kerem · 5 comments
Owner

Originally created by @hugosxm on GitHub (Sep 22, 2023).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/895

Hi,

when I clic on the docs page I get internal server error 500, just next to "account"

Here is the log from the docker :

hcio_dashboard.1.glfdb81eqgo0@healthchecks    | Internal Server Error: /docs/
hcio_dashboard.1.glfdb81eqgo0@healthchecks    | Traceback (most recent call last):
hcio_dashboard.1.glfdb81eqgo0@healthchecks    |   File "/usr/local/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner
hcio_dashboard.1.glfdb81eqgo0@healthchecks    |     response = get_response(request)
hcio_dashboard.1.glfdb81eqgo0@healthchecks    |                ^^^^^^^^^^^^^^^^^^^^^
hcio_dashboard.1.glfdb81eqgo0@healthchecks    |   File "/usr/local/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response
hcio_dashboard.1.glfdb81eqgo0@healthchecks    |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
hcio_dashboard.1.glfdb81eqgo0@healthchecks    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
hcio_dashboard.1.glfdb81eqgo0@healthchecks    |   File "/opt/healthchecks/hc/front/views.py", line 433, in serve_doc
hcio_dashboard.1.glfdb81eqgo0@healthchecks    |     content = _replace_placeholders(doc, content)
hcio_dashboard.1.glfdb81eqgo0@healthchecks    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
hcio_dashboard.1.glfdb81eqgo0@healthchecks    |   File "/opt/healthchecks/hc/front/views.py", line 405, in _replace_placeholders
hcio_dashboard.1.glfdb81eqgo0@healthchecks    |     "SITE_HOSTNAME": site_hostname(),
hcio_dashboard.1.glfdb81eqgo0@healthchecks    |                      ^^^^^^^^^^^^^^^
hcio_dashboard.1.glfdb81eqgo0@healthchecks    |   File "/opt/healthchecks/hc/front/templatetags/hc_extras.py", line 70, in site_hostname
hcio_dashboard.1.glfdb81eqgo0@healthchecks    |     return parts[1]
hcio_dashboard.1.glfdb81eqgo0@healthchecks    |            ~~~~~^^^
hcio_dashboard.1.glfdb81eqgo0@healthchecks    | IndexError: list index out of range

I use the SITE_NAME env and tried to add a SITE_HOSTNAME env but same result.

This is not a bad bug as the product is still perfeclty usable.

I use the v2.10 official docker image. Also I have haproxy in front but I do not think this is the problem.

Originally created by @hugosxm on GitHub (Sep 22, 2023). Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/895 Hi, when I clic on the docs page I get internal server error 500, just next to "account" Here is the log from the docker : ``` hcio_dashboard.1.glfdb81eqgo0@healthchecks | Internal Server Error: /docs/ hcio_dashboard.1.glfdb81eqgo0@healthchecks | Traceback (most recent call last): hcio_dashboard.1.glfdb81eqgo0@healthchecks | File "/usr/local/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner hcio_dashboard.1.glfdb81eqgo0@healthchecks | response = get_response(request) hcio_dashboard.1.glfdb81eqgo0@healthchecks | ^^^^^^^^^^^^^^^^^^^^^ hcio_dashboard.1.glfdb81eqgo0@healthchecks | File "/usr/local/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response hcio_dashboard.1.glfdb81eqgo0@healthchecks | response = wrapped_callback(request, *callback_args, **callback_kwargs) hcio_dashboard.1.glfdb81eqgo0@healthchecks | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ hcio_dashboard.1.glfdb81eqgo0@healthchecks | File "/opt/healthchecks/hc/front/views.py", line 433, in serve_doc hcio_dashboard.1.glfdb81eqgo0@healthchecks | content = _replace_placeholders(doc, content) hcio_dashboard.1.glfdb81eqgo0@healthchecks | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ hcio_dashboard.1.glfdb81eqgo0@healthchecks | File "/opt/healthchecks/hc/front/views.py", line 405, in _replace_placeholders hcio_dashboard.1.glfdb81eqgo0@healthchecks | "SITE_HOSTNAME": site_hostname(), hcio_dashboard.1.glfdb81eqgo0@healthchecks | ^^^^^^^^^^^^^^^ hcio_dashboard.1.glfdb81eqgo0@healthchecks | File "/opt/healthchecks/hc/front/templatetags/hc_extras.py", line 70, in site_hostname hcio_dashboard.1.glfdb81eqgo0@healthchecks | return parts[1] hcio_dashboard.1.glfdb81eqgo0@healthchecks | ~~~~~^^^ hcio_dashboard.1.glfdb81eqgo0@healthchecks | IndexError: list index out of range ``` I use the SITE_NAME env and tried to add a SITE_HOSTNAME env but same result. This is not a bad bug as the product is still perfeclty usable. I use the v2.10 official docker image. Also I have haproxy in front but I do not think this is the problem.
kerem closed this issue 2026-02-25 23:43:07 +03:00
Author
Owner

@cuu508 commented on GitHub (Sep 22, 2023):

How does your SITE_ROOT setting look like, does it include scheme? i.e., is it something like https://example.com as opposed to example.com?

<!-- gh-comment-id:1731108588 --> @cuu508 commented on GitHub (Sep 22, 2023): How does your `SITE_ROOT` setting look like, does it include scheme? i.e., is it something like `https://example.com` as opposed to `example.com`?
Author
Owner

@hugosxm commented on GitHub (Sep 22, 2023):

It fixed the problem.... sorry for that ! Thanks !

<!-- gh-comment-id:1731176430 --> @hugosxm commented on GitHub (Sep 22, 2023): It fixed the problem.... sorry for that ! Thanks !
Author
Owner

@cuu508 commented on GitHub (Sep 22, 2023):

Happy to hear that! So was the problem indeed a missing http:// or https:// prefix in the SITE_ROOT value?

<!-- gh-comment-id:1731212581 --> @cuu508 commented on GitHub (Sep 22, 2023): Happy to hear that! So was the problem indeed a missing `http://` or `https://` prefix in the `SITE_ROOT` value?
Author
Owner

@hugosxm commented on GitHub (Sep 22, 2023):

Yes it was missing the scheme I added https:// in front of it

<!-- gh-comment-id:1731338193 --> @hugosxm commented on GitHub (Sep 22, 2023): Yes it was missing the scheme I added `https://` in front of it
Author
Owner

@cuu508 commented on GitHub (Sep 22, 2023):

We could check for this in a System check and refuse to start up if SITE_ROOT does not have the expected format.

I'll reopen this and close once implemented (or it turns out not to be a good idea after all).

<!-- gh-comment-id:1731346009 --> @cuu508 commented on GitHub (Sep 22, 2023): We could check for this in a [System check](https://docs.djangoproject.com/en/4.2/topics/checks/) and refuse to start up if `SITE_ROOT` does not have the expected format. I'll reopen this and close once implemented (or it turns out not to be a good idea after all).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/healthchecks#632
No description provided.