← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1541218] [NEW] fail lots of V2 testcases due to no `policy.json` could be found

 

Public bug reported:

How to reproduce:

1. remove the `/etc/keystone/policy.json` if there is since this file
only exists after env is setup, this will make sure the test engine to
search the `policy.json` in the code base, for example,  load the policy
file from here `/opt/stack/keystone/etc/policy.json`

2. run the v2 testcases separately,
$ python -m unittest keystone.tests.unit.test_v2

or simply run only one testcases.
$ python -m unittest keystone.tests.unit.test_credential.TestCredentialEc2.test_ec2_list_credentials

3. You will hit the following exceptions.

enforce identity:validate_token: {'is_delegated_auth': False, 'access_token_id': None, 'user_id': u'180af26c59e9460f81652569d27fc439', 'roles': ['Service'], 'user_domain_id': 'default', 'trustee_id': None, 'trustor_id': None, 'consumer_id': None, 'token': <KeystoneToken (audit_id=AP7_3Z_VRniinKe_jiFZrA, audit_chain_id=AP7_3Z_VRniinKe_jiFZrA) at 0x7f9566d5d2a0>, 'project_id': 'service', 'trust_id': None, 'project_domain_id': 'default'}
Failed to find some config files: policy.json
Traceback (most recent call last):
  File "keystone/common/wsgi.py", line 247, in __call__
    result = method(context, **params)
  File "/usr/local/lib/python2.7/dist-packages/oslo_log/versionutils.py", line 165, in wrapped
    return func_or_cls(*args, **kwargs)
  File "keystone/common/controller.py", line 179, in inner
    utils.flatten_dict(policy_dict))
  File "keystone/policy/backends/rules.py", line 77, in enforce
    enforce(credentials, action, target)
  File "keystone/policy/backends/rules.py", line 69, in enforce
    return _ENFORCER.enforce(action, target, credentials, **extra)
  File "/usr/local/lib/python2.7/dist-packages/oslo_policy/policy.py", line 540, in enforce
    self.load_rules()
  File "/usr/local/lib/python2.7/dist-packages/oslo_policy/policy.py", line 443, in load_rules
    self.policy_path = self._get_policy_path(self.policy_file)
  File "/usr/local/lib/python2.7/dist-packages/oslo_policy/policy.py", line 513, in _get_policy_path
    raise cfg.ConfigFilesNotFoundError((path,))
ConfigFilesNotFoundError: Failed to find some config files: policy.json
}}}

Traceback (most recent call last):
  File "keystone/tests/unit/test_v2.py", line 186, in test_validate_token_service_role
    token=token)
  File "keystone/tests/unit/rest.py", line 208, in admin_request
    return self._request(app=self.admin_app, **kwargs)
  File "keystone/tests/unit/rest.py", line 197, in _request
    response = self.restful_request(**kwargs)
  File "keystone/tests/unit/rest.py", line 182, in restful_request
    **kwargs)
  File "keystone/tests/unit/rest.py", line 90, in request
    **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/webtest/app.py", line 567, in request
    expect_errors=expect_errors,
  File "/usr/local/lib/python2.7/dist-packages/webtest/app.py", line 632, in do_request
    self._check_status(status, res)
  File "/usr/local/lib/python2.7/dist-packages/webtest/app.py", line 664, in _check_status
    res)
webtest.app.AppError: Bad response: 500 Internal Server Error (not 200 OK or 3xx redirect for http://localhost/v2.0/tokens/3c69de14762f42ac89852eb1f3c7eab5)
'{"error": {"message": "An unexpected error prevented the server from fulfilling your request.", "code": 500, "title": "Internal Server Error"}}'

Ran 122 tests in 18.954s

FAILED (errors=73, skipped=3)

** Affects: keystone
     Importance: Undecided
     Assignee: Dave Chen (wei-d-chen)
         Status: New

** Description changed:

  How to reproduce:
  
  1. remove the `/etc/keystone/policy.json` if there is since this file
  only exists after env is setup, this will make sure the test engine to
- search the `policy.json` in the code base, for example,  load this
- policy file. `/opt/stack/keystone/etc/policy.json`
+ search the `policy.json` in the code base, for example,  load the policy
+ file from here `/opt/stack/keystone/etc/policy.json`
  
- 2. run the v2 testcases seperately, 
+ 2. run the v2 testcases separately,
  $ python -m unittest keystone.tests.unit.test_v2
  
  or simply run only one testcases.
  $ python -m unittest keystone.tests.unit.test_credential.TestCredentialEc2
  
  3. You will hit the following exceptions.
  
  enforce identity:validate_token: {'is_delegated_auth': False, 'access_token_id': None, 'user_id': u'180af26c59e9460f81652569d27fc439', 'roles': ['Service'], 'user_domain_id': 'default', 'trustee_id': None, 'trustor_id': None, 'consumer_id': None, 'token': <KeystoneToken (audit_id=AP7_3Z_VRniinKe_jiFZrA, audit_chain_id=AP7_3Z_VRniinKe_jiFZrA) at 0x7f9566d5d2a0>, 'project_id': 'service', 'trust_id': None, 'project_domain_id': 'default'}
  Failed to find some config files: policy.json
  Traceback (most recent call last):
-   File "keystone/common/wsgi.py", line 247, in __call__
-     result = method(context, **params)
-   File "/usr/local/lib/python2.7/dist-packages/oslo_log/versionutils.py", line 165, in wrapped
-     return func_or_cls(*args, **kwargs)
-   File "keystone/common/controller.py", line 179, in inner
-     utils.flatten_dict(policy_dict))
-   File "keystone/policy/backends/rules.py", line 77, in enforce
-     enforce(credentials, action, target)
-   File "keystone/policy/backends/rules.py", line 69, in enforce
-     return _ENFORCER.enforce(action, target, credentials, **extra)
-   File "/usr/local/lib/python2.7/dist-packages/oslo_policy/policy.py", line 540, in enforce
-     self.load_rules()
-   File "/usr/local/lib/python2.7/dist-packages/oslo_policy/policy.py", line 443, in load_rules
-     self.policy_path = self._get_policy_path(self.policy_file)
-   File "/usr/local/lib/python2.7/dist-packages/oslo_policy/policy.py", line 513, in _get_policy_path
-     raise cfg.ConfigFilesNotFoundError((path,))
+   File "keystone/common/wsgi.py", line 247, in __call__
+     result = method(context, **params)
+   File "/usr/local/lib/python2.7/dist-packages/oslo_log/versionutils.py", line 165, in wrapped
+     return func_or_cls(*args, **kwargs)
+   File "keystone/common/controller.py", line 179, in inner
+     utils.flatten_dict(policy_dict))
+   File "keystone/policy/backends/rules.py", line 77, in enforce
+     enforce(credentials, action, target)
+   File "keystone/policy/backends/rules.py", line 69, in enforce
+     return _ENFORCER.enforce(action, target, credentials, **extra)
+   File "/usr/local/lib/python2.7/dist-packages/oslo_policy/policy.py", line 540, in enforce
+     self.load_rules()
+   File "/usr/local/lib/python2.7/dist-packages/oslo_policy/policy.py", line 443, in load_rules
+     self.policy_path = self._get_policy_path(self.policy_file)
+   File "/usr/local/lib/python2.7/dist-packages/oslo_policy/policy.py", line 513, in _get_policy_path
+     raise cfg.ConfigFilesNotFoundError((path,))
  ConfigFilesNotFoundError: Failed to find some config files: policy.json
  }}}
  
  Traceback (most recent call last):
-   File "keystone/tests/unit/test_v2.py", line 186, in test_validate_token_service_role
-     token=token)
-   File "keystone/tests/unit/rest.py", line 208, in admin_request
-     return self._request(app=self.admin_app, **kwargs)
-   File "keystone/tests/unit/rest.py", line 197, in _request
-     response = self.restful_request(**kwargs)
-   File "keystone/tests/unit/rest.py", line 182, in restful_request
-     **kwargs)
-   File "keystone/tests/unit/rest.py", line 90, in request
-     **kwargs)
-   File "/usr/local/lib/python2.7/dist-packages/webtest/app.py", line 567, in request
-     expect_errors=expect_errors,
-   File "/usr/local/lib/python2.7/dist-packages/webtest/app.py", line 632, in do_request
-     self._check_status(status, res)
-   File "/usr/local/lib/python2.7/dist-packages/webtest/app.py", line 664, in _check_status
-     res)
+   File "keystone/tests/unit/test_v2.py", line 186, in test_validate_token_service_role
+     token=token)
+   File "keystone/tests/unit/rest.py", line 208, in admin_request
+     return self._request(app=self.admin_app, **kwargs)
+   File "keystone/tests/unit/rest.py", line 197, in _request
+     response = self.restful_request(**kwargs)
+   File "keystone/tests/unit/rest.py", line 182, in restful_request
+     **kwargs)
+   File "keystone/tests/unit/rest.py", line 90, in request
+     **kwargs)
+   File "/usr/local/lib/python2.7/dist-packages/webtest/app.py", line 567, in request
+     expect_errors=expect_errors,
+   File "/usr/local/lib/python2.7/dist-packages/webtest/app.py", line 632, in do_request
+     self._check_status(status, res)
+   File "/usr/local/lib/python2.7/dist-packages/webtest/app.py", line 664, in _check_status
+     res)
  webtest.app.AppError: Bad response: 500 Internal Server Error (not 200 OK or 3xx redirect for http://localhost/v2.0/tokens/3c69de14762f42ac89852eb1f3c7eab5)
  '{"error": {"message": "An unexpected error prevented the server from fulfilling your request.", "code": 500, "title": "Internal Server Error"}}'
  
  Ran 122 tests in 18.954s
  
  FAILED (errors=73, skipped=3)

** Changed in: keystone
     Assignee: (unassigned) => Dave Chen (wei-d-chen)

** Description changed:

  How to reproduce:
  
  1. remove the `/etc/keystone/policy.json` if there is since this file
  only exists after env is setup, this will make sure the test engine to
  search the `policy.json` in the code base, for example,  load the policy
  file from here `/opt/stack/keystone/etc/policy.json`
  
  2. run the v2 testcases separately,
  $ python -m unittest keystone.tests.unit.test_v2
  
  or simply run only one testcases.
- $ python -m unittest keystone.tests.unit.test_credential.TestCredentialEc2
+ $ python -m unittest keystone.tests.unit.test_credential.TestCredentialEc2.test_ec2_list_credentials
  
  3. You will hit the following exceptions.
  
  enforce identity:validate_token: {'is_delegated_auth': False, 'access_token_id': None, 'user_id': u'180af26c59e9460f81652569d27fc439', 'roles': ['Service'], 'user_domain_id': 'default', 'trustee_id': None, 'trustor_id': None, 'consumer_id': None, 'token': <KeystoneToken (audit_id=AP7_3Z_VRniinKe_jiFZrA, audit_chain_id=AP7_3Z_VRniinKe_jiFZrA) at 0x7f9566d5d2a0>, 'project_id': 'service', 'trust_id': None, 'project_domain_id': 'default'}
  Failed to find some config files: policy.json
  Traceback (most recent call last):
    File "keystone/common/wsgi.py", line 247, in __call__
      result = method(context, **params)
    File "/usr/local/lib/python2.7/dist-packages/oslo_log/versionutils.py", line 165, in wrapped
      return func_or_cls(*args, **kwargs)
    File "keystone/common/controller.py", line 179, in inner
      utils.flatten_dict(policy_dict))
    File "keystone/policy/backends/rules.py", line 77, in enforce
      enforce(credentials, action, target)
    File "keystone/policy/backends/rules.py", line 69, in enforce
      return _ENFORCER.enforce(action, target, credentials, **extra)
    File "/usr/local/lib/python2.7/dist-packages/oslo_policy/policy.py", line 540, in enforce
      self.load_rules()
    File "/usr/local/lib/python2.7/dist-packages/oslo_policy/policy.py", line 443, in load_rules
      self.policy_path = self._get_policy_path(self.policy_file)
    File "/usr/local/lib/python2.7/dist-packages/oslo_policy/policy.py", line 513, in _get_policy_path
      raise cfg.ConfigFilesNotFoundError((path,))
  ConfigFilesNotFoundError: Failed to find some config files: policy.json
  }}}
  
  Traceback (most recent call last):
    File "keystone/tests/unit/test_v2.py", line 186, in test_validate_token_service_role
      token=token)
    File "keystone/tests/unit/rest.py", line 208, in admin_request
      return self._request(app=self.admin_app, **kwargs)
    File "keystone/tests/unit/rest.py", line 197, in _request
      response = self.restful_request(**kwargs)
    File "keystone/tests/unit/rest.py", line 182, in restful_request
      **kwargs)
    File "keystone/tests/unit/rest.py", line 90, in request
      **kwargs)
    File "/usr/local/lib/python2.7/dist-packages/webtest/app.py", line 567, in request
      expect_errors=expect_errors,
    File "/usr/local/lib/python2.7/dist-packages/webtest/app.py", line 632, in do_request
      self._check_status(status, res)
    File "/usr/local/lib/python2.7/dist-packages/webtest/app.py", line 664, in _check_status
      res)
  webtest.app.AppError: Bad response: 500 Internal Server Error (not 200 OK or 3xx redirect for http://localhost/v2.0/tokens/3c69de14762f42ac89852eb1f3c7eab5)
  '{"error": {"message": "An unexpected error prevented the server from fulfilling your request.", "code": 500, "title": "Internal Server Error"}}'
  
  Ran 122 tests in 18.954s
  
  FAILED (errors=73, skipped=3)

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Identity (keystone).
https://bugs.launchpad.net/bugs/1541218

Title:
  fail lots of V2 testcases due to no `policy.json` could be found

Status in OpenStack Identity (keystone):
  New

Bug description:
  How to reproduce:

  1. remove the `/etc/keystone/policy.json` if there is since this file
  only exists after env is setup, this will make sure the test engine to
  search the `policy.json` in the code base, for example,  load the
  policy file from here `/opt/stack/keystone/etc/policy.json`

  2. run the v2 testcases separately,
  $ python -m unittest keystone.tests.unit.test_v2

  or simply run only one testcases.
  $ python -m unittest keystone.tests.unit.test_credential.TestCredentialEc2.test_ec2_list_credentials

  3. You will hit the following exceptions.

  enforce identity:validate_token: {'is_delegated_auth': False, 'access_token_id': None, 'user_id': u'180af26c59e9460f81652569d27fc439', 'roles': ['Service'], 'user_domain_id': 'default', 'trustee_id': None, 'trustor_id': None, 'consumer_id': None, 'token': <KeystoneToken (audit_id=AP7_3Z_VRniinKe_jiFZrA, audit_chain_id=AP7_3Z_VRniinKe_jiFZrA) at 0x7f9566d5d2a0>, 'project_id': 'service', 'trust_id': None, 'project_domain_id': 'default'}
  Failed to find some config files: policy.json
  Traceback (most recent call last):
    File "keystone/common/wsgi.py", line 247, in __call__
      result = method(context, **params)
    File "/usr/local/lib/python2.7/dist-packages/oslo_log/versionutils.py", line 165, in wrapped
      return func_or_cls(*args, **kwargs)
    File "keystone/common/controller.py", line 179, in inner
      utils.flatten_dict(policy_dict))
    File "keystone/policy/backends/rules.py", line 77, in enforce
      enforce(credentials, action, target)
    File "keystone/policy/backends/rules.py", line 69, in enforce
      return _ENFORCER.enforce(action, target, credentials, **extra)
    File "/usr/local/lib/python2.7/dist-packages/oslo_policy/policy.py", line 540, in enforce
      self.load_rules()
    File "/usr/local/lib/python2.7/dist-packages/oslo_policy/policy.py", line 443, in load_rules
      self.policy_path = self._get_policy_path(self.policy_file)
    File "/usr/local/lib/python2.7/dist-packages/oslo_policy/policy.py", line 513, in _get_policy_path
      raise cfg.ConfigFilesNotFoundError((path,))
  ConfigFilesNotFoundError: Failed to find some config files: policy.json
  }}}

  Traceback (most recent call last):
    File "keystone/tests/unit/test_v2.py", line 186, in test_validate_token_service_role
      token=token)
    File "keystone/tests/unit/rest.py", line 208, in admin_request
      return self._request(app=self.admin_app, **kwargs)
    File "keystone/tests/unit/rest.py", line 197, in _request
      response = self.restful_request(**kwargs)
    File "keystone/tests/unit/rest.py", line 182, in restful_request
      **kwargs)
    File "keystone/tests/unit/rest.py", line 90, in request
      **kwargs)
    File "/usr/local/lib/python2.7/dist-packages/webtest/app.py", line 567, in request
      expect_errors=expect_errors,
    File "/usr/local/lib/python2.7/dist-packages/webtest/app.py", line 632, in do_request
      self._check_status(status, res)
    File "/usr/local/lib/python2.7/dist-packages/webtest/app.py", line 664, in _check_status
      res)
  webtest.app.AppError: Bad response: 500 Internal Server Error (not 200 OK or 3xx redirect for http://localhost/v2.0/tokens/3c69de14762f42ac89852eb1f3c7eab5)
  '{"error": {"message": "An unexpected error prevented the server from fulfilling your request.", "code": 500, "title": "Internal Server Error"}}'

  Ran 122 tests in 18.954s

  FAILED (errors=73, skipped=3)

To manage notifications about this bug go to:
https://bugs.launchpad.net/keystone/+bug/1541218/+subscriptions


Follow ups