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

exception during an exception #18

Open
ccomb opened this issue Mar 28, 2018 · 0 comments
Open

exception during an exception #18

ccomb opened this issue Mar 28, 2018 · 0 comments

Comments

@ccomb
Copy link
Member

ccomb commented Mar 28, 2018

Found an error in the display of an exception.
To reproduce it : start buttervolume with a wrong mount of /var/lib/buttervolume so that it is not a BTRFS filesystem or subvolume. Then try to create a volume with docker volume create -d btrfs truuc :

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/buttervolume-2.0.0-py3.5.egg/buttervolume/plugin.py", line 64, in volume_create
    btrfs.Subvolume(volpath).create()
  File "/usr/local/lib/python3.5/dist-packages/buttervolume-2.0.0-py3.5.egg/buttervolume/btrfs.py", line 40, in create
    out = run('btrfs subvolume create "{}"'.format(self.path))
  File "/usr/local/lib/python3.5/dist-packages/buttervolume-2.0.0-py3.5.egg/buttervolume/btrfs.py", line 7, in run
    stderr=stderr).stdout.decode()
  File "/usr/lib/python3.5/subprocess.py", line 398, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command 'btrfs subvolume create "/var/lib/buttervolume/volumes/truuc"' returned non-zero exit status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/bottle-0.12.13-py3.5.egg/EGG-INFO/scripts/bottle.py", line 862, in _handle
    return route.call(**args)
  File "/usr/local/lib/python3.5/dist-packages/bottle-0.12.13-py3.5.egg/EGG-INFO/scripts/bottle.py", line 1740, in wrapper
    rv = callback(*a, **ka)
  File "/usr/local/lib/python3.5/dist-packages/buttervolume-2.0.0-py3.5.egg/buttervolume/plugin.py", line 66, in volume_create
    return json.dumps({'Err': e.stderr})
  File "/usr/lib/python3.5/json/__init__.py", line 230, in dumps
    return _default_encoder.encode(obj)
  File "/usr/lib/python3.5/json/encoder.py", line 198, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/lib/python3.5/json/encoder.py", line 256, in iterencode
    return _iterencode(o, 0)
  File "/usr/lib/python3.5/json/encoder.py", line 179, in default
    raise TypeError(repr(o) + " is not JSON serializable")
TypeError: b'ERROR: not a btrfs filesystem: /var/lib/buttervolume/volumes\n' is not JSON serializable


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

1 participant