Bug 1402359 - Calling storage apis with incorrect arguments log tracebacks in vdsm log
Summary: Calling storage apis with incorrect arguments log tracebacks in vdsm log
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: vdsm
Classification: oVirt
Component: Core
Version: 4.18.0
Hardware: Unspecified
OS: Unspecified
low
low vote
Target Milestone: ---
: ---
Assignee: Idan Shaby
QA Contact: Elad
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-12-07 10:53 UTC by Nir Soffer
Modified: 2022-06-27 08:04 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-07-02 08:27:29 UTC
oVirt Team: Storage
sbonazzo: ovirt-4.3-


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHV-46628 0 None None None 2022-06-27 08:04:51 UTC

Description Nir Soffer 2016-12-07 10:53:44 UTC
Description of problem:

Calling storage apis with incorrect arguments log tracebacks in the log:

2016-12-07 10:09:52,868 ERROR (jsonrpc/3) [storage.TaskManager.Task] (Task='a046981d-7fb2-4081-9bd9-f12e45ddf817') Unexpected error (task:870)
Traceback (most recent call last):
  File "/usr/share/vdsm/storage/task.py", line 877, in _run
    return fn(*args, **kargs)
  File "/usr/lib/python2.7/site-packages/vdsm/logUtils.py", line 50, in wrapper
    res = f(*args, **kwargs)
  File "/usr/share/vdsm/storage/hsm.py", line 2496, in getStoragePoolInfo
    pool = self.getPool(spUUID)
  File "/usr/share/vdsm/storage/hsm.py", line 327, in getPool
    raise se.StoragePoolUnknown(spUUID)
StoragePoolUnknown: Unknown pool id, pool not connected: (u'xxxyyy',)

In this case, the pool id (xxxyyy) was incorrect.

This is a user error and not vdsm error, so we should log a warning instead.
The text of the exception is a good description of the warning, so we just
need to handle the exception properly in the top level error handler.

To handle exceptions  properly, vdsm needs to have a sane exception hierarchy:

    VdsmError
        ClientError
            InvalidArgument
            PoolNotConnected
            ...
        ServerError
            
Then the top level handler can log ClientError as warnings, and ServerError with
useful traceback.

Version-Release number of selected component (if applicable):
Any

How reproducible:
Always

Steps to Reproduce:
1. Call with invalid argument, or call a method which is not allowed in the
   current state (e.g spm method when spm is not started).

We have the same issue in other parts of the code (infra, virt, sla).

Comment 1 Tal Nisan 2018-07-02 08:27:29 UTC
Closing old bugs, please reopen if still needed, in any case patches are welcome.


Note You need to log in before you can comment on or make changes to this bug.