PackStack gets “Failed to load plugin from file prescript_000.py” error
เมื่อทำการรัน packstack เพื่อ install openstack แล้วพบ error เหมือนด้านล่าง
[root@openstack-liberty1 ~]# packstack --answer-file=answers.txt
ERROR:root:Failed to load plugin from file prescript_000.py
ERROR:root:Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/packstack/installer/run_setup.py", line 884, in loadPlugins
moduleobj = __import__(moduleToLoad)
File "/usr/lib/python2.7/site-packages/packstack/plugins/prescript_000.py", line 35, in
from packstack.modules.documentation import update_params_usage
File "/usr/lib/python2.7/site-packages/packstack/modules/documentation.py", line 20, in
from docutils import core
File "/usr/lib/python2.7/site-packages/docutils/core.py", line 20, in
from docutils import frontend, io, utils, readers, writers
File "/usr/lib/python2.7/site-packages/docutils/frontend.py", line 41, in
import docutils.utils
File "/usr/lib/python2.7/site-packages/docutils/utils/__init__.py", line 20, in
import docutils.io
File "/usr/lib/python2.7/site-packages/docutils/io.py", line 18, in
from docutils.utils.error_reporting import locale_encoding, ErrorString, ErrorOutput
File "/usr/lib/python2.7/site-packages/docutils/utils/error_reporting.py", line 46, in
locale_encoding = locale.getlocale()[1] or locale.getdefaultlocale()[1]
File "/usr/lib64/python2.7/locale.py", line 511, in getdefaultlocale
return _parse_localename(localename)
File "/usr/lib64/python2.7/locale.py", line 443, in _parse_localename
raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8
ERROR:root:Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/packstack/installer/run_setup.py", line 949, in main
loadPlugins()
File "/usr/lib/python2.7/site-packages/packstack/installer/run_setup.py", line 892, in loadPlugins
raise Exception("Failed to load plugin from file %s" % item)
Exception: Failed to load plugin from file prescript_000.py
ERROR : Failed to load plugin from file prescript_000.py
Traceback (most recent call last):
File "/usr/bin/packstack", line 15, in
run_setup.main()
File "/usr/lib/python2.7/site-packages/packstack/installer/run_setup.py", line 1019, in main
print(output_messages.ERR_CHECK_LOG_FILE_FOR_MORE_INFO % (logFile))
UnboundLocalError: local variable 'logFile' referenced before assignment
วิธีแก้ไขให้รัน
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
แล้วแก้ไขไฟล์ ~/.bash_profile และเพิ่มคำสั่งด้านล่างลงไป เพื่อให้ครั้งต่อไปเมื่อ login เข้ามาระบบจะทำการ export ให้อัตโนมัติครับ
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8