Help update from the error panel, how can I fix it?
Error
Error: Reverse for ‘aiScannerHome’ not found. ‘aiScannerHome’ is not a valid view function or pattern name.
Help update from the error panel, how can I fix it?
Error
Error: Reverse for ‘aiScannerHome’ not found. ‘aiScannerHome’ is not a valid view function or pattern name.
One-Time Fix
Since the aiScanner tables are already being created manually in upgrade.py, the issue is likely that the aiScanner app files are missing. Here’s
the safe fix:
Solution 1: Create a Dummy View (Quick Fix)
Create a minimal aiScanner setup to satisfy the URL resolver:
Create the aiScanner directory if missing:
mkdir -p /usr/local/CyberCP/aiScanner
Create a minimal views.py:
cat > /usr/local/CyberCP/aiScanner/views.py << ‘EOF’
from django.shortcuts import render, redirect
from django.http import HttpResponse
def aiScannerHome(request):
# Redirect to home page or show a message
return redirect(‘/’)
# Or return a simple message:
# return HttpResponse(“AI Scanner module is being updated. Please check back later.”)
EOF
urlpatterns = [
path(‘’, views.aiScannerHome, name=‘aiScannerHome’),
]
EOF
Create init.py to make it a Python package:
touch /usr/local/CyberCP/aiScanner/init.py
Fix permissions:
chown -R cyberpanel:cyberpanel /usr/local/CyberCP/aiScanner/
Restart CyberPanel:
systemctl restart lscpd
Solution 2: Manually Download Only aiScanner Files (Safest)
If they want the full aiScanner functionality without affecting other files:
cd /tmp
wget https://github.com/usmannasir/cyberpanel/archive/refs/heads/stable.zip
unzip stable.zip
cp -r cyberpanel-stable/aiScanner /usr/local/CyberCP/
rm -rf stable.zip cyberpanel-stable
chown -R cyberpanel:cyberpanel /usr/local/CyberCP/aiScanner/
systemctl restart lscpd
Root Cause:
During the upgrade from an older version, the aiScanner app directory wasn’t copied to the installation, but it was added to INSTALLED_APPS and
the URLs. This creates a mismatch where Django expects the app to exist but can’t find it.