2done.org

Linuxメインなメモ書き。二度寝してから書く。(ご意見は Twitter あたりで。そのうちコメント欄つけます。)

Ubuntu パッケージ版 Essex のエラー対応

(Horizon)プロジェクトの選択ができない

症状

複数のプロジェクトに属している時、任意のプロジェクトをドロップダウンボックスから選択できない。

エラー内容

[Thu May 17 14:48:52 2012] [error] Unauthorized: The request you have made requires authentication. (HTTP 401)
[Thu May 17 14:48:52 2012] [error] Request returned failure status.
[Thu May 17 14:48:52 2012] [error] Traceback (most recent call last):
[Thu May 17 14:48:52 2012] [error]   File "/usr/lib/python2.7/dist-packages/keystoneclient/client.py", line 150, in _cs_request
[Thu May 17 14:48:52 2012] [error]     **kwargs)
[Thu May 17 14:48:52 2012] [error]   File "/usr/lib/python2.7/dist-packages/keystoneclient/client.py", line 130, in request
[Thu May 17 14:48:52 2012] [error]     raise exceptions.from_response(resp, body)
[Thu May 17 14:48:52 2012] [error] Unauthorized: The request you have made requires authentication. (HTTP 401)
[Thu May 17 14:48:52 2012] [error] Could not retrieve tenant list.
[Thu May 17 14:48:52 2012] [error] Traceback (most recent call last):
[Thu May 17 14:48:52 2012] [error]   File "/usr/lib/python2.7/dist-packages/horizon/users.py", line 155, in authorized_tenants
[Thu May 17 14:48:52 2012] [error]     # authd = api.tenant_list_for_token(self._request, token)
[Thu May 17 14:48:52 2012] [error]   File "/usr/lib/python2.7/dist-packages/horizon/api/keystone.py", line 172, in tenant_list_for_token
[Thu May 17 14:48:52 2012] [error]     return c.tenants.list()
[Thu May 17 14:48:52 2012] [error]   File "/usr/lib/python2.7/dist-packages/keystoneclient/v2_0/tenants.py", line 90, in list
[Thu May 17 14:48:52 2012] [error]     return self._list("/tenants%s" % query, "tenants")
[Thu May 17 14:48:52 2012] [error]   File "/usr/lib/python2.7/dist-packages/keystoneclient/base.py", line 65, in _list
[Thu May 17 14:48:52 2012] [error]     resp, body = self.api.get(url)
[Thu May 17 14:48:52 2012] [error]   File "/usr/lib/python2.7/dist-packages/keystoneclient/client.py", line 166, in get
[Thu May 17 14:48:52 2012] [error]     return self._cs_request(url, 'GET', **kwargs)
[Thu May 17 14:48:52 2012] [error]   File "/usr/lib/python2.7/dist-packages/keystoneclient/client.py", line 158, in _cs_request
[Thu May 17 14:48:52 2012] [error]     method, **kwargs)
[Thu May 17 14:48:52 2012] [error]   File "/usr/lib/python2.7/dist-packages/keystoneclient/client.py", line 130, in request
[Thu May 17 14:48:52 2012] [error]     raise exceptions.from_response(resp, body)
[Thu May 17 14:48:52 2012] [error] Unauthorized: The request you have made requires authentication. (HTTP 401)
[Thu May 17 14:48:52 2012] [error] Request returned failure status.
[Thu May 17 14:48:52 2012] [error] Traceback (most recent call last):
[Thu May 17 14:48:52 2012] [error]   File "/usr/lib/python2.7/dist-packages/keystoneclient/client.py", line 150, in _cs_request
[Thu May 17 14:48:52 2012] [error]     **kwargs)
[Thu May 17 14:48:52 2012] [error]   File "/usr/lib/python2.7/dist-packages/keystoneclient/client.py", line 130, in request
[Thu May 17 14:48:52 2012] [error]     raise exceptions.from_response(resp, body)
[Thu May 17 14:48:52 2012] [error] Unauthorized: The request you have made requires authentication. (HTTP 401)
[Thu May 17 14:48:52 2012] [error] Could not retrieve tenant list.
[Thu May 17 14:48:52 2012] [error] Traceback (most recent call last):
[Thu May 17 14:48:52 2012] [error]   File "/usr/lib/python2.7/dist-packages/horizon/users.py", line 155, in authorized_tenants
[Thu May 17 14:48:52 2012] [error]     # authd = api.tenant_list_for_token(self._request, token)
[Thu May 17 14:48:52 2012] [error]   File "/usr/lib/python2.7/dist-packages/horizon/api/keystone.py", line 172, in tenant_list_for_token
[Thu May 17 14:48:52 2012] [error]     return c.tenants.list()
[Thu May 17 14:48:52 2012] [error]   File "/usr/lib/python2.7/dist-packages/keystoneclient/v2_0/tenants.py", line 90, in list
[Thu May 17 14:48:52 2012] [error]     return self._list("/tenants%s" % query, "tenants")
[Thu May 17 14:48:52 2012] [error]   File "/usr/lib/python2.7/dist-packages/keystoneclient/base.py", line 65, in _list
[Thu May 17 14:48:52 2012] [error]     resp, body = self.api.get(url)
[Thu May 17 14:48:52 2012] [error]   File "/usr/lib/python2.7/dist-packages/keystoneclient/client.py", line 166, in get
[Thu May 17 14:48:52 2012] [error]     return self._cs_request(url, 'GET', **kwargs)
[Thu May 17 14:48:52 2012] [error]   File "/usr/lib/python2.7/dist-packages/keystoneclient/client.py", line 158, in _cs_request
[Thu May 17 14:48:52 2012] [error]     method, **kwargs)
[Thu May 17 14:48:52 2012] [error]   File "/usr/lib/python2.7/dist-packages/keystoneclient/client.py", line 130, in request
[Thu May 17 14:48:52 2012] [error]     raise exceptions.from_response(resp, body)
[Thu May 17 14:48:52 2012] [error] Unauthorized: The request you have made requires authentication. (HTTP 401)

対応するバグ

https://bugs.launchpad.net/horizon/+bug/982595

https://review.openstack.org/#/c/6579/

対処

/usr/lib/python2.7/dist-packages/horizon/users.py
155                authd = api.tenant_list_for_token(self._request, token)

155                    authd = api.tenant_list_for_token(self._request, token,
156                                                          endpoint_type="publicURL")

SnapShot を Boot From Volume にするとエラー

症状

SnapShot を Boot From Volume にすると、Task: Error, Status: Block Device Mapping で止まる。

エラー内容

2012-06-07 21:34:18 INFO nova.api.openstack.wsgi [req-06c7a53b-edea-434b-8746-0c5d921db44c 0a4b4fb7b8e5487c9ed93c89828e5aee a5952a7540ab422bac2554a1def1cbc0] GET http://172.17.0.2:8774/v1.1/a5952a7540ab422bac2554a1def1cbc0/servers/detail?project_id=a5952a7540ab422bac2554a1def1cbc0
2012-06-07 21:34:18 DEBUG nova.api.openstack.wsgi [req-06c7a53b-edea-434b-8746-0c5d921db44c 0a4b4fb7b8e5487c9ed93c89828e5aee a5952a7540ab422bac2554a1def1cbc0] Unrecognized Content-Type provided in request from (pid=10317) get_body /usr/lib/python2.7/dist-packages/nova/api/openstack/wsgi.py:697
2012-06-07 21:34:18 DEBUG nova.api.openstack.compute.servers [req-06c7a53b-edea-434b-8746-0c5d921db44c 0a4b4fb7b8e5487c9ed93c89828e5aee a5952a7540ab422bac2554a1def1cbc0] Removing options 'project_id' from query from (pid=10317) remove_invalid_options /usr/lib/python2.7/dist-packages/nova/api/openstack/compute/servers.py:1168
2012-06-07 21:34:18 DEBUG nova.compute.api [req-06c7a53b-edea-434b-8746-0c5d921db44c 0a4b4fb7b8e5487c9ed93c89828e5aee a5952a7540ab422bac2554a1def1cbc0] Searching by: {'deleted': False, 'project_id': u'a5952a7540ab422bac2554a1def1cbc0'} from (pid=10317) get_all /usr/lib/python2.7/dist-packages/nova/compute/api.py:1057
2012-06-07 21:34:18 INFO nova.api.openstack.wsgi [req-06c7a53b-edea-434b-8746-0c5d921db44c 0a4b4fb7b8e5487c9ed93c89828e5aee a5952a7540ab422bac2554a1def1cbc0] http://172.17.0.2:8774/v1.1/a5952a7540ab422bac2554a1def1cbc0/servers/detail?project_id=a5952a7540ab422bac2554a1def1cbc0 returned with HTTP 200
2012-06-07 21:34:18 INFO nova.api.openstack.wsgi [req-0b7d1351-53ff-4abc-b67c-80bb46539a43 0a4b4fb7b8e5487c9ed93c89828e5aee a5952a7540ab422bac2554a1def1cbc0] GET http://172.17.0.2:8776/v1/a5952a7540ab422bac2554a1def1cbc0/volumes/detail
2012-06-07 21:34:18 DEBUG nova.api.openstack.wsgi [req-0b7d1351-53ff-4abc-b67c-80bb46539a43 0a4b4fb7b8e5487c9ed93c89828e5aee a5952a7540ab422bac2554a1def1cbc0] Unrecognized Content-Type provided in request from (pid=10317) get_body /usr/lib/python2.7/dist-packages/nova/api/openstack/wsgi.py:697
2012-06-07 21:34:18 ERROR nova.api.openstack.wsgi [req-0b7d1351-53ff-4abc-b67c-80bb46539a43 0a4b4fb7b8e5487c9ed93c89828e5aee a5952a7540ab422bac2554a1def1cbc0] Exception handling resource: expected string or Unicode object, long found
2012-06-07 21:34:18 TRACE nova.api.openstack.wsgi Traceback (most recent call last):
2012-06-07 21:34:18 TRACE nova.api.openstack.wsgi   File "/usr/lib/python2.7/dist-packages/nova/api/openstack/wsgi.py", line 851, in _process_stack
2012-06-07 21:34:18 TRACE nova.api.openstack.wsgi     action_result = self.dispatch(meth, request, action_args)
2012-06-07 21:34:18 TRACE nova.api.openstack.wsgi   File "/usr/lib/python2.7/dist-packages/nova/api/openstack/wsgi.py", line 926, in dispatch
2012-06-07 21:34:18 TRACE nova.api.openstack.wsgi     return method(req=request, **action_args)
2012-06-07 21:34:18 TRACE nova.api.openstack.wsgi   File "/usr/lib/python2.7/dist-packages/nova/api/openstack/volume/volumes.py", line 201, in detail
2012-06-07 21:34:18 TRACE nova.api.openstack.wsgi     return self._items(req, entity_maker=_translate_volume_detail_view)
2012-06-07 21:34:18 TRACE nova.api.openstack.wsgi   File "/usr/lib/python2.7/dist-packages/nova/api/openstack/volume/volumes.py", line 207, in _items
2012-06-07 21:34:18 TRACE nova.api.openstack.wsgi     volumes = self.volume_api.get_all(context)
2012-06-07 21:34:18 TRACE nova.api.openstack.wsgi   File "/usr/lib/python2.7/dist-packages/nova/volume/api.py", line 170, in get_all
2012-06-07 21:34:18 TRACE nova.api.openstack.wsgi     context.project_id)
2012-06-07 21:34:18 TRACE nova.api.openstack.wsgi   File "/usr/lib/python2.7/dist-packages/nova/db/api.py", line 968, in volume_get_all_by_project
2012-06-07 21:34:18 TRACE nova.api.openstack.wsgi     return IMPL.volume_get_all_by_project(context, project_id)
2012-06-07 21:34:18 TRACE nova.api.openstack.wsgi   File "/usr/lib/python2.7/dist-packages/nova/db/sqlalchemy/api.py", line 120, in wrapper
2012-06-07 21:34:18 TRACE nova.api.openstack.wsgi     return f(*args, **kwargs)
2012-06-07 21:34:18 TRACE nova.api.openstack.wsgi   File "/usr/lib/python2.7/dist-packages/nova/db/sqlalchemy/api.py", line 2422, in volume_get_all_by_project
2012-06-07 21:34:18 TRACE nova.api.openstack.wsgi     return _volume_get_query(context).filter_by(project_id=project_id).all()
2012-06-07 21:34:18 TRACE nova.api.openstack.wsgi   File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 1947, in all
2012-06-07 21:34:18 TRACE nova.api.openstack.wsgi     return list(self)
2012-06-07 21:34:18 TRACE nova.api.openstack.wsgi   File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2178, in instances
2012-06-07 21:34:18 TRACE nova.api.openstack.wsgi     rows = [process[0](row, None) for row in fetch]
2012-06-07 21:34:18 TRACE nova.api.openstack.wsgi   File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/mapper.py", line 2718, in _instance
2012-06-07 21:34:18 TRACE nova.api.openstack.wsgi     populate_state(state, dict_, row, isnew, only_load_props)
2012-06-07 21:34:18 TRACE nova.api.openstack.wsgi   File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/mapper.py", line 2572, in populate_state
2012-06-07 21:34:18 TRACE nova.api.openstack.wsgi     populator(state, dict_, row)
2012-06-07 21:34:18 TRACE nova.api.openstack.wsgi   File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/strategies.py", line 150, in new_execute
2012-06-07 21:34:18 TRACE nova.api.openstack.wsgi     dict_[key] = row[col]
2012-06-07 21:34:18 TRACE nova.api.openstack.wsgi TypeError: expected string or Unicode object, long found
2012-06-07 21:34:18 TRACE nova.api.openstack.wsgi
2012-06-07 21:34:18 INFO nova.api.openstack.wsgi [req-0b7d1351-53ff-4abc-b67c-80bb46539a43 0a4b4fb7b8e5487c9ed93c89828e5aee a5952a7540ab422bac2554a1def1cbc0] http://172.17.0.2:8776/v1/a5952a7540ab422bac2554a1def1cbc0/volumes/detail returned with HTTP 400

対応するバグ

https://bugs.launchpad.net/nova/+bug/962615
https://review.openstack.org/#/c/7509/

対処

/usr/share/pyshared/nova/db/sqlalchemy/models.py

347 snapshot_id = Column(String(255))

347 snapshot_id = Column(Integer)

SnapShot を Boot From Volume にすると謎のボリュームが作成される

症状

上記関連。SnapShot を Boot From Volume にすると謎の名前なしボリュームが状態: Creating で作成される。

ボリューム自体は作成されていないので、削除すれば解消される。

ただし、ユーザ権限で削除できないため、admin 権限で削除を行う必要がある。

/var/log/libvirt/libvirtd.log にエラーが出る

エラー内容

2012-06-02 21:30:26.891+0000: 1702: error : virExecWithHook:328 : Cannot find 'pm-is-supported' in path: No such file or directory
2012-06-02 21:30:26.891+0000: 1702: warning : qemuCapsInit:856 : Failed to get host power management capabilities

対処

このエラーの場合は pm-utils がインストールされていない

sudo apt-get install pm-utils
restart libvirt-bin

これでOK

Horizon から Snapshot の Edit(名前の変更)をすると状態がパブリックになる

関連するバグ

https://bugs.launchpad.net/horizon/+bug/988633

対処

b/horizon/dashboards/nova/images_and_snapshots/images/forms.py

commit 7b959c2066821e829c07563bc9f84de72544017d
Author: Tres Henry <tres@treshenry.net>
Date:   Fri May 4 10:52:07 2012 -0700

    This is a backport which fixes the issue with images being marked public
    when edited. This is fixed in Folsom by: https://github.com/openstack/horizon/commit/0b94c431ab8e510b5fd4e7d1e8719c7d2055fa0f

    Fixes bug 988633

    Change-Id: Ia22501c2a3daac7e84c10039dd5857612e5156f4

diff --git a/horizon/dashboards/nova/images_and_snapshots/images/forms.py b/horizon/dashboards/nova/images_and_snapshots/images/forms.py
index 319ceb5..bc4851d 100644
--- a/horizon/dashboards/nova/images_and_snapshots/images/forms.py
+++ b/horizon/dashboards/nova/images_and_snapshots/images/forms.py
@@ -43,35 +43,34 @@ class UpdateImageForm(forms.SelfHandlingForm):

     image_id = forms.CharField(widget=forms.HiddenInput())
     name = forms.CharField(max_length="255", label=_("Name"))
-    kernel = forms.CharField(max_length="36", label=_("Kernel ID"),
+    kernel = forms.CharField(max_length="36",
+                             label=_("Kernel ID"),
                              required=False,
                              widget=forms.TextInput(
-                                attrs={'readonly': 'readonly'}
-                             ))
-    ramdisk = forms.CharField(max_length="36", label=_("Ramdisk ID"),
+                                 attrs={'readonly': 'readonly'}))
+    ramdisk = forms.CharField(max_length="36",
+                              label=_("Ramdisk ID"),
                               required=False,
                               widget=forms.TextInput(
-                                attrs={'readonly': 'readonly'}
-                              ))
-    architecture = forms.CharField(label=_("Architecture"), required=False,
+                                  attrs={'readonly': 'readonly'}))
+    architecture = forms.CharField(label=_("Architecture"),
+                                   required=False,
                                    widget=forms.TextInput(
-                                    attrs={'readonly': 'readonly'}
-                                   ))
+                                       attrs={'readonly': 'readonly'}))
     container_format = forms.CharField(label=_("Container Format"),
                                        widget=forms.TextInput(
-                                        attrs={'readonly': 'readonly'}
-                                       ))
+                                           attrs={'readonly': 'readonly'}))
     disk_format = forms.CharField(label=_("Disk Format"),
                                   widget=forms.TextInput(
-                                    attrs={'readonly': 'readonly'}
-                                  ))
+                                      attrs={'readonly': 'readonly'}))
+    public = forms.BooleanField(label=_("Public"), required=False)

     def handle(self, request, data):
         # TODO add public flag to image meta properties
         image_id = data['image_id']
         error_updating = _('Unable to update image "%s".')

-        meta = {'is_public': True,
+        meta = {'is_public': data['public'],
                 'disk_format': data['disk_format'],
                 'container_format': data['container_format'],
                 'name': data['name'],

.