我按照以下说明进行操作http://devstack.org/guides/single-machine.html安装 OpenStack。
我首先使用官方支持的 Ubuntu 12.04 LTS Windows 安装程序在 Windows 7 PC 上安装了 Ubuntu。然后我按照上述页面上的说明安装 OpenStack。
根据说明,我应该能够访问仪表板,又名 Horizon http://192.168.1.4/
(这是我安装 Ubuntu->OpenStack 的 PC 的 IP)。
然而,当我打开它时,出现了一个 500 错误网页。
我该如何解决此错误?我想为 OpenStack 设置一个开发环境。
供您参考,现在给出了完整的错误信息--
FilterError at /
/usr/bin/env: node: No such file or directory
Request Method: GET
Request URL: http://192.168.1.4/
Django Version: 1.4.2
Exception Type: FilterError
Exception Value:
/usr/bin/env: node: No such file or directory
Exception Location: /usr/local/lib/python2.7/dist-packages/compressor/filters/base.py in input, line 133
Python Executable: /usr/bin/python
Python Version: 2.7.3
Python Path:
['/opt/stack/horizon/openstack_dashboard/wsgi/../..',
'/opt/stack/python-keystoneclient',
'/opt/stack/python-novaclient',
'/opt/stack/python-openstackclient',
'/opt/stack/keystone',
'/opt/stack/glance',
'/opt/stack/python-glanceclient/setuptools_git-0.4.2-py2.7.egg',
'/opt/stack/python-glanceclient',
'/opt/stack/nova',
'/opt/stack/horizon',
'/opt/stack/cinder',
'/opt/stack/python-cinderclient',
'/usr/local/lib/python2.7/dist-packages',
'/usr/lib/python2.7',
'/usr/lib/python2.7/plat-linux2',
'/usr/lib/python2.7/lib-tk',
'/usr/lib/python2.7/lib-old',
'/usr/lib/python2.7/lib-dynload',
'/usr/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages/PIL',
'/usr/lib/python2.7/dist-packages/gst-0.10',
'/usr/lib/python2.7/dist-packages/gtk-2.0',
'/usr/lib/pymodules/python2.7',
'/usr/lib/python2.7/dist-packages/ubuntu-sso-client',
'/usr/lib/python2.7/dist-packages/ubuntuone-client',
'/usr/lib/python2.7/dist-packages/ubuntuone-control-panel',
'/usr/lib/python2.7/dist-packages/ubuntuone-couch',
'/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol',
'/opt/stack/horizon/openstack_dashboard']
Server time: Sat, 27 Oct 2012 08:43:29 +0000
Error during template rendering
In template /opt/stack/horizon/openstack_dashboard/templates/_stylesheets.html, error at line 3
/usr/bin/env: node: No such file or directory
1 {% load compress %}
2
3 {% compress css %}
4 <link href='{{ STATIC_URL }}dashboard/less/horizon.less' type='text/less' media='screen' rel='stylesheet' />
5 {% endcompress %}
6
7 <link rel="shortcut icon" href="{{ STATIC_URL }}dashboard/img/favicon.ico"/>
8
此外,回溯如下所示——
Environment:
Request Method: GET
Request URL: http://192.168.1.4/
Django Version: 1.4.2
Python Version: 2.7.3
Installed Applications:
('openstack_dashboard',
'django.contrib.contenttypes',
'django.contrib.auth',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.humanize',
'compressor',
'horizon',
'openstack_dashboard.dashboards.project',
'openstack_dashboard.dashboards.admin',
'openstack_dashboard.dashboards.settings',
'openstack_auth')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'horizon.middleware.HorizonMiddleware',
'django.middleware.doc.XViewMiddleware',
'django.middleware.locale.LocaleMiddleware')
Template error:
In template /opt/stack/horizon/openstack_dashboard/templates/_stylesheets.html, error at line 3
/usr/bin/env: node: No such file or directory
1 : {% load compress %}
2 :
3:{% 压缩 css %}
4 : <link href='{{ STATIC_URL }}dashboard/less/horizon.less' type='text/less' media='screen' rel='stylesheet' />
5 : {% endcompress %}
6 :
7 : <link rel="shortcut icon" href="{{ STATIC_URL }}dashboard/img/favicon.ico"/>
8 :
Traceback:
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
111. response = callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/views/decorators/vary.py" in inner_func
36. response = func(*args, **kwargs)
File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/views.py" in splash
38. return shortcuts.render(request, 'splash.html', {'form': form})
File "/usr/local/lib/python2.7/dist-packages/django/shortcuts/__init__.py" in render
44. return HttpResponse(loader.render_to_string(*args, **kwargs),
File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py" in render_to_string
176. return t.render(context_instance)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in render
140. return self._render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in _render
134. return self.nodelist.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in render
823. bit = self.render_node(node, context)
File "/usr/local/lib/python2.7/dist-packages/django/template/debug.py" in render_node
74. return node.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader_tags.py" in render
155. return self.render_template(self.template, context)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader_tags.py" in render_template
137. output = template.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in render
140. return self._render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in _render
134. return self.nodelist.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in render
823. bit = self.render_node(node, context)
File "/usr/local/lib/python2.7/dist-packages/django/template/debug.py" in render_node
74. return node.render(context)
File "/usr/local/lib/python2.7/dist-packages/compressor/templatetags/compress.py" in render
147. return self.render_compressed(context, self.kind, self.mode, forced=forced)
File "/usr/local/lib/python2.7/dist-packages/compressor/templatetags/compress.py" in render_compressed
107. rendered_output = self.render_output(compressor, mode, forced=forced)
File "/usr/local/lib/python2.7/dist-packages/compressor/templatetags/compress.py" in render_output
119. return compressor.output(mode, forced=forced)
File "/usr/local/lib/python2.7/dist-packages/compressor/css.py" in output
51. ret.append(subnode.output(*args, **kwargs))
File "/usr/local/lib/python2.7/dist-packages/compressor/css.py" in output
53. return super(CssCompressor, self).output(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/compressor/base.py" in output
230. content = self.filter_input(forced)
File "/usr/local/lib/python2.7/dist-packages/compressor/base.py" in filter_input
192. for hunk in self.hunks(forced):
File "/usr/local/lib/python2.7/dist-packages/compressor/base.py" in hunks
167. precompiled, value = self.precompile(value, **options)
File "/usr/local/lib/python2.7/dist-packages/compressor/base.py" in precompile
210. command=command, filename=filename).input(**kwargs)
File "/usr/local/lib/python2.7/dist-packages/compressor/filters/base.py" in input
133. raise FilterError(err)
Exception Type: FilterError at /
Exception Value: /usr/bin/env: node: No such file or directory
答案1
这是一个漏洞在 devstack 中支持量子节点和 nodejs(但可能在 horizon 中得到修复)。鉴于我尝试做和你一样的事情(在 VM 中),我通过以下方式让 horizon 工作:
sudo su
cd /usr/bin
ln -s nodejs node
node
这将创建指向的符号链接nodejs
。假设所有其他条件都相同,horizon 现在应该可以正常启动。