This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 822162 - Bad error message translation in REST API
Bad error message translation in REST API
Status: CLOSED WONTFIX
Product: oVirt
Classification: Community
Component: ovirt-engine-api (Show other bugs)
unspecified
x86_64 Linux
unspecified Severity medium
: ---
: ---
Assigned To: Michael Pasternak
Barak Dagan
infra
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-16 10:07 EDT by Petr Dufek
Modified: 2014-07-13 19:18 EDT (History)
12 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-12-01 04:12:19 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Petr Dufek 2012-05-16 10:07:47 EDT
Description of problem:
in RESTAPI:
2012-05-16 14:40:42,593 - MainThread - storagedomains - DEBUG - CREATE request content is --  url:https://pd-rhsetup.rhev.lab.eng.brq.redhat.com/api/storagedomains body:<storage_domain><name>DataDomainRest2</name><type>data</type><storage><type>nfs</type><address>{data_domain_address[1]}</address><path>/pd02</path></storage><host><name>10.34.63.208</name></host></storage_domain>
2012-05-16 14:40:45,174 - MainThread - storagedomains - DEBUG - Response body for CREATE request is: <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<fault>
    <reason>Operation Failed</reason>
    <detail>[]</detail>
</fault>

in this summary can be seen that {data_domain_address[1]} was not valid address

engine log:
2012-05-16 14:40:42,777 ERROR [org.ovirt.engine.core.bll.storage.NFSStorageHelper] (ajp--0.0.0.0-8009-10) [2b9e15c4] The connection with details {data_domain_address[1]}:/pd02 failed because of error code 477 and error message is: 477
2012-05-16 14:40:42,786 INFO  [org.ovirt.engine.core.bll.storage.GetExistingStorageDomainListQuery] (ajp--0.0.0.0-8009-10) START, GetExistingStorageDomainListQuery(org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters@44bc2057), log id: 2bdf1c51
2012-05-16 14:40:42,791 INFO  [org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainsListVDSCommand] (ajp--0.0.0.0-8009-10) START, HSMGetStorageDomainsListVDSCommand(vdsId = 4af9d54e-9f51-11e1-a39e-001a4a013f46, storagePoolId=00000000-0000-0000-0000-000000000000, storageType=NFS, storageDomainType=Data, path={data_domain_address[1]}:/pd02), log id: 4b6ad97b
2012-05-16 14:40:44,860 INFO  [org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainsListVDSCommand] (ajp--0.0.0.0-8009-10) FINISH, HSMGetStorageDomainsListVDSCommand, return: [], log id: 4b6ad97b
2012-05-16 14:40:44,861 INFO  [org.ovirt.engine.core.bll.storage.GetExistingStorageDomainListQuery] (ajp--0.0.0.0-8009-10) FINISH, GetExistingStorageDomainListQuery, log id: 2bdf1c51
2012-05-16 14:40:44,891 INFO  [org.ovirt.engine.core.bll.storage.AddNFSStorageDomainCommand] (ajp--0.0.0.0-8009-10) [4aaaa7d6] Running command: AddNFSStorageDomainCommand internal: false. Entities affected :  ID: aaa00000-0000-0000-0000-123456789aaa Type: System
2012-05-16 14:40:44,910 INFO  [org.ovirt.engine.core.vdsbroker.vdsbroker.CreateStorageDomainVDSCommand] (ajp--0.0.0.0-8009-10) [4aaaa7d6] START, CreateStorageDomainVDSCommand(vdsId = 4af9d54e-9f51-11e1-a39e-001a4a013f46, storageDomain=org.ovirt.engine.core.common.businessentities.storage_domain_static@cce33b8, args={data_domain_address[1]}:/pd02), log id: 34af1ca8
2012-05-16 14:40:45,054 ERROR [org.ovirt.engine.core.vdsbroker.vdsbroker.BrokerCommandBase] (ajp--0.0.0.0-8009-10) [4aaaa7d6] Failed in CreateStorageDomainVDS method
2012-05-16 14:40:45,056 ERROR [org.ovirt.engine.core.vdsbroker.vdsbroker.BrokerCommandBase] (ajp--0.0.0.0-8009-10) [4aaaa7d6] Error code StorageDomainFSNotMounted and error message VDSGenericException: VDSErrorException: Failed to CreateStorageDomainVDS, error = Storage domain remote path not mounted: ('/rhev/data-center/mnt/{data__domain__address[1]}:_pd02',)
2012-05-16 14:40:45,061 INFO  [org.ovirt.engine.core.vdsbroker.vdsbroker.BrokerCommandBase] (ajp--0.0.0.0-8009-10) [4aaaa7d6] Command org.ovirt.engine.core.vdsbroker.vdsbroker.CreateStorageDomainVDSCommand return value
 Class Name: org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc
mStatus                       Class Name: org.ovirt.engine.core.vdsbroker.vdsbroker.StatusForXmlRpc
mCode                         360
mMessage                      Storage domain remote path not mounted: ('/rhev/data-center/mnt/{data__domain__address[1]}:_pd02',)


2012-05-16 14:40:45,065 INFO  [org.ovirt.engine.core.vdsbroker.vdsbroker.BrokerCommandBase] (ajp--0.0.0.0-8009-10) [4aaaa7d6] Vds: 10.34.63.208
2012-05-16 14:40:45,067 ERROR [org.ovirt.engine.core.vdsbroker.VDSCommandBase] (ajp--0.0.0.0-8009-10) [4aaaa7d6] Command CreateStorageDomainVDS execution failed. Exception: VDSErrorException: VDSGenericException: VDSErrorException: Failed to CreateStorageDomainVDS, error = Storage domain remote path not mounted: ('/rhev/data-center/mnt/{data__domain__address[1]}:_pd02',)




- we also tried it in webadmin with dead IP (10.2.3.3) which resulted in 
Error: A Request to the Server failed with the following Status Code: 503

- we also tried it in webadmin with this NFS export: ddd:/kkk
Error while executing action New NFS Storage Domain: Storage domain remote path not mounted

Version-Release number of selected component (if applicable):
RHEVM si3, vdsm-4.9.6-9.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
Comment 2 Allon Mureinik 2013-03-12 12:24:46 EDT
Michael - is this a restapi infrastructure issue, or should it be handled per action?
Comment 3 Michael Pasternak 2013-03-13 06:02:08 EDT
(In reply to comment #2)
> Michael - is this a restapi infrastructure issue, or should it be handled
> per action?

from description, sounds like an core infra issue (if UI displaying BE error and api doesn't, it means that api not taking the error however afaiu was used three different scenarios 1 from api + 2 from UI, so you can't compare api vs. UI)
Comment 4 Allon Mureinik 2013-03-25 03:18:04 EDT
Retried it with an invalid mount path, got the following error:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<fault>
    <reason>Operation Failed</reason>
    <detail>[var  type  storage  domain, var  action  add, action type failed storage connection not exist]</detail>
</fault>


In the UI, I get the following error:
Error while executing action: Cannot add Storage. Storage connection doesn't exist.

Seems as though something is off with the error translation mechanism.
Comment 5 Allon Mureinik 2013-03-25 03:19:26 EDT
Vered - please take a look - did we see a similar issue somewhere?
Comment 6 Vered Volansky 2013-04-02 01:39:34 EDT
bz 883877 had the same issue as in comment #4 with the same UI output. The bug is solved, but the UI error message was not challenged there and remains the same.
Comment 7 Allon Mureinik 2013-04-08 10:03:44 EDT
This seems to be a deeper rooted rest-api issue.

I tried a complete different flow - creating a Data Center with a name that already exists.

In REST, I send a POST request to myserver:8700/api/datacenters with the following body:
<data_center>
 <name>sameName</name>
 <storage_type>nfs</storage_type>
 <storage_format>v3</storage_format>
 <version minor="2" major="3"/>
</data_center>

And get:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<fault>
    <reason>Operation Failed</reason>
    <detail>[var  action  create, var  type  storage  pool, action type failed storage pool name already exist]</detail>
</fault>

The exact same flow in the UI produces a human readable message, with var_action, etc. replaced properly.


Michael - I'm moving the bug to you for further analysis, feel free to return/reassign it if my analysis is off.
Comment 8 Michael Pasternak 2013-04-08 10:13:36 EDT
(In reply to comment #7)
> This seems to be a deeper rooted rest-api issue.
> 
> I tried a complete different flow - creating a Data Center with a name that
> already exists.
> 
> In REST, I send a POST request to myserver:8700/api/datacenters with the
> following body:
> <data_center>
>  <name>sameName</name>
>  <storage_type>nfs</storage_type>
>  <storage_format>v3</storage_format>
>  <version minor="2" major="3"/>
> </data_center>
> 
> And get:
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <fault>
>     <reason>Operation Failed</reason>
>     <detail>[var  action  create, var  type  storage  pool, action type
> failed storage pool name already exist]</detail>
> </fault>
> 
> The exact same flow in the UI produces a human readable message, with
> var_action, etc. replaced properly.
> 

this can happen if you have misplaced AppErrors file.
Comment 9 Vered Volansky 2013-04-08 11:08:00 EDT
After reading comment #7 I thought bz922554 might be related.
Comment 10 Itamar Heim 2013-12-01 04:12:19 EST
Closing old bugs. If this issue is still relevant/important in current version, please re-open the bug.

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