Describe the bug
Cyberpanel admin panel returns 500 internal server error
error page. After upgrading, everything works for a while (couple days, weeks) and then again, returns 500 internal server error
error page.
To Reproduce
What steps did you take when the issue occurred?
- Upgraded to latest build and commit using
sudo su - -c "sh <(curl https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/preUpgrade.sh || wget -O - https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/preUpgrade.sh)
; - Do nothing (wait couple days.. or weeks);
500 internal server error
error page appears in Cyberpanel admin panel;
Expected behavior
To return Cyberpanel admin panel page (successful).
Screenshots
Operating system:
Ubuntu 22.04.5 LTS
CyberPanel version:
version v2.3.9
, commit: 33cc6ba1dad4b805767a794ac79b4f3c144adea8
Additional context
After investigating/tailing tail -f /home/cyberpanel/stderr.log
error log file and refreshing the page, I got the following error:
Traceback (most recent call last):
File "/usr/local/CyberCP/CyberCP/wsgi.py", line 17, in <module>
application = get_wsgi_application()
File "/usr/local/CyberCP/lib/python3.10/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
django.setup(set_prefix=False)
File "/usr/local/CyberCP/lib/python3.10/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/local/CyberCP/lib/python3.10/site-packages/django/apps/registry.py", line 83, in populate
raise RuntimeError("populate() isn't reentrant")
RuntimeError: populate() isn't reentrant
After some research, I followed this suggestion to debug the error: https://stackoverflow.com/a/55929118/1097415. What I did was:
- I opened up
/usr/local/CyberCP/lib/python3.10/site-packages/django/apps/registry.py
line83
, commented outraise RuntimeError("populate() isn't reentrant")
and replaced it withself.app_configs = {}
; - Then I started tailing /home/cyberpanel/stderr.log
again with
tail -f /home/cyberpanel/stderr.logand restarted Cyberpanel
systemctl restart lscpd.service` and refreshed the admin panel page;
Now, when inspecting error log, I finally found the issue:
Traceback (most recent call last):
File "/usr/local/CyberCP/CyberCP/wsgi.py", line 17, in <module>
application = get_wsgi_application()
File "/usr/local/CyberCP/lib/python3.10/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
django.setup(set_prefix=False)
File "/usr/local/CyberCP/lib/python3.10/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/local/CyberCP/lib/python3.10/site-packages/django/apps/registry.py", line 125, in populate
app_config.ready()
File "/usr/local/CyberCP/configservercsf/apps.py", line 10, in ready
import signals
ModuleNotFoundError: No module named 'signals'
Longstoryshort - No module named 'signals'
in file /usr/local/CyberCP/configservercsf/apps.py
is the issue.
Here is the Cyberpanel GitHub issue link: https://github.com/usmannasir/cyberpanel/issues/1423