larrabee / freeipa-password-reset

Self-service password reset app for FreeIPA
GNU General Public License v3.0
90 stars 31 forks source link

Trouble Running manage.py runserver for CentOS 8 (Python 3.6) #32

Closed jessiebryan closed 4 years ago

jessiebryan commented 4 years ago

I tried to install this on a CentOS 8 and ran into a few minor issues that I was able to work around (namely how virtualenv is created).

Now I am having an issue when launching the service - I have a traceback:

Performing system checks...

Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x7fae242d4378>
Traceback (most recent call last):
  File "/opt/apps/freeipa-password-reset/virtualenv/lib64/python3.6/site-packages/django/utils/autoreload.py", line 228, in wrapper
    fn(*args, **kwargs)
  File "/opt/apps/freeipa-password-reset/virtualenv/lib64/python3.6/site-packages/django/core/management/commands/runserver.py", line 124, in inner_run
    self.check(display_num_errors=True)
  File "/opt/apps/freeipa-password-reset/virtualenv/lib64/python3.6/site-packages/django/core/management/base.py", line 359, in check
    include_deployment_checks=include_deployment_checks,
  File "/opt/apps/freeipa-password-reset/virtualenv/lib64/python3.6/site-packages/django/core/management/base.py", line 346, in _run_checks
    return checks.run_checks(**kwargs)
  File "/opt/apps/freeipa-password-reset/virtualenv/lib64/python3.6/site-packages/django/core/checks/registry.py", line 81, in run_checks
    new_errors = check(app_configs=app_configs)
  File "/opt/apps/freeipa-password-reset/virtualenv/lib64/python3.6/site-packages/django/core/checks/urls.py", line 16, in check_url_config
    return check_resolver(resolver)
  File "/opt/apps/freeipa-password-reset/virtualenv/lib64/python3.6/site-packages/django/core/checks/urls.py", line 26, in check_resolver
    return check_method()
  File "/opt/apps/freeipa-password-reset/virtualenv/lib64/python3.6/site-packages/django/urls/resolvers.py", line 256, in check
    for pattern in self.url_patterns:
  File "/opt/apps/freeipa-password-reset/virtualenv/lib64/python3.6/site-packages/django/utils/functional.py", line 35, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/opt/apps/freeipa-password-reset/virtualenv/lib64/python3.6/site-packages/django/urls/resolvers.py", line 407, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "/opt/apps/freeipa-password-reset/virtualenv/lib64/python3.6/site-packages/django/utils/functional.py", line 35, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/opt/apps/freeipa-password-reset/virtualenv/lib64/python3.6/site-packages/django/urls/resolvers.py", line 400, in urlconf_module
    return import_module(self.urlconf_name)
  File "/usr/lib64/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/opt/apps/freeipa-password-reset/PasswordReset/PasswordReset/urls.py", line 20, in <module>
    url(r'reset/', include('app.urls')),
  File "/opt/apps/freeipa-password-reset/virtualenv/lib64/python3.6/site-packages/django/conf/urls/__init__.py", line 50, in include
    urlconf_module = import_module(urlconf_module)
  File "/usr/lib64/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/opt/apps/freeipa-password-reset/PasswordReset/app/urls.py", line 2, in <module>
    from . import views
  File "/opt/apps/freeipa-password-reset/PasswordReset/app/views.py", line 10, in <module>
    from pwdmanager import *
ModuleNotFoundError: No module named 'pwdmanager'

Any feedback on this would be great, thank you!

larrabee commented 4 years ago

Hello. This error was fixed in master.

jessiebryan commented 4 years ago

Thanks! - I am no longer having that traceback. The server is running and returning "Server Error (500)"

Where can I get more detail about its issue? I manually invoked the daemon and watched my browser connect but there are no errors to console/stdout.

larrabee commented 4 years ago

You can set Debug = True in settings.py. It's enables stack traces.

asohh commented 4 years ago

Hey,

I get a 500 Error because of this: 'dict' object has no attribute 'iteritems'

Python 3 removed the function iteritems. Instead they added items.

I tried that locally and its showing the website now.

According to this https://stackoverflow.com/a/39432244, the items function also works in python2 (its just a but slower).

larrabee commented 4 years ago

Eah, forgot commit this change. Thanks for feedback ;)

jessiebryan commented 4 years ago

The website is loading now, Thank You @larrabee and @asohh for the assistance.