Cobbler 登录web界面提示报错“Internal Server Error”

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Cobbler 登录web界面提示报错“Internal Server Error”相关的知识,希望对你有一定的参考价值。

在访问cobbler web界面到时候出现以下提示
技术分享图片

ssl的报错日志如下:

[[email protected] ~]# tail -f /var/log/httpd/ssl_error_log
[Mon Jan 07 16:24:53.363029 2019] [:error] [pid 3383] [remote 10.0.0.1:212]     mod = importlib.import_module(self.SETTINGS_MODULE)
[Mon Jan 07 16:24:53.363032 2019] [:error] [pid 3383] [remote 10.0.0.1:212]   File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
[Mon Jan 07 16:24:53.363084 2019] [:error] [pid 3383] [remote 10.0.0.1:212]     __import__(name)
[Mon Jan 07 16:24:53.363089 2019] [:error] [pid 3383] [remote 10.0.0.1:212]   File "/usr/share/cobbler/web/settings.py", line 89, in <module>
[Mon Jan 07 16:24:53.363097 2019] [:error] [pid 3383] [remote 10.0.0.1:212]     from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS
[Mon Jan 07 16:24:53.363124 2019] [:error] [pid 3383] [remote 10.0.0.1:212] ImportError: cannot import name TEMPLATE_CONTEXT_PROCESSORS

查看cobbler的py配置文件

[[email protected] ~]# sed -n ‘38,41p‘ /usr/share/cobbler/web/settings.py
if django.VERSION[0] == 1 and django.VERSION[1] < 4:
    ADMIN_MEDIA_PREFIX = ‘/media/‘
else:
    STATIC_URL = ‘/media/

[[email protected] ~]# sed -n ‘89p‘ /usr/share/cobbler/web/settings.py
from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS

初步判断应该是pythone-django版本问题

#下载pip.py
wget https://bootstrap.pypa.io/get-pip.py

#调用本地python运行pip.py脚本
python get-pip.py

#安装pip
pip install Django==1.8.9

#查看pip版本号
python -c "import django; print(django.get_version())"

#重启httpd
systemctl restart httpd

最后完美解决
技术分享图片

以上是关于Cobbler 登录web界面提示报错“Internal Server Error”的主要内容,如果未能解决你的问题,请参考以下文章

Cobbler自动装机,Cobbler Web管理的两种认证方式登录

Cobbler 全自动化安装简介Web界面管理附送源码包

COBBLER无人值守安装

cobbler部署

Cobbler无人值守安装

COBBLER无人值守安装