[Help Needed] CyberPanel 500 Error on Port 8090 – Anyone Facing This?

Today, both of my VPS servers (from different providers) suddenly encountered a 500 Internal Server Error when accessing CyberPanel via IP:8090.

:hammer_and_wrench: Current Situation:
:white_check_mark: Accessing IP:7080 (OpenLiteSpeed) works fine.
:white_check_mark: All websites hosted on the VPS are running normally.
:white_check_mark: SSH access is working without issues.
:x: Only CyberPanel (IP:8090) is throwing a 500 error.

I’m not sure if this is a common issue or something related to my configuration. Is anyone else experiencing the same problem? Any suggestions on how to fix it? Any help would be greatly appreciated! :pray::fire:

1 Like

Hello

The same thing is happening to me… a couple of days ago I installed CyberPanel on an ARM64 VPS to test and today I can’t access the panel… but the sites are running

When I try to connect to port 8090, I get the error “500 Internal Server Error”. Upgrading does not solve the problem.

1 Like

Remove csf:

cd /etc/csf

sh uninstall.sh

Now you can enter IP:8090

Seems a bit drastic to solve the issue but a step in the right direction, Thanks for that.
We need CSF still though.

Edit the following 2 files and comment out the lines that contain configservercsf by putting a # in the front of the line

/usr/local/CyberCP/CyberCP/settings.py
/usr/local/CyberCP/CyberCP/urls.py

Edit /usr/local/CyberCP/baseTemplate/templates/baseTemplate/index.html and comment out the line below by
Changing:

{% include “/usr/local/CyberCP/configservercsf/templates/configservercsf/menu.html” %}

to

{# {% include “/usr/local/CyberCP/configservercsf/templates/configservercsf/menu.html” %} #}

After that clear all cache and restart lscpd

find /usr/local/CyberCP/ -type d -name __pycache__ -exec rm -r {} \+; service lscpd restart && service lsws restart; killall lsphp

This will allow you to keep CSF enabled on your server but without the GUI.

After

Edit the following 2 files and comment out the lines that contain configservercsf by putting a # in the front of the line

Error

Error: /usr/local/CyberCP/configservercsf/templates/configservercsf/menu.html

Check the comment again as I have made an edit.
One other file needs to be updated

I’ve found the issue.
It seem that the CSF fixes have been reverted somehow.

If you used the temporary fix above, you will have to remove the comments we made in the 3 files first.

Put the following in a script and execute:

#!/bin/bash

#Check if the version of Cyberpanel utilizes path or url
url=0
if grep -q "import url" /usr/local/CyberCP/CyberCP/urls.py; then
	url=1
fi

#Only make the changes if the version of Cyberpanel utilizes path and not url
if [ "$url" -eq 0 ]; then
	sed -i "s/url(r'^configservercsf/path('configservercsf/g" /usr/local/CyberCP/CyberCP/urls.py
	sed -i "s/url(r'^$'/path(''/g" /usr/local/CyberCP/configservercsf/urls.py
	sed -i "s|url(r'^iframe/\$'|path('iframe/'|g" /usr/local/CyberCP/configservercsf/urls.py
	sed -i "s/from django.conf.urls import url/from django.urls import path/g" /usr/local/CyberCP/configservercsf/urls.py
fi
sed -i "s/import signals/import configservercsf.signals/g" /usr/local/CyberCP/configservercsf/apps.py

sed -i -E "s/from.*, render/from plogical.httpProc import httpProc/g" /usr/local/CyberCP/configservercsf/views.py
sed -i -E "s#^(\s*)return render.*index\.html.*#\1proc = httpProc(request, 'configservercsf/index.html', None, 'admin')\n\1return proc.render()#g" /usr/local/CyberCP/configservercsf/views.py

find /usr/local/CyberCP/ -type d -name __pycache__ -exec rm -r {} \+; service lscpd restart && service lsws restart; killall lsphp

This will fix CSF and allow you to continue using the GUI as well.

2 Likes

Thanks fix worked.
p.s. i have cyberpanel v2.3.9

Hello @sajetek_developer and everyone,

I am not sure whether this issue is caused by my VPS or if it is a common problem for those using CyberPanel.

I also tried upgrading my VPS.
During the upgrade process, I encountered an issue and resolved it using the following steps.
However, the issue reappeared after 1-2 days.

Step 1: Remove temporary v-env

bash

sudo mv /usr/local/CyberPanelTemp /usr/local/CyberPanelTemp_bak

Step 2: Update pip and setuptools

bash

sudo apt-get update  
sudo apt-get install -y python3-pip  

Upgrade pip and setuptools to a relatively stable version:

bash

sudo -i  
pip3 install --upgrade pip==22.2 setuptools==65.5.0 wheel  
exit  

Step 3: Run the CyberPanel upgrade script

bash

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

However, the issue reappeared after 1-2 days.

Thank you for the guidance, @sajetek_developer.

I have modified the two files below according to your bash script, and it has successfully fixed the issue!

  • /usr/local/CyberCP/configservercsf/apps.py
  • /usr/local/CyberCP/configservercsf/views.py