Description of problem: Getting this error in many CLI requests, for example: 1) add network --cluster-identifier 'f55fee84-dd0f-4bc2-b6c8-c0a87f1a8b02' --usages-usage 'vm' --data_center-id '02258528-324e-4292-8919-b8c15a40b902' --id '63042a67-2b7c-4e7e-b967-65b55b8e4580' --name 'testrest1' --mtu 0 --stp false 2) action vm '123d1a10-7a94-4e99-9217-7fdc09f95c82' import_vm --storagedomain-identifier '8804221a-51fc-455a-ba83-ae58dfba2bcb' --cluster-name 'RestCluster1' Version-Release number of selected component (if applicable): SF15 How reproducible: 100% Steps to Reproduce: 1. see above 2. 3. Actual results: Expected results: Additional info:(rnori) from stack trace looks like VdcReturnValueBase.getActionReturnValue is null. Resulting in NPE on API VdcReturnValueBase.setActionReturnValue is not being called for AttachNetworkToVdsGroupCommand in the engine code.
Barak, please always attach logs (cli+engine) when reporting such bugs.
The above bug description contains 2 different issues: 1 - AttachNetworkToVdsGroupCommand - command does not return a value which causes the exception. 2 - ImportVmCommand - has NPE when the cli does not specify the target SD. Hence dividing this bug into 2 separate bugs. This Bug will remain at network.
The root cause is invalid network name. When an invalid network name is provided to the add command the server throws an internal error rather than sending a bad request response with the appropriate error message. add network --cluster-identifier '99408929-82cf-4dc7-a532-9d998063fa95' --usages-usage 'vm' --data_center-id '5849b030-626e-47cb-ad90-3ce782d831b3' --name 'invalidname' --mtu 0 --stp false --id '00000000-0000-0000-0000-000000000009'
The implemented behaviour is as follow: If only the network id or only the network name are provided (but not both) and the network doesn't exists - error 404 (object not found) is returned. If both network's id and name are provided, but there is no match between the name to the id, error 400 (bad request) is returned.
Verified on SF17 backend version: 3.2 sdk version : 3.2.0.11 cli version : 3.2.0.9 python version : 2.6.6.final.0 [RHEVM shell (connected)]# add network --data_center-id '4ff89715-2ced-4982-814a-39704e79063c' --name 'test22' id : 878cb294-efca-4ec4-b872-58eeb2b8685c name : test22 data_center-id: 4ff89715-2ced-4982-814a-39704e79063c mtu : 0 stp : False usages-usage : vm [RHEVM shell (connected)]# add network --cluster-identifier 'f55fee84-dd0f-4bc2-b6c8-c0a87f1a8b02' --name 'test22' --foo-bar error: "foo" is invalid argument segment.
3.2 has been released