Double, triple-checked everything:
- Django is
3.1.3 version
- Rerun everything as you mentioned step by step
- Still the same 500 error (only this time packages exist and previous error dissipated)
Here is the error (that previously also occurred):
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
2024-09-03 17:35:51.264906 [UID:1001][1929473] packetLen < 0
Basically what this issue means is that Django’s app registry is being populated more than once.
So this is a good news. Now for the sake of finding out what is the real reason for this - I changed in django/apps/registry.py:
raise RuntimeError("populate() isn't reentrant")
to
self.app_configs = {}
to allow Django continue loading.
Now 500 error disapeared and I tried to install CSF again and got this error during installation:
local variable 'cPort' referenced before assignment [404]Downloading CSF..
Checking out stderr.log i got that module signals is missing:
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 124, in populate
app_config.ready()
File "/usr/local/CyberCP/configservercsf/apps.py", line 10, in ready
import signals
ModuleNotFoundError: No module named 'signals'
2024-09-03 17:52:20.291332 [UID:1001][1972596] packetLen < 0
Continuing investigating… Update coming soon…
[UPDATE]
So the issue lies within /usr/local/CyberCP/configservcsf/ as suspected.
I installed signals and after restart got this error:
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/CyberCP/lib/python3.10/site-packages/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
File "/usr/local/CyberCP/lib/python3.10/site-packages/django/utils/deprecation.py", line 134, in __call__
response = response or self.get_response(request)
File "/usr/local/CyberCP/lib/python3.10/site-packages/django/core/handlers/exception.py", line 57, in inner
response = response_for_exception(request, exc)
File "/usr/local/CyberCP/lib/python3.10/site-packages/django/core/handlers/exception.py", line 140, in response_for_exception
response = handle_uncaught_exception(
File "/usr/local/CyberCP/lib/python3.10/site-packages/django/core/handlers/exception.py", line 184, in handle_uncaught_exception
callback = resolver.resolve_error_handler(500)
File "/usr/local/CyberCP/lib/python3.10/site-packages/django/urls/resolvers.py", line 729, in resolve_error_handler
callback = getattr(self.urlconf_module, "handler%s" % view_type, None)
File "/usr/local/CyberCP/lib/python3.10/site-packages/django/utils/functional.py", line 57, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/usr/local/CyberCP/lib/python3.10/site-packages/django/urls/resolvers.py", line 708, in urlconf_module
return import_module(self.urlconf_name)
File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/usr/local/CyberCP/CyberCP/urls.py", line 40, in <module>
url(r'^configservercsf/',include('configservercsf.urls')),
NameError: name 'url' is not defined
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/CyberCP/lib/python3.10/site-packages/django/core/handlers/wsgi.py", line 124, in __call__
response = self.get_response(request)
File "/usr/local/CyberCP/lib/python3.10/site-packages/django/core/handlers/base.py", line 140, in get_response
response = self._middleware_chain(request)
File "/usr/local/CyberCP/lib/python3.10/site-packages/django/core/handlers/exception.py", line 57, in inner
response = response_for_exception(request, exc)
File "/usr/local/CyberCP/lib/python3.10/site-packages/django/core/handlers/exception.py", line 140, in response_for_exception
response = handle_uncaught_exception(
File "/usr/local/CyberCP/lib/python3.10/site-packages/django/core/handlers/exception.py", line 184, in handle_uncaught_exception
callback = resolver.resolve_error_handler(500)
File "/usr/local/CyberCP/lib/python3.10/site-packages/django/urls/resolvers.py", line 729, in resolve_error_handler
callback = getattr(self.urlconf_module, "handler%s" % view_type, None)
File "/usr/local/CyberCP/lib/python3.10/site-packages/django/utils/functional.py", line 57, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/usr/local/CyberCP/lib/python3.10/site-packages/django/urls/resolvers.py", line 708, in urlconf_module
return import_module(self.urlconf_name)
File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/usr/local/CyberCP/CyberCP/urls.py", line 40, in <module>
url(r'^configservercsf/',include('configservercsf.urls')),
NameError: name 'url' is not define
I suspect its configuration issue from CyberCP side. I’m not confident in messing around CyberCP and configservcsf urls.py atm, so I’ll take a break, look around and maybe continue once I figure out why CSF installation doesn’t provide correct URLs or why CyberCP doesn’t load csf correctly.
That’s it from me now. Hope somebody will have better luck debugging this.
Again, Thanks @sajetek_developer for your effort. 