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

Consul with both Vault binary data and a nil/None value won't back up. #61

Closed
wwalker opened this issue Aug 13, 2015 · 2 comments · Fixed by #62
Closed

Consul with both Vault binary data and a nil/None value won't back up. #61

wwalker opened this issue Aug 13, 2015 · 2 comments · Fixed by #62

Comments

@wwalker
Copy link

wwalker commented Aug 13, 2015

This is very like issue #41. If we run without the -b, we get:

wwalker@hatter:~/git/consulate (master *$%=)$ consulate --api-host tst-log3 --datacenter qa kv backup
Traceback (most recent call last):
File "/home/wwalker/.virtualenvs/consulate/bin/consulate", line 9, in
load_entry_point('consulate==0.6.0', 'console_scripts', 'consulate')()
File "build/bdist.linux-x86_64/egg/consulate/cli.py", line 469, in main
File "build/bdist.linux-x86_64/egg/consulate/cli.py", line 216, in kv_backup
File "/usr/lib64/python2.7/json/init.py", line 243, in dumps
return _default_encoder.encode(obj)
File "/usr/lib64/python2.7/json/encoder.py", line 207, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib64/python2.7/json/encoder.py", line 270, in iterencode
return _iterencode(o, 0)
UnicodeDecodeError: 'utf8' codec can't decode byte 0x94 in position 6: invalid start byte

If we run with -b we fail with:

wwalker@hatter:~/git/consulate (master $%=)$ consulate --api-host tst-log3 --datacenter qa kv backup -b
Traceback (most recent call last):
File "/home/wwalker/.virtualenvs/consulate/bin/consulate", line 9, in
load_entry_point('consulate==0.6.0', 'console_scripts', 'consulate')()
File "build/bdist.linux-x86_64/egg/consulate/cli.py", line 469, in main
File "build/bdist.linux-x86_64/egg/consulate/cli.py", line 214, in kv_backup
File "/usr/lib64/python2.7/base64.py", line 53, in b64encode
encoded = binascii.b2a_base64(s)[:-1]
TypeError: must be string or buffer, not None

We have a key with a None value.

@gmr gmr closed this as completed in #62 Aug 13, 2015
gmr added a commit that referenced this issue Aug 13, 2015
@gmr
Copy link
Owner

gmr commented Aug 13, 2015

Thanks for the fix, I'll try and get a 0.6.1 out soon

@jantman
Copy link

jantman commented Oct 14, 2015

For me, this appears fixed on python2 only. It works fine under 2.7.10, using current master (3c6ce3c). However, if I run the same kv backup command (with --base64) under python 3.4, I get:

Traceback (most recent call last):
  File "/tmp/jantman/consulate3/bin/consulate", line 9, in <module>
    load_entry_point('consulate==0.6.0', 'console_scripts', 'consulate')()
  File "/tmp/jantman/consulate3/src/consulate/consulate/cli.py", line 469, in main
    KV_ACTIONS[args.action](consul, args)
  File "/tmp/jantman/consulate3/src/consulate/consulate/cli.py", line 212, in kv_backup
    for k,f,v in records]
  File "/tmp/jantman/consulate3/src/consulate/consulate/cli.py", line 212, in <listcomp>
    for k,f,v in records]
  File "/tmp/jantman/consulate3/lib/python3.4/base64.py", line 62, in b64encode
    encoded = binascii.b2a_base64(s)[:-1]
TypeError: 'NoneType' does not support the buffer interface

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

Successfully merging a pull request may close this issue.

3 participants