Skip pulling data from cluster due to error: malformed string: ValueError: malformed string

Bug #1720985 reported by Michal Nasiadka
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Magnum
Incomplete
Undecided
Unassigned
magnum (Ubuntu)
New
Undecided
Unassigned

Bug Description

Environment: kolla stable/pike deployment
python-k8sclient version: 0.4.0

2017-10-03 11:19:17.883 44 WARNING magnum.service.periodic [req-b1ec57d8-bd6a-4edf-8d4f-3c089841ab28 - - - - -] Skip pulling data from cluster 550ecbaa-290f-4e3e-a436-0f7fe2eafccd due to error: malformed string: ValueError: malformed string
2017-10-03 11:19:17.883 44 ERROR magnum.service.periodic Traceback (most recent call last):
2017-10-03 11:19:17.883 44 ERROR magnum.service.periodic File "/usr/lib/python2.7/dist-packages/magnum/service/periodic.py", line 156, in _send_cluster_metrics
2017-10-03 11:19:17.883 44 ERROR magnum.service.periodic monitor.pull_data()
2017-10-03 11:19:17.883 44 ERROR magnum.service.periodic File "/usr/lib/python2.7/dist-packages/magnum/drivers/common/k8s_monitor.py", line 46, in pull_data
2017-10-03 11:19:17.883 44 ERROR magnum.service.periodic self.data['pods'] = self._parse_pod_info(pods)
2017-10-03 11:19:17.883 44 ERROR magnum.service.periodic File "/usr/lib/python2.7/dist-packages/magnum/drivers/common/k8s_monitor.py", line 116, in _parse_pod_info
2017-10-03 11:19:17.883 44 ERROR magnum.service.periodic limits = ast.literal_eval(limits)
2017-10-03 11:19:17.883 44 ERROR magnum.service.periodic File "/usr/lib/python2.7/ast.py", line 80, in literal_eval
2017-10-03 11:19:17.883 44 ERROR magnum.service.periodic return _convert(node_or_string)
2017-10-03 11:19:17.883 44 ERROR magnum.service.periodic File "/usr/lib/python2.7/ast.py", line 79, in _convert
2017-10-03 11:19:17.883 44 ERROR magnum.service.periodic raise ValueError('malformed string')
2017-10-03 11:19:17.883 44 ERROR magnum.service.periodic ValueError: malformed string
2017-10-03 11:19:17.883 44 ERROR magnum.service.periodic

Revision history for this message
Spyros Trigazis (strigazi) wrote :

We are no longer using python-k8sclient.

magnum pike uses "kubernetes"

http://git.openstack.org/cgit/openstack/magnum/tree/requirements.txt?h=stable%2Fpike#n23

Please check which version of magnum you have in the kolla images.

Changed in magnum:
status: New → Incomplete
Revision history for this message
Billy Olsen (billy-olsen) wrote :

The Ubuntu packages patch in the python-k8sclient as the kubernetes client isn't a debian package in the Ubuntu archives.

Revision history for this message
Spyros Trigazis (strigazi) wrote :

I'm not sure what comment #2 means. This issue in magnum is fixed since ocata [1].

[1] http://git.openstack.org/cgit/openstack/magnum/tree/requirements.txt?h=stable%2Focata#n23

Revision history for this message
Michal Nasiadka (mnasiadka) wrote :

Hello,
Coming back to this issue - using stable/pike now, kubernetes package is installed using pip, but the same happens:

2017-11-24 14:04:44.412 55 WARNING magnum.service.periodic [req-01c48818-f332-45e7-b3e4-61e8687961cb - - - - -] Skip pulling data from cluster a1a51dd7-c16a-4bfa-a096-b5aba9bc67c0 due to error: 'object' object has no attribute '__getitem__': TypeError: 'object' object has no attribute '__getitem__'
2017-11-24 14:04:44.412 55 ERROR magnum.service.periodic Traceback (most recent call last):
2017-11-24 14:04:44.412 55 ERROR magnum.service.periodic File "/usr/lib/python2.7/dist-packages/magnum/service/periodic.py", line 156, in _send_cluster_metrics
2017-11-24 14:04:44.412 55 ERROR magnum.service.periodic monitor.pull_data()
2017-11-24 14:04:44.412 55 ERROR magnum.service.periodic File "/usr/lib/python2.7/dist-packages/magnum/drivers/common/k8s_monitor.py", line 44, in pull_data
2017-11-24 14:04:44.412 55 ERROR magnum.service.periodic self.data['nodes'] = self._parse_node_info(nodes)
2017-11-24 14:04:44.412 55 ERROR magnum.service.periodic File "/usr/lib/python2.7/dist-packages/magnum/drivers/common/k8s_monitor.py", line 162, in _parse_node_info
2017-11-24 14:04:44.412 55 ERROR magnum.service.periodic memory = utils.get_k8s_quantity(capacity['memory'])
2017-11-24 14:04:44.412 55 ERROR magnum.service.periodic TypeError: 'object' object has no attribute '__getitem__'
2017-11-24 14:04:44.412 55 ERROR magnum.service.periodic

(magnum-conductor)[magnum@ucsubu3000 magnum]$ pip freeze | grep kubernetes
You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
kubernetes==4.0.0

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.