Hi Antonio,

Sorry for the late reply. “ctxdetails” is used in ApiServer, so its not an 
unknown parameter. So the warning is not legitimate. Can you please fix it?

Thanks,
Alena.

From: Antonio Fornié Casarrubios 
<antonio.for...@gmail.com<mailto:antonio.for...@gmail.com>>
Date: Tuesday, May 13, 2014 at 2:34 PM
To: Alena Prokharchyk 
<alena.prokharc...@citrix.com<mailto:alena.prokharc...@citrix.com>>
Cc: "dev@cloudstack.apache.org<mailto:dev@cloudstack.apache.org>" 
<dev@cloudstack.apache.org<mailto:dev@cloudstack.apache.org>>
Subject: Re: seeing "Unknown parameters : ctxdetails" for 
addResourceDetail/removeResourceDetail

Hi all and sorry for the delay in the reply. Let me try to answer to different 
subjects mentioned here.

What is this functionality? It's just a server side check for the format of the 
requests, specifically for the received parameters. That's not something 
strange, there are many communication protocols that include (or can include) 
server side validation (for example, based on a xsd, dtd...). In those cases 
that would make the request completely fail. In our case, we just log it as 
warning.

My understanding is that an ideal solution is not to change this check, but to 
change the format of the requests so that it doesn't include parameters that 
will not be used. Actually, from the client point of view, if you send a 
parameter and you don't get any error or warning, that means that the parameter 
is used, right? But there are cases (like a parameter that was called 
listAll??) in which you could wonder why changing the value for that parameter 
doesn't affect the result, and you don't know that the parameter doesn't even 
exist on the server functionality.



When should a parameter be considered unknown? Any parameter that is not used - 
There are parameters that are not command specific, they are used in ApiServer, 
ApiServlet or any other"Api related class" and thus cannot be considered 
unknown : they are needed. There are also parameters that are part of the given 
command in a certain request. If you go to the code of this command you will 
see them. For example, for UpdateNetworkServiceProviderCmd, there are several 
private fields annotated as parameters not only in this class itself, but also 
the parameters inherited from BaseAsyncCmd and BaseCmd. These are also needed. 
Any other command will not be used in the server, is not expected, and thus it 
should be considered unknown. Usually these are parameters that are correct for 
a given command, but for some reason they are also sent for other commands 
(like was the case of listAll). In these cases it makes sense to change the 
client in order not to send it, right?



So is this parameter (ie: ctxdetails) used? I don't know all the parameters 
used by heart, but I can tell that ctxdetails is not part of 
UpdateNetworkServiceProviderCmd parameters. What I dont know: is ctxdetails 
used in ApiServer, ApiServlet... or any other class upon reception? If it is 
used, then the parameter should not be considered unknown and the warning is a 
false positive. If it is not, then the warning is legitimate.

If the parameter is correct (and thus the warning is a false positive), then 
obviously it should be added to the list of default parameters in the 
ParamGenericValidationWorker so that it doesn't log more false warnings. And 
the same goes for any other valid parameter added in the future. Btw, I would 
strongly recommend to use public constants so that we make sure there is not 
difference between the parameter name in the list and the parameter actually 
used.



Should we keep this functionality or get rid of it? IMHO not having server side 
validation or at least something similar, is not good. But I also understand 
other voices, and I can see that requests that are constructed with unknown 
parameters are going to stay like they are, because people usually work on more 
urgent things. Actually we now have both problems, bad requests and noisy 
warnings, but the warning annoys more. It all started with a reported issue 
about not informaing the client about unused parameters. I didn't create this 
issue, I just fixed it.

Btw, I think the ParamGenericValidationWorker is a very simple code and is not 
buggy. You can also check ParamGenericValidationWorkerTest to see what it does 
and how it is tested. If it is buggy, then let me know and I will fix it. But 
if it's just a matter of getting out of date because new generic parameters are 
added to the code, then anybody should add these parameters. Otherwise any time 
someone adds a new parameter to the code, it will be considered that I need to 
fix the worker, which could happen plenty of times in the future :-)


Please let me know your thoughts and preferences. Thanks. Cheers
antonio





2014-05-13 19:29 GMT+02:00 Alena Prokharchyk 
<alena.prokharc...@citrix.com<mailto:alena.prokharc...@citrix.com>>:
My calls were also executed via 8096 port. We have to eliminate this noise
in the logs before shipping 4.4

On 5/13/14, 10:16 AM, "Amogh Vasekar" 
<amogh.vase...@citrix.com<mailto:amogh.vase...@citrix.com>> wrote:

>Same here. I see it nearly all API calls I make. I use port 8096 though,
>if that makes any difference.
>
>Thanks,
>Amogh
>
>On 5/13/14 3:01 AM, "Koushik Das" 
><koushik....@citrix.com<mailto:koushik....@citrix.com>> wrote:
>
>>I am seeing the same for many commands. So this is not specific to
>>add/removeResourceDetail
>>
>>2014-05-09 18:17:39,477 WARN  [c.c.a.d.ParamGenericValidationWorker]
>>(API-Job-Executor-24:job-28 ctx-6eaab5d7) Received unknown parameters for
>>command updateNetworkServiceProvider. Unknown parameters : ctxdetails
>>2014-05-09 18:17:42,584 WARN  [c.c.a.d.ParamGenericValidationWorker]
>>(API-Job-Executor-25:job-29 ctx-9c9f87f4) Received unknown parameters for
>>command updatePhysicalNetwork. Unknown parameters : ctxdetails
>>2014-05-12 11:13:29,079 WARN  [c.c.a.d.ParamGenericValidationWorker]
>>(API-Job-Executor-1:job-3 ctx-146e0b74) Received unknown parameters for
>>command createPhysicalNetwork. Unknown parameters : ctxdetails
>>2014-05-12 11:13:29,188 WARN  [c.c.a.d.ParamGenericValidationWorker]
>>(API-Job-Executor-2:job-4 ctx-923175d9) Received unknown parameters for
>>command addTrafficType. Unknown parameters : ctxdetails
>>2014-05-12 11:13:44,521 WARN  [c.c.a.d.ParamGenericValidationWorker]
>>(API-Job-Executor-5:job-7 ctx-255c7f04) Received unknown parameters for
>>command configureVirtualRouterElement. Unknown parameters : ctxdetails
>>2014-05-12 11:13:44,576 WARN  [c.c.a.d.ParamGenericValidationWorker]
>>(API-Job-Executor-6:job-8 ctx-5bbd3334) Received unknown parameters for
>>command updateNetworkServiceProvider. Unknown parameters : ctxdetails
>>2014-05-12 11:13:49,705 WARN  [c.c.a.d.ParamGenericValidationWorker]
>>(API-Job-Executor-7:job-9 ctx-382414ba) Received unknown parameters for
>>command configureVirtualRouterElement. Unknown parameters : ctxdetails
>>2014-05-12 11:13:49,746 WARN  [c.c.a.d.ParamGenericValidationWorker]
>>(API-Job-Executor-8:job-10 ctx-e806b020) Received unknown parameters for
>>command updateNetworkServiceProvider. Unknown parameters : ctxdetails
>>2014-05-12 11:13:54,873 WARN  [c.c.a.d.ParamGenericValidationWorker]
>>(API-Job-Executor-9:job-11 ctx-6f762490) Received unknown parameters for
>>command configureInternalLoadBalancerElement. Unknown parameters :
>>ctxdetails
>>2014-05-12 11:13:54,917 WARN  [c.c.a.d.ParamGenericValidationWorker]
>>(API-Job-Executor-10:job-12 ctx-a9a7f4dd) Received unknown parameters for
>>command updateNetworkServiceProvider. Unknown parameters : ctxdetails
>>2014-05-12 11:14:00,003 WARN  [c.c.a.d.ParamGenericValidationWorker]
>>(API-Job-Executor-11:job-13 ctx-434a524d) Received unknown parameters for
>>command updatePhysicalNetwork. Unknown parameters : ctxdetails
>>2014-05-12 17:50:42,708 WARN  [c.c.a.d.ParamGenericValidationWorker]
>>(API-Job-Executor-1:job-21 ctx-706223d8) Received unknown parameters for
>>command deployVirtualMachine. Unknown parameters : ctxdetails
>>2014-05-13 14:19:43,496 WARN  [c.c.a.d.ParamGenericValidationWorker]
>>(API-Job-Executor-4:job-31 ctx-aff14d23) Received unknown parameters for
>>command deployVirtualMachine. Unknown parameters : ctxdetails
>>2014-05-13 14:48:59,308 WARN  [c.c.a.d.ParamGenericValidationWorker]
>>(API-Job-Executor-1:job-53 ctx-9cc47c4f) Received unknown parameters for
>>command startVirtualMachine. Unknown parameters : ctxdetails
>>2014-05-13 14:50:18,255 WARN  [c.c.a.d.ParamGenericValidationWorker]
>>(API-Job-Executor-5:job-61 ctx-5ceecd58) Received unknown parameters for
>>command startVirtualMachine. Unknown parameters : ctxdetails
>>
>>
>>
>>
>>
>>On 13-May-2014, at 4:09 AM, Alena Prokharchyk
>><alena.prokharc...@citrix.com<mailto:alena.prokharc...@citrix.com>> wrote:
>>
>>> Hi Antonio,
>>>
>>> I see following errors in the 4.4 logs:
>>>
>>> WARN  [c.c.a.d.ParamGenericValidationWorker]
>>>(API-Job-Executor-49:job-2867 ctx-072e9ae9) Received unknown parameters
>>>for command removeResourceDetail. Unknown parameters : ctxdetails
>>> WARN  [c.c.a.d.ParamGenericValidationWorker]
>>>(API-Job-Executor-50:job-2868 ctx-35195840) Received unknown parameters
>>>for command addResourceDetail. Unknown parameters : ctxdetails
>>>
>>> Isn¹t something that you¹ve fixed already? If so, what branches did it
>>>go to? If not, can you please fix it?
>>>
>>> Thanks!
>>> Alena.
>>
>


Reply via email to