Bug 1354459

Summary: 2.0: rbd commands via API: few commands hang when used from browser
Product: [Red Hat Storage] Red Hat Ceph Storage Reporter: Harish NV Rao <hnallurv>
Component: CalamariAssignee: Boris Ranto <branto>
Calamari sub component: Back-end QA Contact: Vasishta <vashastr>
Status: CLOSED ERRATA Docs Contact: Bara Ancincova <bancinco>
Severity: medium    
Priority: medium CC: branto, ceph-eng-bugs, gmeno, kdreyer, uboppana
Version: 2.0   
Target Milestone: rc   
Target Release: 2.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: RHEL: calamari-server-1.4.9-1.el7cp Ubuntu: calamari-server_1.4.9-2redhat1xenial Doc Type: Bug Fix
Doc Text:
.Calamari no longer hangs when interactive commands are issued Previously, the Calamari REST API incorrectly attached a standard input to interactive commands, such as `rbd import`. When these commands were executed from Calamari, the Calamari user interface became unresponsive because it waited for an action from the user. The underlying source code has been modified, and Calamari no longer hangs when interactive commands are issued.
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-22 19:28:29 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:
Bug Depends On:    
Bug Blocks: 1322504, 1383917    

Description Harish NV Rao 2016-07-11 11:31:01 UTC
Description of problem:

  "rbd watch <image>" when issued from browser using POST method, hangs forever. The same command when executed from CLI, prints "press enter to exit..." and when enter is pressed it returns to command prompt. It looks like the api is waiting forever on enter to be pressed.

Version-Release number of selected component (if applicable):
 ceph version 10.2.2-15
 calamari-server-1.4.4-1.el7cp.x86_64


How reproducible: always


Steps to Reproduce:

Actual results:

Expected results:


Additional info:

Comment 2 Christina Meno 2016-07-11 22:37:43 UTC
This is of course not going to work. It might be good to filter out these interactive commands. I think it's 2.1 for sure.

Comment 4 Harish NV Rao 2016-08-01 10:17:07 UTC
The following commands have an option ("-") to specify the input from stdin. When "-" is used from browser API window, the commands hang. 

1) rbd import
2) rbd import-diff
3) rbd journal import
4) rbd merge-diff

Example: {"command":"rbd import  -  --dest-pool test_rbd --dest importedG"}

Comment 6 Christina Meno 2016-08-17 16:35:52 UTC
Looks good

Comment 7 Harish NV Rao 2016-10-03 10:00:24 UTC
@Gregory, will this be fixed in 2.1? If so, please let me know the fix.

Comment 8 Boris Ranto 2016-10-03 17:58:48 UTC
It might help if we redirect the stdin to /dev/null when we communicate with Popen in the sources, otherwise it gets attached to the running tty afaik.

Comment 9 Boris Ranto 2016-10-03 19:16:38 UTC
A sample test on my test cluster shows that it would help in the case described above as

$ rbd watch test < /dev/null 

exits immediately. I'll create an upstream PR.

Comment 10 Boris Ranto 2016-10-03 19:39:06 UTC
Patch was pushed to the following PR since it ~requires the bits from the first patch in the PR:

https://github.com/ceph/calamari/pull/490

Comment 12 Boris Ranto 2016-10-12 12:58:52 UTC
PR for 1.4 branch (applied cleanly):

https://github.com/ceph/calamari/pull/495

Comment 20 errata-xmlrpc 2016-11-22 19:28:29 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://rhn.redhat.com/errata/RHSA-2016-2815.html