[Bug 1525800] Re: [SRU] ceilometer client error when create Alarm

Igor Meneguitte Ávila igoravila at gmail.com
Thu May 5 18:49:19 UTC 2016


Hi,

I modified ceilometer.py (https://review.openstack.org/#/c/288623/)

I created .deb following the steps in this manual
(https://www.linuxquestions.org/questions/linux-newbie-8/how-to-install-
dsc-file-in-linux-896928/)

ls -la *.deb
-rw-r--r-- 1 root root  10192 Mai  4 17:58 heat-api_5.0.1-0ubuntu2_all.deb
-rw-r--r-- 1 root root  10226 Mai  4 17:58 heat-api-cfn_5.0.1-0ubuntu2_all.deb
-rw-r--r-- 1 root root  10240 Mai  4 17:58 heat-api-cloudwatch_5.0.1-0ubuntu2_all.deb
-rw-r--r-- 1 root root  28252 Mai  4 17:58 heat-common_5.0.1-0ubuntu2_all.deb
-rw-r--r-- 1 root root  10516 Mai  4 17:58 heat-engine_5.0.1-0ubuntu2_all.deb
-rw-r--r-- 1 root root 727126 Mai  4 17:58 python-heat_5.0.1-0ubuntu2_all.deb

I installed packages and did not work for me.

2016-05-04 18:26:25.728 22836 INFO heat.engine.resource [-] CREATE: CeilometerAlarm "cpu_alarm_low" Stack "autoscalingv1" [3fa4f331-2dd7-4036-9913-6aab5aa237b7]
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource Traceback (most recent call last):
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource   File "/usr/local/lib/python2.7/dist-packages/heat/engine/resource.py", line 620, in _action_recorder
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource     yield
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource   File "/usr/local/lib/python2.7/dist-packages/heat/engine/resource.py", line 690, in _do_action
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource     yield self.action_handler_task(action, args=handler_args)
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource   File "/usr/local/lib/python2.7/dist-packages/heat/engine/scheduler.py", line 292, in wrapper
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource     step = next(subtask)
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource   File "/usr/local/lib/python2.7/dist-packages/heat/engine/resource.py", line 661, in action_handler_task
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource     handler_data = handler(*args)
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource   File "/usr/local/lib/python2.7/dist-packages/heat/engine/resources/openstack/ceilometer/alarm.py", line 335, in handle_create
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource     alarm = self.client().alarms.create(**props)
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource   File "/usr/local/lib/python2.7/dist-packages/heat/engine/resource.py", line 544, in client
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource     return self.stack.clients.client(client_name)
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource   File "/usr/local/lib/python2.7/dist-packages/heat/engine/clients/__init__.py", line 70, in client
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource     return client_plugin.client()
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource   File "/usr/local/lib/python2.7/dist-packages/heat/engine/clients/client_plugin.py", line 78, in client
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource     self._client = self._create()
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource   File "/usr/local/lib/python2.7/dist-packages/heat/engine/clients/os/ceilometer.py", line 46, in _create
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource     return cc.get_client('2', **args)
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource   File "/usr/lib/python2.7/dist-packages/ceilometerclient/client.py", line 395, in get_client
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource     return Client(version, endpoint, **kwargs)
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource   File "/usr/lib/python2.7/dist-packages/ceilometerclient/client.py", line 359, in Client
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource     return client_class(*args, **client_kwargs)
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource   File "/usr/lib/python2.7/dist-packages/ceilometerclient/v2/client.py", line 68, in __init__
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource     self.alarm_client, aodh_enabled = self._get_alarm_client(**kwargs)
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource   File "/usr/lib/python2.7/dist-packages/ceilometerclient/v2/client.py", line 106, in _get_alarm_client
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource     kwargs.get('timeout'))
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource   File "/usr/lib/python2.7/dist-packages/ceilometerclient/client.py", line 271, in redirect_to_aodh_endpoint
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource     self.opts['endpoint'] = _get_endpoint(ks_session, **ks_kwargs)
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource   File "/usr/lib/python2.7/dist-packages/ceilometerclient/client.py", line 201, in _get_endpoint
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource     region_name=kwargs.get('region_name'))
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource   File "/usr/lib/python2.7/dist-packages/keystoneclient/session.py", line 660, in get_endpoint
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource     return auth.get_endpoint(self, **kwargs)
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource   File "/usr/lib/python2.7/dist-packages/keystoneclient/auth/identity/base.py", line 315, in get_endpoint
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource     service_catalog = self.get_access(session).service_catalog
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource   File "/usr/lib/python2.7/dist-packages/keystoneclient/auth/identity/base.py", line 240, in get_access
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource     self.auth_ref = self.get_auth_ref(session)
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource   File "/usr/lib/python2.7/dist-packages/keystoneclient/auth/identity/v3/base.py", line 190, in get_auth_ref
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource     authenticated=False, log=False, **rkwargs)
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource   File "/usr/lib/python2.7/dist-packages/keystoneclient/session.py", line 501, in post
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource     return self.request(url, 'POST', **kwargs)
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource   File "/usr/lib/python2.7/dist-packages/keystoneclient/utils.py", line 337, in inner
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource     return func(*args, **kwargs)
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource   File "/usr/lib/python2.7/dist-packages/keystoneclient/session.py", line 401, in request
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource     raise exceptions.from_response(resp, method, url)
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource BadRequest: Expecting to find domain in project - the server could not comply with the request since it is either malformed or otherwise incorrect. The client is assumed to be in error. (HTTP 400) (Request-ID: req-dfd3934a-ad52-4382-b77b-2f7de933da64)
2016-05-04 18:26:25.728 22836 ERROR heat.engine.resource 
2016-05-04 18:26:26.773 22836 INFO heat.engine.service [-] Stack create failed, status FAILED
2016-05-04 18:26:26.803 22836 INFO heat.engine.stack [-] Stack CREATE FAILED (autoscalingv1): Resource CREATE failed: BadRequest: resources.cpu_alarm_low: Expecting to find domain in project - the server could not comply with the request since it is either malformed or otherwise incorrect. The client is assumed to be in error. (HTTP 400) (Request-ID: req-dfd3934a-ad52-4382-b77b-2f7de933da64)

Any ideas?

regards,

Igor

-- 
You received this bug notification because you are a member of Ubuntu
OpenStack, which is subscribed to Ubuntu Cloud Archive.
https://bugs.launchpad.net/bugs/1525800

Title:
  [SRU] ceilometer client error when create Alarm

Status in Ubuntu Cloud Archive:
  Invalid
Status in Ubuntu Cloud Archive liberty series:
  Fix Committed
Status in heat:
  Fix Released
Status in heat package in Ubuntu:
  Invalid
Status in heat source package in Wily:
  Fix Released

Bug description:
  [Impact]

   * Creating a stack with e.g. OS::Ceilometer::Alarm is failing because
  Ceilometer client is being passed incorrect parameters. This patch
  fixes heat ceilometer client.

  [Test Case]

   * deploy Openstack Liberty
   * create a stack using a HOT template containing e.g. http://paste.ubuntu.com/15928508/
   * check that stack goes to CREATE_COMPLETE status

  [Regression Potential]

   * None

  I use OpenStack Liberty deployed by instruction for CentOS7 from docs.openstack.org
  I'm trying to create OS::Ceilometer::Alarm resource

  In heat-engine.log i have error

  2015-12-14 12:59:00.696 6672 ERROR heat.engine.resource BadRequest:
  Expecting to find domain in project - the server could not comply with
  the request since it is either malformed or otherwise incorrect. The
  client is assumed to be in error. (HTTP 400) (Request-ID: req-
  3d4ab42b-213b-4141-bd28-f8dbb2b79e96)

  environment
  [root at controller ~]# yum list installed | grep heat
  openstack-heat-api.noarch       1:5.0.0-1.el7          @centos-openstack-liberty
  openstack-heat-api-cfn.noarch   1:5.0.0-1.el7          @centos-openstack-liberty
  openstack-heat-common.noarch    1:5.0.0-1.el7          @centos-openstack-liberty
  openstack-heat-engine.noarch    1:5.0.0-1.el7          @centos-openstack-liberty
  python-heatclient.noarch        0.8.0-1.el7            @centos-openstack-liberty
  [root at controller ~]# yum list installed | grep ceilometer
  openstack-ceilometer-alarm.noarch
  openstack-ceilometer-api.noarch 1:5.0.0-1.el7          @centos-openstack-liberty
  python-ceilometer.noarch        1:5.0.0-1.el7          @centos-openstack-liberty
  python-ceilometerclient.noarch  1.5.0-1.el7            @centos-openstack-liberty

  my suggestion, bug in
  heat/engine/clients/os/ceilometer.py

  class CeilometerClientPlugin(client_plugin.ClientPlugin):

      ...

      def _create(self):
      ...
     args = {
              'auth_url': con.auth_url,
              'service_type': self.METERING,
              'project_name': con.tenant,          <--- HERE!!!
              'token': lambda: self.auth_token,
              'endpoint_type': endpoint_type,
              'os_endpoint': endpoint,
              'cacert': self._get_client_option('ceilometer', 'ca_file'),
              'cert_file': self._get_client_option('ceilometer', 'cert_file'),
              'key_file': self._get_client_option('ceilometer', 'key_file'),
              'insecure': self._get_client_option('ceilometer', 'insecure')
          }

  if use
         'project_id': con.tenant_id,
  instead
        'project_name': con.tenant,
  it works fine

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-archive/+bug/1525800/+subscriptions



More information about the Ubuntu-openstack-bugs mailing list