Search code examples
deploymentkiwi-tcms

500 errors after updating local_settings.py


I'm deploying Kiwi for the first time and I'm coming up against some issues. The standard deployment works fine: I can run the docker, log in, etc.

Once I tried configuring the deployment, though, I've run into a lot of problems.

If I try to disable the Internal Bug Tracker, I get the following error when trying to launch any page in the site:

web_1  | [Thu Feb 06 16:23:32.612335 2020] [wsgi:error] [pid 11:tid 140443152291584] [remote 192.168.105.200:52787] mod_wsgi (pid=11): Failed to exec Python script file '/venv/lib64/python3.6/site-packages/tcms/wsgi.py'.
web_1  | [Thu Feb 06 16:23:32.612409 2020] [wsgi:error] [pid 11:tid 140443152291584] [remote 192.168.105.200:52787] mod_wsgi (pid=11): Exception occurred processing WSGI script '/venv/lib64/python3.6/site-packages/tcms/wsgi.py'.
web_1  | [Thu Feb 06 16:23:32.613673 2020] [wsgi:error] [pid 11:tid 140443152291584] [remote 192.168.105.200:52787] Traceback (most recent call last):
web_1  | [Thu Feb 06 16:23:32.613895 2020] [wsgi:error] [pid 11:tid 140443152291584] [remote 192.168.105.200:52787]   File "/venv/lib64/python3.6/site-packages/tcms/wsgi.py", line 40, in <module>
web_1  | [Thu Feb 06 16:23:32.613913 2020] [wsgi:error] [pid 11:tid 140443152291584] [remote 192.168.105.200:52787]     _APPLICATION = get_wsgi_application()
web_1  | [Thu Feb 06 16:23:32.613922 2020] [wsgi:error] [pid 11:tid 140443152291584] [remote 192.168.105.200:52787]   File "/venv/lib64/python3.6/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
web_1  | [Thu Feb 06 16:23:32.613925 2020] [wsgi:error] [pid 11:tid 140443152291584] [remote 192.168.105.200:52787]     django.setup(set_prefix=False)
web_1  | [Thu Feb 06 16:23:32.613930 2020] [wsgi:error] [pid 11:tid 140443152291584] [remote 192.168.105.200:52787]   File "/venv/lib64/python3.6/site-packages/django/__init__.py", line 24, in setup
web_1  | [Thu Feb 06 16:23:32.613933 2020] [wsgi:error] [pid 11:tid 140443152291584] [remote 192.168.105.200:52787]     apps.populate(settings.INSTALLED_APPS)
web_1  | [Thu Feb 06 16:23:32.613938 2020] [wsgi:error] [pid 11:tid 140443152291584] [remote 192.168.105.200:52787]   File "/venv/lib64/python3.6/site-packages/django/apps/registry.py", line 91, in populate
web_1  | [Thu Feb 06 16:23:32.613941 2020] [wsgi:error] [pid 11:tid 140443152291584] [remote 192.168.105.200:52787]     app_config = AppConfig.create(entry)
web_1  | [Thu Feb 06 16:23:32.613945 2020] [wsgi:error] [pid 11:tid 140443152291584] [remote 192.168.105.200:52787]   File "/venv/lib64/python3.6/site-packages/django/apps/config.py", line 90, in create
web_1  | [Thu Feb 06 16:23:32.614502 2020] [wsgi:error] [pid 11:tid 140443152291584] [remote 192.168.105.200:52787]     module = import_module(entry)
web_1  | [Thu Feb 06 16:23:32.614532 2020] [wsgi:error] [pid 11:tid 140443152291584] [remote 192.168.105.200:52787]   File "/venv/lib64/python3.6/importlib/__init__.py", line 126, in import_module
web_1  | [Thu Feb 06 16:23:32.614537 2020] [wsgi:error] [pid 11:tid 140443152291584] [remote 192.168.105.200:52787]     return _bootstrap._gcd_import(name[level:], package, level)
web_1  | [Thu Feb 06 16:23:32.614543 2020] [wsgi:error] [pid 11:tid 140443152291584] [remote 192.168.105.200:52787]   File "<frozen importlib._bootstrap>", line 994, in _gcd_import
web_1  | [Thu Feb 06 16:23:32.614548 2020] [wsgi:error] [pid 11:tid 140443152291584] [remote 192.168.105.200:52787]   File "<frozen importlib._bootstrap>", line 971, in _find_and_load
web_1  | [Thu Feb 06 16:23:32.614818 2020] [wsgi:error] [pid 11:tid 140443152291584] [remote 192.168.105.200:52787]   File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
web_1  | [Thu Feb 06 16:23:32.614843 2020] [wsgi:error] [pid 11:tid 140443152291584] [remote 192.168.105.200:52787] ModuleNotFoundError: No module named 'colorfield'
web_1  | 192.168.105.200 - - [06/Feb/2020:16:23:31 +0000] "GET / HTTP/1.1" 500 527 "https://192.168.105.25/accounts/login/?next=/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0"
web_1  | [Thu Feb 06 16:24:00.126930 2020] [wsgi:error] [pid 11:tid 140443034793728] [remote 192.168.105.200:52792] mod_wsgi (pid=11): Failed to exec Python script file '/venv/lib64/python3.6/site-packages/tcms/wsgi.py'.
web_1  | [Thu Feb 06 16:24:00.127061 2020] [wsgi:error] [pid 11:tid 140443034793728] [remote 192.168.105.200:52792] mod_wsgi (pid=11): Exception occurred processing WSGI script '/venv/lib64/python3.6/site-packages/tcms/wsgi.py'.
web_1  | [Thu Feb 06 16:24:00.127397 2020] [wsgi:error] [pid 11:tid 140443034793728] [remote 192.168.105.200:52792] Traceback (most recent call last):
web_1  | [Thu Feb 06 16:24:00.127491 2020] [wsgi:error] [pid 11:tid 140443034793728] [remote 192.168.105.200:52792]   File "/venv/lib64/python3.6/site-packages/tcms/wsgi.py", line 40, in <module>
web_1  | [Thu Feb 06 16:24:00.127501 2020] [wsgi:error] [pid 11:tid 140443034793728] [remote 192.168.105.200:52792]     _APPLICATION = get_wsgi_application()
web_1  | [Thu Feb 06 16:24:00.127514 2020] [wsgi:error] [pid 11:tid 140443034793728] [remote 192.168.105.200:52792]   File "/venv/lib64/python3.6/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
web_1  | [Thu Feb 06 16:24:00.127519 2020] [wsgi:error] [pid 11:tid 140443034793728] [remote 192.168.105.200:52792]     django.setup(set_prefix=False)
web_1  | [Thu Feb 06 16:24:00.127529 2020] [wsgi:error] [pid 11:tid 140443034793728] [remote 192.168.105.200:52792]   File "/venv/lib64/python3.6/site-packages/django/__init__.py", line 24, in setup
web_1  | [Thu Feb 06 16:24:00.127534 2020] [wsgi:error] [pid 11:tid 140443034793728] [remote 192.168.105.200:52792]     apps.populate(settings.INSTALLED_APPS)
web_1  | [Thu Feb 06 16:24:00.127543 2020] [wsgi:error] [pid 11:tid 140443034793728] [remote 192.168.105.200:52792]   File "/venv/lib64/python3.6/site-packages/django/apps/registry.py", line 83, in populate
web_1  | [Thu Feb 06 16:24:00.127548 2020] [wsgi:error] [pid 11:tid 140443034793728] [remote 192.168.105.200:52792]     raise RuntimeError("populate() isn't reentrant")

Trying to remove the Bug entries in the menus threw a completely different error (didn't keep a copy of the log).

As far as I can tell the Debug option has never worked, I don't get the detailed 500 errors on the browser.

I got a little bit desperate and pasted the whole common file into local_settings.py to see if there was something I was doing wrong and got the following error:

web_1  | [Thu Feb 06 16:44:45.990672 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696] mod_wsgi (pid=10): Failed to exec Python script file '/venv/lib64/python3.6/site-packages/tcms/wsgi.py'.
web_1  | [Thu Feb 06 16:44:45.990740 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696] mod_wsgi (pid=10): Exception occurred processing WSGI script '/venv/lib64/python3.6/site-packages/tcms/wsgi.py'.
web_1  | [Thu Feb 06 16:44:45.991753 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696] Traceback (most recent call last):
web_1  | [Thu Feb 06 16:44:45.991853 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696]   File "/venv/lib64/python3.6/site-packages/tcms/wsgi.py", line 40, in <module>
web_1  | [Thu Feb 06 16:44:45.991863 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696]     _APPLICATION = get_wsgi_application()
web_1  | [Thu Feb 06 16:44:45.991872 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696]   File "/venv/lib64/python3.6/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
web_1  | [Thu Feb 06 16:44:45.991877 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696]     django.setup(set_prefix=False)
web_1  | [Thu Feb 06 16:44:45.991883 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696]   File "/venv/lib64/python3.6/site-packages/django/__init__.py", line 19, in setup
web_1  | [Thu Feb 06 16:44:45.991904 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696]     configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
web_1  | [Thu Feb 06 16:44:45.991917 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696]   File "/venv/lib64/python3.6/site-packages/django/conf/__init__.py", line 76, in __getattr__
web_1  | [Thu Feb 06 16:44:45.991933 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696]     self._setup(name)
web_1  | [Thu Feb 06 16:44:45.991942 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696]   File "/venv/lib64/python3.6/site-packages/django/conf/__init__.py", line 63, in _setup
web_1  | [Thu Feb 06 16:44:45.991946 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696]     self._wrapped = Settings(settings_module)
web_1  | [Thu Feb 06 16:44:45.991952 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696]   File "/venv/lib64/python3.6/site-packages/django/conf/__init__.py", line 142, in __init__
web_1  | [Thu Feb 06 16:44:45.991954 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696]     mod = importlib.import_module(self.SETTINGS_MODULE)
web_1  | [Thu Feb 06 16:44:45.991959 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696]   File "/venv/lib64/python3.6/importlib/__init__.py", line 126, in import_module
web_1  | [Thu Feb 06 16:44:45.991964 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696]     return _bootstrap._gcd_import(name[level:], package, level)
web_1  | [Thu Feb 06 16:44:45.991969 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696]   File "<frozen importlib._bootstrap>", line 994, in _gcd_import
web_1  | [Thu Feb 06 16:44:45.991977 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696]   File "<frozen importlib._bootstrap>", line 971, in _find_and_load
web_1  | [Thu Feb 06 16:44:45.991982 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696]   File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
web_1  | [Thu Feb 06 16:44:45.991990 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696]   File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
web_1  | [Thu Feb 06 16:44:45.992008 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696]   File "<frozen importlib._bootstrap_external>", line 678, in exec_module
web_1  | [Thu Feb 06 16:44:45.992015 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696]   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
web_1  | [Thu Feb 06 16:44:45.992037 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696]   File "/venv/lib64/python3.6/site-packages/tcms/settings/product.py", line 13, in <module>
web_1  | [Thu Feb 06 16:44:45.992041 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696]     from .local_settings import *  # noqa: F401,F403
web_1  | [Thu Feb 06 16:44:45.992047 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696]   File "/venv/lib64/python3.6/site-packages/tcms/settings/local_settings.py", line 35, in <module>
web_1  | [Thu Feb 06 16:44:45.992051 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696]     for plugin in pkg_resources.iter_entry_points('kiwitcms.plugins'):
web_1  | [Thu Feb 06 16:44:45.992070 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696] NameError: name 'pkg_resources' is not defined
web_1  | 192.168.105.200 - - [06/Feb/2020:16:44:45 +0000] "GET / HTTP/1.1" 500 527 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0"
web_1  | [Thu Feb 06 16:44:59.226706 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698] mod_wsgi (pid=10): Failed to exec Python script file '/venv/lib64/python3.6/site-packages/tcms/wsgi.py'.
web_1  | [Thu Feb 06 16:44:59.226766 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698] mod_wsgi (pid=10): Exception occurred processing WSGI script '/venv/lib64/python3.6/site-packages/tcms/wsgi.py'.
web_1  | [Thu Feb 06 16:44:59.226974 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698] Traceback (most recent call last):
web_1  | [Thu Feb 06 16:44:59.227041 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698]   File "/venv/lib64/python3.6/site-packages/tcms/wsgi.py", line 40, in <module>
web_1  | [Thu Feb 06 16:44:59.227047 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698]     _APPLICATION = get_wsgi_application()
web_1  | [Thu Feb 06 16:44:59.227053 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698]   File "/venv/lib64/python3.6/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
web_1  | [Thu Feb 06 16:44:59.227056 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698]     django.setup(set_prefix=False)
web_1  | [Thu Feb 06 16:44:59.227061 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698]   File "/venv/lib64/python3.6/site-packages/django/__init__.py", line 19, in setup
web_1  | [Thu Feb 06 16:44:59.227064 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698]     configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
web_1  | [Thu Feb 06 16:44:59.227069 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698]   File "/venv/lib64/python3.6/site-packages/django/conf/__init__.py", line 76, in __getattr__
web_1  | [Thu Feb 06 16:44:59.227072 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698]     self._setup(name)
web_1  | [Thu Feb 06 16:44:59.227077 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698]   File "/venv/lib64/python3.6/site-packages/django/conf/__init__.py", line 63, in _setup
web_1  | [Thu Feb 06 16:44:59.227079 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698]     self._wrapped = Settings(settings_module)
web_1  | [Thu Feb 06 16:44:59.227084 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698]   File "/venv/lib64/python3.6/site-packages/django/conf/__init__.py", line 142, in __init__
web_1  | [Thu Feb 06 16:44:59.227087 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698]     mod = importlib.import_module(self.SETTINGS_MODULE)
web_1  | [Thu Feb 06 16:44:59.227092 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698]   File "/venv/lib64/python3.6/importlib/__init__.py", line 126, in import_module
web_1  | [Thu Feb 06 16:44:59.227094 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698]     return _bootstrap._gcd_import(name[level:], package, level)
web_1  | [Thu Feb 06 16:44:59.227099 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698]   File "<frozen importlib._bootstrap>", line 994, in _gcd_import
web_1  | [Thu Feb 06 16:44:59.227104 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698]   File "<frozen importlib._bootstrap>", line 971, in _find_and_load
web_1  | [Thu Feb 06 16:44:59.227109 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698]   File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
web_1  | [Thu Feb 06 16:44:59.227114 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698]   File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
web_1  | [Thu Feb 06 16:44:59.227119 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698]   File "<frozen importlib._bootstrap_external>", line 678, in exec_module
web_1  | [Thu Feb 06 16:44:59.227124 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698]   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
web_1  | [Thu Feb 06 16:44:59.227133 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698]   File "/venv/lib64/python3.6/site-packages/tcms/settings/product.py", line 13, in <module>
web_1  | [Thu Feb 06 16:44:59.227136 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698]     from .local_settings import *  # noqa: F401,F403
web_1  | [Thu Feb 06 16:44:59.227142 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698]   File "/venv/lib64/python3.6/site-packages/tcms/settings/local_settings.py", line 35, in <module>
web_1  | [Thu Feb 06 16:44:59.227144 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698]     for plugin in pkg_resources.iter_entry_points('kiwitcms.plugins'):
web_1  | [Thu Feb 06 16:44:59.227159 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698] NameError: name 'pkg_resources' is not defined
web_1  | 192.168.105.200 - - [06/Feb/2020:16:44:59 +0000] "GET / HTTP/1.1" 500 527 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0"

Is this a problem with my settings?

Thanks, Carlos


Solution

  • ModuleNotFoundError: No module named 'colorfield'
    

    colorfield is a new dependency that just got added couple of days ago. This means you are using the latest master branch, not a released version of Kiwi TCMS. It also means this particular dependency isn't installed in your docker image probably.

    Without further information as to which docker image are you using and how exactly are you starting it and what exactly is in your local_settings.py there's little we can do to help you.