vault_plugin: TypeError: 'NoneType' object is not subscriptable on secret_store operation

Bug #1799132 reported by Frode Nordahl
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ubuntu Cloud Archive
Triaged
High
Unassigned
Rocky
Triaged
High
Unassigned
castellan
Fix Released
Undecided
Unassigned
python-castellan (Ubuntu)
Triaged
High
Unassigned
Cosmic
Won't Fix
High
Unassigned
Disco
Won't Fix
High
Unassigned

Bug Description

Modified `castellan/key_manager/vault_key_manager.py` to get extra debug output below:
[Mon Oct 22 06:20:58.543811 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372] 2018-10-22 06:20:58.543 5780 DEBUG barbican.model.repositories [req-04b83251-4b59-49ff-ad86-3af6eb98b9ec 6abd0959b63546d0bd4f4f4e5a84e485 b99281f6b15b453aa9140bf0622d689e - bb39d2073fa9418d9bb97897a7809a39 bb39d2073fa9418d9bb97897a7809a39] Getting session... get_session /usr/lib/python3/dist-packages/barbican/model/repositories.py:363\x1b[00m
[Mon Oct 22 06:20:58.605091 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372] {'auth': None,
[Mon Oct 22 06:20:58.605138 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372]
[Mon Oct 22 06:20:58.605395 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372] 'data': {'accessor': 'kv_5b25ebdf',
[Mon Oct 22 06:20:58.605421 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372]
[Mon Oct 22 06:20:58.605561 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372] 'config': {'default_lease_ttl': 0,
[Mon Oct 22 06:20:58.605581 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372]
[Mon Oct 22 06:20:58.605617 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372] 'force_no_cache': False,
[Mon Oct 22 06:20:58.605638 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372]
[Mon Oct 22 06:20:58.605674 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372] 'max_lease_ttl': 0,
[Mon Oct 22 06:20:58.605688 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372]
[Mon Oct 22 06:20:58.605730 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372] 'plugin_name': ''},
[Mon Oct 22 06:20:58.605745 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372]
[Mon Oct 22 06:20:58.605782 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372] 'description': 'Charm created KV backend',
[Mon Oct 22 06:20:58.605816 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372]
[Mon Oct 22 06:20:58.605851 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372] 'local': False,
[Mon Oct 22 06:20:58.605864 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372]
[Mon Oct 22 06:20:58.605899 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372] 'options': None,
[Mon Oct 22 06:20:58.605913 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372]
[Mon Oct 22 06:20:58.605948 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372] 'path': 'charm-barbican-vault/',
[Mon Oct 22 06:20:58.605962 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372]
[Mon Oct 22 06:20:58.605996 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372] 'seal_wrap': False,
[Mon Oct 22 06:20:58.606010 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372]
[Mon Oct 22 06:20:58.606050 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372] 'type': 'kv'},
[Mon Oct 22 06:20:58.606063 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372]
[Mon Oct 22 06:20:58.606099 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372] 'lease_duration': 0,
[Mon Oct 22 06:20:58.606113 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372]
[Mon Oct 22 06:20:58.606149 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372] 'lease_id': '',
[Mon Oct 22 06:20:58.606163 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372]
[Mon Oct 22 06:20:58.606196 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372] 'renewable': False,
[Mon Oct 22 06:20:58.606210 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372]
[Mon Oct 22 06:20:58.606246 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372] 'request_id': '26a98ddc-d22d-04fa-b5ba-c78f9f264cfe',
[Mon Oct 22 06:20:58.606261 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372]
[Mon Oct 22 06:20:58.606295 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372] 'warnings': None,
[Mon Oct 22 06:20:58.606309 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372]
[Mon Oct 22 06:20:58.606351 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372] 'wrap_info': None}
[Mon Oct 22 06:20:58.608802 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372] 2018-10-22 06:20:58.606 5780 ERROR barbican.plugin.castellan_secret_store [req-04b83251-4b59-49ff-ad86-3af6eb98b9ec 6abd0959b63546d0bd4f4f4e5a84e485 b99281f6b15b453aa9140bf0622d689e - bb39d2073fa9418d9bb97897a7809a39 bb39d2073fa9418d9bb97897a7809a39] Error storing secret: 'NoneType' object is not subscriptable: TypeError: 'NoneType' object is not subscriptable
[Mon Oct 22 06:20:58.608841 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372] 2018-10-22 06:20:58.606 5780 ERROR barbican.plugin.castellan_secret_store Traceback (most recent call last):
[Mon Oct 22 06:20:58.608854 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372] 2018-10-22 06:20:58.606 5780 ERROR barbican.plugin.castellan_secret_store File "/usr/lib/python3/dist-packages/barbican/plugin/castellan_secret_store.py", line 86, in store_secret
[Mon Oct 22 06:20:58.608863 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372] 2018-10-22 06:20:58.606 5780 ERROR barbican.plugin.castellan_secret_store opaque_data.OpaqueData(secret_dto.secret)
[Mon Oct 22 06:20:58.608872 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372] 2018-10-22 06:20:58.606 5780 ERROR barbican.plugin.castellan_secret_store File "/usr/lib/python3/dist-packages/castellan/key_manager/vault_key_manager.py", line 321, in store
[Mon Oct 22 06:20:58.608896 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372] 2018-10-22 06:20:58.606 5780 ERROR barbican.plugin.castellan_secret_store return self._store_key_value(key_id, key_value)
[Mon Oct 22 06:20:58.608907 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372] 2018-10-22 06:20:58.606 5780 ERROR barbican.plugin.castellan_secret_store File "/usr/lib/python3/dist-packages/castellan/key_manager/vault_key_manager.py", line 286, in _store_key_value
[Mon Oct 22 06:20:58.608916 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372] 2018-10-22 06:20:58.606 5780 ERROR barbican.plugin.castellan_secret_store if self._get_api_version() != '1':
[Mon Oct 22 06:20:58.608925 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372] 2018-10-22 06:20:58.606 5780 ERROR barbican.plugin.castellan_secret_store File "/usr/lib/python3/dist-packages/castellan/key_manager/vault_key_manager.py", line 134, in _get_api_version
[Mon Oct 22 06:20:58.608935 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372] 2018-10-22 06:20:58.606 5780 ERROR barbican.plugin.castellan_secret_store self._vault_kv_version = resp.json()['data']['options']['version']
[Mon Oct 22 06:20:58.608944 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372] 2018-10-22 06:20:58.606 5780 ERROR barbican.plugin.castellan_secret_store TypeError: 'NoneType' object is not subscriptable
[Mon Oct 22 06:20:58.608956 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372] 2018-10-22 06:20:58.606 5780 ERROR barbican.plugin.castellan_secret_store \x1b[00m
[Mon Oct 22 06:20:58.608971 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372]
[Mon Oct 22 06:20:58.610925 2018] [wsgi:error] [pid 5780:tid 139629518890752] [remote 10.130.236.83:50372] 2018-10-22 06:20:58.609 5780 ERROR barbican.api.controllers [req-04b83251-4b59-49ff-ad86-3af6eb98b9ec 6abd0959b63546d0bd4f4f4e5a84e485 b99281f6b15b453aa9140bf0622d689e - bb39d2073fa9418d9bb97897a7809a39 bb39d2073fa9418d9bb97897a7809a39] Secret update failure seen - please contact site administrator.: barbican.plugin.interface.secret_store.SecretGeneralException: Problem seen during crypto processing - Reason: 'NoneType' object is not subscriptable

Revision history for this message
Frode Nordahl (fnordahl) wrote :
Revision history for this message
Corey Bryant (corey.bryant) wrote :

I wonder if this is limited to python 3.

Changed in python-castellan (Ubuntu):
status: New → Triaged
importance: Undecided → High
Changed in cloud-archive:
status: New → Triaged
importance: Undecided → High
Revision history for this message
cronay walls (cronywalls) wrote :

In general, the error means that you attempted to index an object that doesn't have that functionality. You are trying to subscript an object which you think is a list or dict, but actually is None. NoneType is the type of the None object which represents a lack of value, for example, a function that does not explicitly return a value will return None. 'NoneType' object is not subscriptable is the one thrown by python when you use the square bracket notation object[key] where an object doesn't define the __getitem__ method . e.g.: http://net-informations.com/python/err/nonetype.htm

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on castellan (master)

Change abandoned by Stephen Finucane (<email address hidden>) on branch: master
Review: https://review.opendev.org/612253
Reason: This has had open comments for some time now and the fix doesn't seem correct. I'm going to abandon this in case someone else wants to take a stab at resolving this.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by Stephen Finucane (<email address hidden>) on branch: master
Review: https://review.opendev.org/612253
Reason: We're going to tackle this via https://review.opendev.org/#/c/736406/4 so I think this is safe to remvoe

Revision history for this message
Steve Langasek (vorlon) wrote :

Ubuntu 19.04 reached end of life on January 23, 2020. I am therefore marking this bug 'wontfix' for that release.

Changed in python-castellan (Ubuntu Disco):
status: Triaged → Won't Fix
Changed in python-castellan (Ubuntu Cosmic):
status: Triaged → Won't Fix
Revision history for this message
Takashi Kajinami (kajinamit) wrote :
Changed in castellan:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.