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

Provide a cleaner error message when attempting to remove a TemplateVM currently in use by other VMs #4763

Closed
andrewdavidwong opened this issue Jan 25, 2019 · 5 comments · Fixed by QubesOS/qubes-core-admin-client#298
Assignees
Labels
C: core P: minor Priority: minor. The lowest priority, below "default." pr submitted A pull request has been submitted for this issue. T: enhancement Type: enhancement. A new feature that does not yet exist or improvement of existing functionality. ux User experience

Comments

@andrewdavidwong
Copy link
Member

Qubes OS version:

R4.0

Affected component(s):

qvm-template-postprocess?


$ sudo dnf remove qubes-template-whonix-gw-14 qubes-template-whonix-ws-14
Dependencies resolved.
=============================================================================================
 Package                        Arch      Version                Repository             Size
=============================================================================================
Removing:
 qubes-template-whonix-gw-14    noarch    4.0.1-201811291216     @qubes-dom0-cached    1.9 G
 qubes-template-whonix-ws-14    noarch    4.0.1-201811291216     @qubes-dom0-cached    2.3 G

Transaction Summary
=============================================================================================
Remove  2 Packages

Installed size: 4.2 G
Is this ok [y/N]: y
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
usage: qvm-template-postprocess [--verbose] [--quiet] [--help] [--really]
                                [--skip-start] [--keep-source]
                                {post-install,pre-remove} name dir
qvm-template-postprocess: error: Qube anon-whonix uses this template
error: %preun(qubes-template-whonix-ws-14-4.0.1-201811291216.noarch) scriptlet failed, exit status 2
Error in PREUN scriptlet in rpm package qubes-template-whonix-ws-14
Error in PREUN scriptlet in rpm package qubes-template-whonix-ws-14
error: qubes-template-whonix-ws-14-4.0.1-201811291216.noarch: erase failed
usage: qvm-template-postprocess [--verbose] [--quiet] [--help] [--really]
                                [--skip-start] [--keep-source]
                                {post-install,pre-remove} name dir
qvm-template-postprocess: error: Qube sys-whonix uses this template
error: %preun(qubes-template-whonix-gw-14-4.0.1-201811291216.noarch) scriptlet failed, exit status 2
Error in PREUN scriptlet in rpm package qubes-template-whonix-gw-14
Error in PREUN scriptlet in rpm package qubes-template-whonix-gw-14
qubes-template-whonix-gw-14-4.0.1-201811291216.noarch was supposed to be removed but is not!
  Verifying   : qubes-template-whonix-gw-14-4.0.1-201811291216.noarch                    1/2 
qubes-template-whonix-ws-14-4.0.1-201811291216.noarch was supposed to be removed but is not!
  Verifying   : qubes-template-whonix-ws-14-4.0.1-201811291216.noarch                    2/2 

Removed:
  qubes-template-whonix-gw-14.noarch 4.0.1-201811291216                                      
  qubes-template-whonix-ws-14.noarch 4.0.1-201811291216                                      

Complete!

In case it's relevant, these were installed by qubesctl state.sls qvm.anon-whonix.


Related issues:

@andrewdavidwong andrewdavidwong added T: bug Type: bug report. A problem or defect resulting in unintended behavior in something that exists. C: core C: Whonix This issue impacts Qubes-Whonix labels Jan 25, 2019
@andrewdavidwong andrewdavidwong added this to the Release 4.0 updates milestone Jan 25, 2019
@andrewdavidwong
Copy link
Member Author

Oops, just noticed the message buried in there about extant VMs using this template. I'll convert this to a minor UX enhancement to make the error message just say that without all the other noise.

@andrewdavidwong andrewdavidwong added T: enhancement Type: enhancement. A new feature that does not yet exist or improvement of existing functionality. P: minor Priority: minor. The lowest priority, below "default." ux User experience and removed C: Whonix This issue impacts Qubes-Whonix T: bug Type: bug report. A problem or defect resulting in unintended behavior in something that exists. labels Jan 25, 2019
@andrewdavidwong andrewdavidwong modified the milestones: Release 4.0 updates, Far in the future Jan 25, 2019
@andrewdavidwong andrewdavidwong changed the title Errors when attempting to remove qubes-template-whonix-*-14-4.0.1-201811291216 Provide a cleaner error message when attempting to remove a TemplateVM currently in use by other VMs Jan 25, 2019
@andrewdavidwong andrewdavidwong removed this from the Release TBD milestone Aug 13, 2023
@alimirjamali
Copy link

Instead of parser.error, something better could be used here. Maybe warning messages in red color. And maybe it should warn user to use qvm-template or qvm-template-gui next time. I will work on this.

@alimirjamali
Copy link

alimirjamali commented Jul 11, 2024

@andrewdavidwong I just pushed a PR to fix this minor issue. Below is the output of dnf remove TEMPLATE after the patch. Please let me know if it is cleaner and acceptable. Or it should be further improved.

p.s.: I also recommend removing the ux label as this is a CLI utility issue and not a UI/UX issue.

[alimirjamali@dom0 Downloads]$ sudo dnf remove qubes-template-debian-11-minimal.noarch
Dependencies resolved.
======================================================================================================================================
 Package                                        Architecture         Version                             Repository              Size
======================================================================================================================================
Removing:
 qubes-template-debian-11-minimal               noarch               4.2.0-202307021203                  @@System               2.5 G

Transaction Summary
======================================================================================================================================
Remove  1 Package

Freed space: 2.5 G
Is this ok [y/N]: y
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                              1/1 
  Running scriptlet: qubes-template-debian-11-minimal-4.2.0-202307021203.noarch                                                   1/1 
qvm-template-postprocess: ERROR!!! Qube "dummyVM1" uses this template
qvm-template-postprocess: ERROR!!! Qube "dummyVM2" uses this template
qvm-template-postprocess: WARNING!!! Do not use dnf to uninstall templates!
qvm-template-postprocess: Info: Use qvm-template(1) or Qubes Template Manager GUI to uninstall templates

error: %preun(qubes-template-debian-11-minimal-4.2.0-202307021203.noarch) scriptlet failed, exit status 1

Error in PREUN scriptlet in rpm package qubes-template-debian-11-minimal
  Verifying        : qubes-template-debian-11-minimal-4.2.0-202307021203.noarch                                                   1/1 

Failed:
  qubes-template-debian-11-minimal-4.2.0-202307021203.noarch                                                                          

Error: Transaction failed
[alimirjamali@dom0 Downloads]$ 

alimirjamali added a commit to alimirjamali/qubes-core-admin-client that referenced this issue Jul 11, 2024
@andrewdavidwong
Copy link
Member Author

andrewdavidwong commented Jul 12, 2024

Below is the output of dnf remove TEMPLATE after the patch. Please let me know if it is cleaner and acceptable. Or it should be further improved.

It still seems somewhat easy to miss because there are multiple lines of text both before and after, but it's better than before.

(I'm not a fan of using multiple exclamation points in a row. Urgency is not a substitute for explanation, and it seems a bit unprofessional to me.)

p.s.: I also recommend removing the ux label as this is a CLI utility issue and not a UI/UX issue.

The command-line interface is also a user interface and can have user experience problems just like any other user interface.

@andrewdavidwong andrewdavidwong added the pr submitted A pull request has been submitted for this issue. label Jul 12, 2024
@alimirjamali
Copy link

It still seems somewhat easy to miss because there are multiple lines of text both before and after, but it's better than before.

The lines before and after the messages are regretfully from dnf interface and could not be suppressed and/or changed further.

(I'm not a fan of using multiple exclamation points in a row. Urgency is not a substitute for explanation, and it seems a bit unprofessional to me.)

Yes. You are right. I changed them to a sinle exclamation point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: core P: minor Priority: minor. The lowest priority, below "default." pr submitted A pull request has been submitted for this issue. T: enhancement Type: enhancement. A new feature that does not yet exist or improvement of existing functionality. ux User experience
Projects
None yet
2 participants