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

Configuration get of a unicode raises exceptions #206

Open
JeffreyDevloo opened this issue Feb 15, 2019 · 2 comments
Open

Configuration get of a unicode raises exceptions #206

JeffreyDevloo opened this issue Feb 15, 2019 · 2 comments

Comments

@JeffreyDevloo
Copy link
Contributor

Happens on

In [3]: !apt-cache policy openvstorage-extensions
openvstorage-extensions:
  Installed: 0.1.7-1
  Candidate: 0.1.7-1
  Version table:
 *** 0.1.7-1 1000
       1000 http://apt-ee.openvstorage.com andes-updates-4/main amd64 Packages
        100 /var/lib/dpkg/status

In [2]: Configuration.get(u'a_unicode')
2019-02-15 11:55:17 71100 +0100 - DEV-3N-199-181 - 26019/140635587397376 - extensions/client.py - 0 - ERROR - Error during get. Process 26019, thread 140635587397376, clientid 7877918
---------------------------------------------------------------------------
ArakoonInvalidArguments                   Traceback (most recent call last)
<ipython-input-2-f255acc3a229> in <module>()
----> 1 Configuration.get(u'a_unicode')

/usr/lib/python2.7/dist-packages/ovs_extensions/generic/configuration.pyc in get(cls, key, raw, **kwargs)
    105         try:
    106             key_entries = key.split('|')
--> 107             data = cls._get(key_entries[0], raw, **kwargs)
    108             if len(key_entries) == 1:
    109                 return data

/usr/lib/python2.7/dist-packages/ovs_extensions/generic/configuration.pyc in _get(cls, key, raw, **kwargs)
    296             data = cls._passthrough(method='get',
    297                                     key=key,
--> 298                                     **kwargs)
    299         if raw is True:
    300             return data

/usr/lib/python2.7/dist-packages/ovs_extensions/generic/configuration.pyc in _passthrough(cls, method, *args, **kwargs)
    330             try:
    331                 instance = ArakoonConfiguration(**params)
--> 332                 return getattr(instance, method)(*args, **kwargs)
    333             except ArakoonNotFound as ex:
    334                 raise NotFoundException(ex.message)

/usr/lib/python2.7/dist-packages/ovs_extensions/db/arakoon/configuration.pyc in get(self, key, **kwargs)
    115         key = ArakoonConfiguration._clean_key(key)
    116         client = self.get_client()
--> 117         return client.get(key, **kwargs)
    118 
    119     def set(self, key, value):

/usr/lib/python2.7/dist-packages/ovs_extensions/db/arakoon/pyrakoon/client.pyc in new_function(self, *args, **kw)
     47             """
     48             with self._lock:
---> 49                 return f(self, *args, **kw)
     50         return new_function
     51     return wrap

/usr/lib/python2.7/dist-packages/ovs_extensions/db/arakoon/pyrakoon/client.pyc in wrapped(self, *args, **kwargs)
     84                 while retries > tries:
     85                     try:
---> 86                         result = f(self, *args, **kwargs)
     87                         duration = time.time() - start
     88                         if duration > max_duration:

/usr/lib/python2.7/dist-packages/ovs_extensions/db/arakoon/pyrakoon/client.pyc in get(self, key, consistency)
    170         :rtype: any
    171         """
--> 172         return self._client.get(key, consistency)
    173 
    174     @locked()

<update_argspec> in get(self, key, consistency)

/usr/lib/python2.7/dist-packages/ovs_extensions/db/arakoon/pyrakoon/pyrakoon/compat.pyc in wrapped(*args, **kwargs)
    173                 raise
    174 
--> 175             raise new_exception
    176 
    177     return wrapped

ArakoonInvalidArguments: Invalid argument(s) for get: key=<ovs_extensions.db.arakoon.pyrakoon.pyrakoon.compat.ArakoonClient object at 0x7fe841999d90>
@JeffreyDevloo
Copy link
Contributor Author

Also happens for 0.1.5-1

@sjovdnbos
Copy link
Contributor

sjovdnbos commented Mar 5, 2019

The key shown in the error message is a false key and the result of wrong indexing and subsequent wrong error formatting.
I circumvented the issue by casting unicode to string before the pyrakoon client executes its type checking

Fixed in

#213

Package information:

openvstorage-extensions-0.5.3-dev.1551796013.5e25eee

Made pyrakoon ticket to solve underlying problem:
openvstorage/pyrakoon#23

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

No branches or pull requests

2 participants