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

qvm-backup-restore should be more defensive #212

Closed
marmarek opened this Issue Mar 8, 2015 · 6 comments

Comments

Projects
None yet
2 participants
@marmarek
Member

marmarek commented Mar 8, 2015

Reported by joanna on 8 Apr 2011 15:05 UTC
It should not throw an exception whenever e.g. it cannot find some apps folder (create appmenus), etc. It's really annoying when it throws an exception after it copied a few tens of GBs of data, only because create_apps_for_appvm.sh returned error. And the user gets a half-restored system, which is really not good.

Migrated-From: https://wiki.qubes-os.org/ticket/212

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Mar 8, 2015

Member

Modified by joanna on 10 Apr 2011 11:21 UTC

Member

marmarek commented Mar 8, 2015

Modified by joanna on 10 Apr 2011 11:21 UTC

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Mar 8, 2015

Member

Modified by marmarek on 20 Apr 2011 17:48 UTC

Member

marmarek commented Mar 8, 2015

Modified by marmarek on 20 Apr 2011 17:48 UTC

@marmarek marmarek assigned marmarek and unassigned rootkovska Mar 8, 2015

@marmarek

This comment has been minimized.

Show comment
Hide comment

@marmarek marmarek closed this Mar 8, 2015

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Mar 8, 2015

Member

Comment by joanna on 17 Jul 2011 23:15 UTC
Nope, it still crashes when encounters a simple problem e.g. with appmenus restoring. This is what I just got:

(...)
-> Adding AppVM qbdev-f13...
Traceback (most recent call last):
  File "/usr/bin/qvm-backup-restore", line 399, in <module>
    main()
  File "/usr/bin/qvm-backup-restore", line 382, in main
    vm.create_appmenus(verbose=True)
  File "/usr/lib64/python2.6/site-packages/qubes/qubes.py", line 750, in create_appmenus
    subprocess.check_call (["none", self.name, vmtype](qubes_appmenu_create_cmd,))
NameError: global name 'vmtype' is not defined

qvm-backup-restore crashed and left the user with half-restored systems, where none of the appvms are seen in the manager, yet some appmenus are seen in the menu. Now, the user must manually use qvm-add-appvm, and then qvm-pref (to set the label). (And how to create appmenus?).

What a mess!

So, qvm-backup-restore should catch all the exceptions, and even if it cannot restore one AppVM it should continue trying with others.

Also, I think we should change the loop logic, from:

for each VM {

  1. copy files
    }
    for each VM {
  2. restore appmenus
    }
    for each VM {
  3. add to qubes DB
    }

to:

for each VM {

  1. copy files
  2. restore appmenus
  3. add to qubes DB
    }

This would ensure we won't get half of the VMs in half-restored state when we screwed up and didn't catch some exception.

Member

marmarek commented Mar 8, 2015

Comment by joanna on 17 Jul 2011 23:15 UTC
Nope, it still crashes when encounters a simple problem e.g. with appmenus restoring. This is what I just got:

(...)
-> Adding AppVM qbdev-f13...
Traceback (most recent call last):
  File "/usr/bin/qvm-backup-restore", line 399, in <module>
    main()
  File "/usr/bin/qvm-backup-restore", line 382, in main
    vm.create_appmenus(verbose=True)
  File "/usr/lib64/python2.6/site-packages/qubes/qubes.py", line 750, in create_appmenus
    subprocess.check_call (["none", self.name, vmtype](qubes_appmenu_create_cmd,))
NameError: global name 'vmtype' is not defined

qvm-backup-restore crashed and left the user with half-restored systems, where none of the appvms are seen in the manager, yet some appmenus are seen in the menu. Now, the user must manually use qvm-add-appvm, and then qvm-pref (to set the label). (And how to create appmenus?).

What a mess!

So, qvm-backup-restore should catch all the exceptions, and even if it cannot restore one AppVM it should continue trying with others.

Also, I think we should change the loop logic, from:

for each VM {

  1. copy files
    }
    for each VM {
  2. restore appmenus
    }
    for each VM {
  3. add to qubes DB
    }

to:

for each VM {

  1. copy files
  2. restore appmenus
  3. add to qubes DB
    }

This would ensure we won't get half of the VMs in half-restored state when we screwed up and didn't catch some exception.

@marmarek marmarek added P: critical and removed P: major labels Mar 8, 2015

@marmarek marmarek reopened this Mar 8, 2015

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Mar 8, 2015

Member

Modified by marmarek on 20 Jul 2011 15:18 UTC

Member

marmarek commented Mar 8, 2015

Modified by marmarek on 20 Jul 2011 15:18 UTC

@marmarek marmarek closed this Mar 8, 2015

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