Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1686652

Summary: stratis traceback when attempting to cancel fs create
Product: Red Hat Enterprise Linux 8 Reporter: Corey Marthaler <cmarthal>
Component: stratis-cliAssignee: mulhern <amulhern>
Status: CLOSED ERRATA QA Contact: Storage QE <storage-qe>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 8.0CC: amulhern, cmarthal, dkeefe, rhandlin
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: 8.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-11-05 21:04:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Corey Marthaler 2019-03-07 23:29:13 UTC
Description of problem:
[root@hayes-01 ~]# stratis fs create my_pool2 my_fs62
^C^C^C^C^C^CTraceback (most recent call last):
  File "/usr/bin/stratis", line 33, in <module>
    main()
  File "/usr/bin/stratis", line 29, in main
    return run()(sys.argv[1:])
  File "/usr/lib/python3.6/site-packages/stratis_cli/_main.py", line 48, in the_func
    result.func(result)
  File "/usr/lib/python3.6/site-packages/stratis_cli/_actions/_logical.py", line 57, in create_volumes
    get_object(pool_object_path), {'specs': namespace.fs_name})
  File "/usr/lib/python3.6/site-packages/dbus_python_client_gen/_invokers.py", line 304, in dbus_func
    return dbus_method(*xformed_args, timeout=timeout)
  File "/usr/lib64/python3.6/site-packages/dbus/proxies.py", line 145, in __call__
    **keywords)
  File "/usr/lib64/python3.6/site-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
KeyboardInterrupt


[root@hayes-01 ~]# stratis fs list | grep 62
my_pool2   my_fs62  545 MiB   Mar 07 2019 17:23  /stratis/my_pool2/my_fs62  81f6309be63b4a698f87b114ee021f29  


Version-Release number of selected component (if applicable):
stratisd-1.0.3-1.el8.x86_64
stratis-cli-1.0.2-1.el8.noarch


How reproducible:
Everytime

Comment 1 mulhern 2019-03-08 16:08:53 UTC
Thanks!

We obviously need to catch that exception and return error code 130.

Comment 2 mulhern 2019-03-08 17:12:52 UTC
Conflicting with this is the concern to ignore the keyboard interrupt while a call is being
made across the D-Bus. This is, of course, exactly the time when a user is most likely to
hit Ctrl-C. And, the CLI itself is not doing tricky stuff that should not be interrupted,
unless it's in the middle of marshalling a call on the D-Bus. So, I favor just allowing
the exception to be raised and then catching it.

Comment 3 mulhern 2019-03-08 17:37:59 UTC
Error code 130 is possibly questionable, let's stick with 1.

Comment 4 mulhern 2019-03-08 17:40:32 UTC
Like this:

[mulhern@localhost ~/stratis2/stratis-cli (master-keyboard-interrupt)]$ PYTHONPATH=./src ./bin/stratis  --version; echo $?
^CReceived KeyboardInterrupt
1

Does the above look good, or do you consider the bare exit code preferable?

Comment 5 mulhern 2019-03-08 17:49:46 UTC
GitHub issue: https://github.com/stratis-storage/stratis-cli/issues/250.

Comment 6 Corey Marthaler 2019-03-08 18:56:59 UTC
> [mulhern@localhost ~/stratis2/stratis-cli (master-keyboard-interrupt)]$
> PYTHONPATH=./src ./bin/stratis  --version; echo $?
> ^CReceived KeyboardInterrupt
> 1
> 
> Does the above look good, or do you consider the bare exit code preferable?

Above looks fine to me.

Comment 8 Jakub Krysl 2019-07-29 14:10:48 UTC
stratis-cli-1.0.4-2.el8.noarch

# stratis pool create interrupt /dev/sdb
^CReceived KeyboardInterrupt
# echo $?
1

Interrupting is now correctly caught and no longer results in traceback.

Note: The command itself gets probably interrupted when the call across D-Bus has been made resulting in the request actually being completed some time after:
# stratis pool
Name       Total Physical Size  Total Physical Used
interrupt             9.10 TiB             9.35 GiB

Comment 11 errata-xmlrpc 2019-11-05 21:04:23 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:3414