Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: string indices must be integers, not str #32

Open
danfinkelstein opened this issue May 8, 2013 · 1 comment
Open

TypeError: string indices must be integers, not str #32

danfinkelstein opened this issue May 8, 2013 · 1 comment

Comments

@danfinkelstein
Copy link

Seemingly randomly, the output from clb list isn't a list of the load balancers but this error:

Traceback (most recent call last):
File "/usr/local/bin/clb", line 5, in
pkg_resources.run_script('clb==0.0.1', 'clb')
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 499, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1239, in run_script
execfile(script_filename, namespace, namespace)
File "/usr/local/lib/python2.7/dist-packages/clb-0.0.1-py2.7.egg/EGG-INFO/scripts/clb", line 919, in
CloudloadbalancersShell().main(sys.argv[1:])
File "/usr/local/lib/python2.7/dist-packages/clb-0.0.1-py2.7.egg/EGG-INFO/scripts/clb", line 196, in main
args.func(args)
File "/usr/local/lib/python2.7/dist-packages/clb-0.0.1-py2.7.egg/EGG-INFO/scripts/clb", line 302, in do_list
lbs = self.clb.loadbalancers.list()
File "/usr/local/lib/python2.7/dist-packages/python_cloudlb-0.5.1-py2.7.egg/cloudlb/loadbalancers.py", line 126, in list
self._list("/loadbalancers.json", "loadBalancers")
File "/usr/local/lib/python2.7/dist-packages/python_cloudlb-0.5.1-py2.7.egg/cloudlb/base.py", line 57, in _list
resp, body = self.api.client.get(url)
File "/usr/local/lib/python2.7/dist-packages/python_cloudlb-0.5.1-py2.7.egg/cloudlb/client.py", line 183, in get
return self._cloudlb_request(url, 'GET', **kwargs)
File "/usr/local/lib/python2.7/dist-packages/python_cloudlb-0.5.1-py2.7.egg/cloudlb/client.py", line 159, in _cloudlb_request
message = ', '.join(body['messages'])
TypeError: string indices must be integers, not str

@haghabozorgi
Copy link

I am getting this too. Oddly this was working fine with a normal user, the only caveat I could fine was needing to change perms of cacerts.txt under the cloudlb module. Then magically this morning, I started getting the same type of error:
$ scl enable python27 "clb list"
Traceback (most recent call last):
File "/opt/rh/python27/root/usr/bin/clb", line 5, in
pkg_resources.run_script('clb==0.0.1', 'clb')
File "/opt/rh/python27/root/usr/lib/python2.7/site-packages/pkg_resources.py", line 540, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/opt/rh/python27/root/usr/lib/python2.7/site-packages/pkg_resources.py", line 1455, in run_script
execfile(script_filename, namespace, namespace)
File "/opt/rh/python27/root/usr/lib/python2.7/site-packages/clb-0.0.1-py2.7.egg/EGG-INFO/scripts/clb", line 1015, in
CloudloadbalancersShell().main(sys.argv[1:])
File "/opt/rh/python27/root/usr/lib/python2.7/site-packages/clb-0.0.1-py2.7.egg/EGG-INFO/scripts/clb", line 199, in main
args.func(args)
File "/opt/rh/python27/root/usr/lib/python2.7/site-packages/clb-0.0.1-py2.7.egg/EGG-INFO/scripts/clb", line 308, in do_list
lbs = self.clb.loadbalancers.list()
File "/opt/rh/python27/root/usr/lib/python2.7/site-packages/python_cloudlb-0.6.2-py2.7.egg/cloudlb/loadbalancers.py", line 127, in list
self._list("/loadbalancers.json", "loadBalancers")
File "/opt/rh/python27/root/usr/lib/python2.7/site-packages/python_cloudlb-0.6.2-py2.7.egg/cloudlb/base.py", line 59, in _list
resp, body = self.api.client.get(url)
File "/opt/rh/python27/root/usr/lib/python2.7/site-packages/python_cloudlb-0.6.2-py2.7.egg/cloudlb/client.py", line 191, in get
return self._cloudlb_request(url, 'GET', **kwargs)
File "/opt/rh/python27/root/usr/lib/python2.7/site-packages/python_cloudlb-0.6.2-py2.7.egg/cloudlb/client.py", line 170, in _cloudlb_request
message = ', '.join(body['messages'])
TypeError: string indices must be integers, not str

This is centos 6.6 running python2.7 from the centOS SCL repo.
NOTE, if run as root user it works as expected though. Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants