You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello there, I got the very same problem reported on issue #1 but here I'll try to explain how to reproduce the case.
On deployVirtualMachine command the API accepts an array for parameter iptonetworklist, which is formatted this way if you create a VM directly from CloudStack UI: &iptonetworklist[0].networkid=b6170452-820c-4a5b-bb76-6a22a0266c0d&iptonetworklist[0].ip=10.1.1.100&iptonetworklist[0].mac=DC-FE-49-00-66-0D. The key [0] on this array can be incremented when you associate more than one network to the new VM.
The point is that the method protected function buildQueryString(array $params) on PCextreme\Cloudstack\Client is not able to build the query string array like expected by CloudStack API on this command, giving Notice: Undefined index: key if we try to send the array data with something like this:
We get the query string as this: &iptonetworklist[0].key=mac&iptonetworklist[0].value=54-77-2F-BA-67-74&iptonetworklist[1].key=networkid&iptonetworklist[1].value=b6170452-820c-4a5b-bb76-6a22a0266c0d&iptonetworklist[2].key=ip&iptonetworklist[2].value=10.1.1.50
This way the method will not give the notice, but CloudStack API will treat each key on the array as a different entry in the map, returning this error:
ClientException {#3412#response: array:1 ["deployvirtualmachineresponse" => array:4 [
"uuidList" => []
"errorcode" => 431"cserrorcode" => 4350"errortext" => "Unable to translate and find entity with networkId: null"
]
]
#message: "Unable to translate and find entity with networkId: null"#code: 431#file: "/var/www/html/vendor/pcextreme/cloudstack/src/Client.php"#line: 405
I'm not sure if this is the only endpoint treating array on request this way, but the way buildQueryString() method parses input and build query string is not working for the command deployVirtualMachine.
If you could confirm if there are other commands receiving and parsing arrays for requests I could eventually send a PR to fix this, but I'm afraid we fix for this command and break for others.
Please let me know if I can help sending other evidences of the case.
For the reference, I'm using CloudStack 4.15.0.0 here.
The text was updated successfully, but these errors were encountered:
Hello there, I got the very same problem reported on issue #1 but here I'll try to explain how to reproduce the case.
On
deployVirtualMachine
command the API accepts an array for parameteriptonetworklist
, which is formatted this way if you create a VM directly from CloudStack UI:&iptonetworklist[0].networkid=b6170452-820c-4a5b-bb76-6a22a0266c0d&iptonetworklist[0].ip=10.1.1.100&iptonetworklist[0].mac=DC-FE-49-00-66-0D
. The key [0] on this array can be incremented when you associate more than one network to the new VM.The point is that the method
protected function buildQueryString(array $params)
onPCextreme\Cloudstack\Client
is not able to build the query string array like expected by CloudStack API on this command, givingNotice: Undefined index: key
if we try to send the array data with something like this:Otherwise, if we try to send the array as expected by the method, like the example bellow:
We get the query string as this:
&iptonetworklist[0].key=mac&iptonetworklist[0].value=54-77-2F-BA-67-74&iptonetworklist[1].key=networkid&iptonetworklist[1].value=b6170452-820c-4a5b-bb76-6a22a0266c0d&iptonetworklist[2].key=ip&iptonetworklist[2].value=10.1.1.50
This way the method will not give the notice, but CloudStack API will treat each key on the array as a different entry in the map, returning this error:
I'm not sure if this is the only endpoint treating array on request this way, but the way
buildQueryString()
method parses input and build query string is not working for the commanddeployVirtualMachine
.If you could confirm if there are other commands receiving and parsing arrays for requests I could eventually send a PR to fix this, but I'm afraid we fix for this command and break for others.
Please let me know if I can help sending other evidences of the case.
For the reference, I'm using CloudStack 4.15.0.0 here.
The text was updated successfully, but these errors were encountered: