ssh.exec_command, exit_status not always properly reported?
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
tempest |
Invalid
|
Undecided
|
Paras Babbar |
Bug Description
While debugging a check failure [0] I would expect curl called through ssh.exec_command to report an error (curl: (32) Broken pipe, curl: (52) Empty reply from server or something similar), but evidently it did not.
Could there be an issue with the propagation of error return from ssh.exec_command?
The sequence of events:
The compute.
Nova metadata API successfully responds to a request to metadata:
Feb 29 00:13:30.071709 ubuntu-
Neutron metadata proxy successfully receives the request from Nova, but gets a broken pipe while writing to the client:
Feb 29 00:13:30.074089 ubuntu-
Feb 29 00:13:30.082479 ubuntu-
Feb 29 00:13:30.082479 ubuntu-
Feb 29 00:13:30.082479 ubuntu-
Feb 29 00:13:30.082479 ubuntu-
Feb 29 00:13:30.082479 ubuntu-
Feb 29 00:13:30.082479 ubuntu-
Feb 29 00:13:30.082479 ubuntu-
Feb 29 00:13:30.082479 ubuntu-
Feb 29 00:13:30.082479 ubuntu-
Feb 29 00:13:30.082479 ubuntu-
Feb 29 00:13:30.082479 ubuntu-
Feb 29 00:13:30.082479 ubuntu-
Feb 29 00:13:30.082479 ubuntu-
Feb 29 00:13:30.097994 ubuntu-
Test failure indicates that no exception was raised on the back of the command execution but a empty string was returned:
2020-02-29 00:13:50.565659 | controller | Traceback (most recent call last):
2020-02-29 00:13:50.565673 | controller | File "/opt/stack/
2020-02-29 00:13:50.565687 | controller | return f(*func_args, **func_kwargs)
2020-02-29 00:13:50.565701 | controller | File "/opt/stack/
2020-02-29 00:13:50.565714 | controller | self.verify_
2020-02-29 00:13:50.565727 | controller | File "/opt/stack/
2020-02-29 00:13:50.565754 | controller | CONF.compute.
2020-02-29 00:13:50.565770 | controller | File "/opt/stack/
2020-02-29 00:13:50.565784 | controller | if func(*args, **kwargs):
2020-02-29 00:13:50.573611 | controller | File "/opt/stack/
2020-02-29 00:13:50.573655 | controller | return verify_
2020-02-29 00:13:50.573671 | controller | File "/opt/stack/
2020-02-29 00:13:50.573685 | controller | md_dict = json.loads(md_json)
2020-02-29 00:13:50.573698 | controller | File "/opt/stack/
2020-02-29 00:13:50.573713 | controller | return json.loads(
2020-02-29 00:13:50.573727 | controller | File "/usr/lib/
2020-02-29 00:13:50.573740 | controller | return _default_
2020-02-29 00:13:50.573753 | controller | File "/usr/lib/
2020-02-29 00:13:50.573765 | controller | obj, end = self.raw_decode(s, idx=_w(s, 0).end())
2020-02-29 00:13:50.573778 | controller | File "/usr/lib/
2020-02-29 00:13:50.573791 | controller | raise JSONDecodeError
2020-02-29 00:13:50.573858 | controller | json.decoder.
0: https:/
1: https:/
description: | updated |
Changed in tempest: | |
assignee: | nobody → Paras Babbar (pbabbar) |
Hi Frode,
I am trying to understand the problem here , do you mean if the empty string is returned the function should raised an exception saying it's empty string even though the command receive successful exit status?
This is the function on client side which is returning the output data from exec_command https:/ /github. com/openstack/ tempest/ blob/8877c4e891 9a150992941d0cc 6a49227ec863fcc /tempest/ lib/common/ ssh.py# L205
So I think you mean if empty string was returned then we should raise an exception here in the out_data that empty string was returned?
Thanks