ipv6 address is not being parsed correctly in memcache server

Bug #1693773 reported by Satish Yadav
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Invalid
Undecided
Unassigned
keystonemiddleware
Triaged
Low
Unassigned

Bug Description

Issue: [::1]:12111 is not being parsed correctly

File "/usr/lib/python2.7/site-packages/keystonemiddleware/auth_token/_cache.py", line 214, in get#012 with self._cache_pool.reserve() as cache:#012 File "/usr/lib64/python2.7/contextlib.py", line 17, in __enter__#012 return self.gen.next()#012 File "/usr/lib/python2.7/site-packages/keystonemiddleware/auth_token/_cache.py", line 79, in reserve#012 c = memcache.Client(self._memcached_servers, debug=0)#012 File "/usr/lib/python2.7/site-packages/memcache.py", line 219, in __init__#012 self.debug = debug#012 File "/usr/lib/python2.7/site-packages/eventlet/corolocal.py", line 48, in __setattr__#012 _patch(self)#012 File "/usr/lib/python2.7/site-packages/eventlet/corolocal.py", line 38, in _patch#012 thrl.__init__(*args, **kw)#012 File "/usr/lib/python2.7/site-packages/memcache.py", line 223, in __init__#012 self.set_servers(servers)#012 File "/usr/lib/python2.7/site-packages/memcache.py", line 302, in set_servers#012 for s in servers]#012 File "/usr/lib/python2.7/site-packages/memcache.py", line 1317, in __init__#012 raise ValueError('Unable to parse connection string: "%s"' % host)#012ValueError: Unable to parse connection string: "[::1]:11211" (txn: tx24ed617ba0c84400bc376-00590ac9aa)

[::1]:11211 should be parsed correctly. eg- ip as [::1] and port as 11211.

Revision history for this message
Tim Burke (1-tim-z) wrote :

Seems to do with how python-memcached [1] parses hosts. From digging in the code [2], I'd try a string like

    inet6:[::1]:11211

*Maybe* it'd be worth keystone-middleware inspecting its config values and massaging them before passing them to the memcache module?

Honestly, this sort of stuff is part of why we just wrote our own client [3]...

[1] https://pypi.python.org/pypi/python-memcached
[2] https://github.com/linsomniac/python-memcached/blob/1.58/memcache.py#L1349-L1350
[3] https://github.com/openstack/swift/blob/master/swift/common/memcached.py

Changed in swift:
status: New → Invalid
Revision history for this message
Lance Bragstad (lbragstad) wrote :

I'd be curious to see if Tim's suggested work around in comment #1 works. That might give some relief until we determine how much we want to sanitize data before passing it to memcache. Or until we get a proper fix upstream.

Changed in keystonemiddleware:
status: New → Triaged
importance: Undecided → Low
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.