500 error after saving base template multiple times

Hi there.

After visiting https://:8090/base/design and saving my edits multiple times, suddently I’m greeted with 500 error page with following error trace:


Request Method: GET
Request URL: https://<domain>:8090/base/design

Django Version: 3.1.3
Python Version: 3.10.12


Traceback (most recent call last):
  File "/usr/local/CyberCP/lib/python3.10/site-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "/usr/local/CyberCP/lib/python3.10/site-packages/django/core/handlers/base.py", line 179, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/CyberCP/lib/python3.10/site-packages/django/utils/decorators.py", line 130, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/usr/local/CyberCP/baseTemplate/views.py", line 312, in design
    sha = sha_res.json()[0]['sha']

Exception Type: KeyError at /base/design
Exception Value: 0

I tried to:

  • Double checked, that CSS code has no errors (works on other server’s CyberPanel);
  • Restart lscpd.service - error persists;
  • Restart server - error persists;
  • Remove CSS style from database table baseTemplate_cyberpanelcosmetic - error persists;
  • Upgraded CyberPanel - error persists;

Error is comming from file /usr/local/CyberCP/baseTemplate/views.py on line 312

How can I revert this or workaround it?


Both - removing CSS style from database table baseTemplate_cyberpanelcosmetic AND upgrading CyberPanel seems to have solved the issue, but when I start editing template’s CSS, after ~10 time saving it again crashes with the same error and no restart or resetting baseTemplate will fix it.