| Summary: | Error message is printed to engine.log with parameter names instead of parameter values | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Retired] oVirt | Reporter: | Rami Vaknin <rvaknin> | ||||
| Component: | ovirt-engine-core | Assignee: | lpeer <lpeer> | ||||
| Status: | CLOSED WONTFIX | QA Contact: | |||||
| Severity: | low | Docs Contact: | |||||
| Priority: | unspecified | ||||||
| Version: | unspecified | CC: | acathrow, bazulay, ecohen, iheim, mgoldboi, mpastern, yeylon, ykaul | ||||
| Target Milestone: | --- | ||||||
| Target Release: | --- | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | infra | ||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2012-12-13 08:12:24 UTC | Type: | --- | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Attachments: |
|
||||||
|
Description
Rami Vaknin
2011-12-27 22:52:03 UTC
(In reply to comment #0) > ... > Note that the Action and Type values are printed well in the rest-api response. > ... This is strange, since according to the engine.log, the "Reasons" contain only the "VDS_STATUS_NOT_VALID_FOR_UPDATE" message, without the action/type messages. Also, a similar problem has been encountered in the web-admin during configure-local-storage procedure (an error-message has popped-up with the message: "Cannot ${action} ${type}. Host parameters cannot be modified while Host is operational. Please switch Host to Maintenance mode first.") According to the above, it seems that the backend doesn't return the Action + Type parameters' values along with the error message at all, so I fail to understand how the rest-api is showing these values correctly. Can you please paste here the rest-api's response to the request that you have documented in the BZ description? I did the same query again on devel env with last commit's hash: d933f3cd24fb971cb20bef59f73f6bf1172b34e6 - first time with ovirt-engine-sdk and second time with REST-API request.
This time, in REST-API I got literals ${action} and ${type} both in the response and to engine.log.
In ovirt-engine-sdk I got the variables' values both in the response and in engine.log.
ovrit-engine-sdk:
-----------------
vm = api.hosts.get('name_of_host')
vm.address='1.1.1.1'
vm.update()
Traceback (most recent call last):
File "/home/rvaknin/sdk/src/tests2.py", line 19, in <module>
vm.update()
File "/usr/lib/python2.6/site-packages/ovirtsdk/infrastructure/brokers.py", line 1398, in update
body=ParseHelper.toXml(self.superclass))
File "/usr/lib/python2.6/site-packages/ovirtsdk/infrastructure/proxy.py", line 39, in update
return self.request('PUT', url, body, headers)
File "/usr/lib/python2.6/site-packages/ovirtsdk/infrastructure/proxy.py", line 52, in request
conn=self.getConnectionsPool().getConnection())
File "/usr/lib/python2.6/site-packages/ovirtsdk/infrastructure/proxy.py", line 62, in __doRequest
raise RequestError, response
ovirtsdk.infrastructure.errors.RequestError:
status: 400
reason: Bad Request
detail: [Cannot edit Host. Host parameters cannot be modified while Host is operational.
Please switch Host to Maintenance mode first.]
2012-03-04 12:23:32,027 ERROR [org.ovirt.engine.core.utils.ObjectIdentityChecker] (http--0.0.0.0-8080-8) [3b3a7065] Field host_name can not be updated when status is Up
2012-03-04 12:23:32,027 WARN [org.ovirt.engine.core.utils.ObjectIdentityChecker] (http--0.0.0.0-8080-8) [3b3a7065] ObjectIdentityChecker.IsUpdateValid:: Not updatable field 'host_name' was updated
2012-03-04 12:23:32,028 WARN [org.ovirt.engine.core.bll.UpdateVdsCommand] (http--0.0.0.0-8080-8) [3b3a7065] CanDoAction of action UpdateVds failed. Reasons:VDS_STATUS_NOT_VALID_FOR_UPDATE,VAR__ACTION__UPDATE,VAR__TYPE__HOST
2012-03-04 12:23:32,028 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (http--0.0.0.0-8080-8) Operation Failed: [Cannot edit Host. Host parameters cannot be modified while Host is operational.
Please switch Host to Maintenance mode first.]
REST-API:
---------
http://rami-upstream-jboss7.qa.lab.tlv.redhat.com:8080/api/hosts/b5451c38-62ac-11e1-95af-cb24f78bf058
<host id='b5451c38-62ac-11e1-95af-cb24f78bf058'
href='/api/hosts/b5451c38-62ac-11e1-95af-cb24f78bf058'><name>intg-vdsb.qa.lab.tlv.redhat.com</name><actions><link
rel='activate'
href='/api/hosts/b5451c38-62ac-11e1-95af-cb24f78bf058/activate'/><link
rel='iscsilogin'
href='/api/hosts/b5451c38-62ac-11e1-95af-cb24f78bf058/iscsilogin'/><link
rel='fence' href='/api/hosts/b5451c38-62ac-11e1-95af-cb24f78bf058/fence'/><link
rel='deactivate'
href='/api/hosts/b5451c38-62ac-11e1-95af-cb24f78bf058/deactivate'/><link
rel='commitnetconfig'
href='/api/hosts/b5451c38-62ac-11e1-95af-cb24f78bf058/commitnetconfig'/><link
rel='install'
href='/api/hosts/b5451c38-62ac-11e1-95af-cb24f78bf058/install'/><link
rel='approve'
href='/api/hosts/b5451c38-62ac-11e1-95af-cb24f78bf058/approve'/><link
rel='iscsidiscover'
href='/api/hosts/b5451c38-62ac-11e1-95af-cb24f78bf058/iscsidiscover'/></actions><link
rel='nics' href='/api/hosts/b5451c38-62ac-11e1-95af-cb24f78bf058/nics'/><link
rel='permissions'
href='/api/hosts/b5451c38-62ac-11e1-95af-cb24f78bf058/permissions'/><link
rel='storage'
href='/api/hosts/b5451c38-62ac-11e1-95af-cb24f78bf058/storage'/><link
rel='statistics'
href='/api/hosts/b5451c38-62ac-11e1-95af-cb24f78bf058/statistics'/><link
rel='tags'
href='/api/hosts/b5451c38-62ac-11e1-95af-cb24f78bf058/tags'/><address>10.1.1.1</address><status><state>up</state></status><cluster
id='ab8b835a-3082-11e1-91cc-7f4f89555ebe'
href='/api/clusters/aa2fc21c-62ac-11e1-b777-8b6fbce883d4'><id>aa2fc21c-62ac-11e1-b777-8b6fbce883d4</id></cluster><power_management
type='rsa'><enabled>false</enabled><address>10.35.35.35</address><username>user</username><options></options></power_management><storage_manager>false</storage_manager><iscsi><initiator>iqn.1994-05.com.redhat:f59061d31269</initiator></iscsi></host>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<fault>
<reason>Operation Failed</reason>
<detail>[Cannot ${action} ${type}. Host parameters cannot be modified while Host is operational.
Please switch Host to Maintenance mode first.]</detail>
</fault>
2012-03-04 12:38:57,419 ERROR [org.ovirt.engine.core.utils.ObjectIdentityChecker] (http--0.0.0.0-8080-2) [11115173] Field vds_group_id can not be updated when status is Up
2012-03-04 12:38:57,422 WARN [org.ovirt.engine.core.bll.ChangeVDSClusterCommand] (http--0.0.0.0-8080-2) [11115173] CanDoAction of action ChangeVDSCluster failed. Reasons:VDS_STATUS_NOT_VALID_FOR_UPDATE
2012-03-04 12:38:57,424 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (http--0.0.0.0-8080-2) Operation Failed: [Cannot ${action} ${type}. Host parameters cannot be modified while Host is operational.
Please switch Host to Maintenance mode first.]
OK, now it is clearer: When updating a Host, we are actually calling to 2 backend commands: UpdateVds and ChangeVDSCluster. According to the engine.log files, it seems that the error message is sent appropriately (i.e. we get all 3 message components) for failure in UpdateVds, but the error message is not sent appropriately (i.e. we get only 1 out of 3 message components) for failure in ChangeVDSCluster. [question is, why the general behaviour is different if calling from REST API vs. calling from the sdk] Closing old bugs. If this issue is still relevant/important in current version, please re-open the bug. |