On Wed, Jan 23, 2013 at 10:13 AM, Min Chen <min.c...@citrix.com> wrote: > Hi Rohit/Hugo, > > If I am not mistaken the issue, an easy fix for this is to change the > following parameter annotation
Yes you're right! I was lost in some other piece of code (apparently switching between branches messes your brain), this was just an incorrect annotation and not a problem in service layer or dao layer. Fixed in dba413a3d4b1ea8320821c8ab15f193f98f01304 on master. Regards. > > @Parameter(name=ApiConstants.SERVICE_OFFERING_ID, > type=CommandType.UUID, entityType=DiskOfferingResponse.class, > description="the service offering ID used by virtual router > provider") > private Long serviceOfferingId; > > > To > > @Parameter(name=ApiConstants.SERVICE_OFFERING_ID, > type=CommandType.UUID, entityType=ServiceOfferingResponse.class, > description="the service offering ID used by virtual router provider") > private Long serviceOfferingId; > > Since this parameter is actually referring to service offerings, not disk > offering. > > Thanks > -min > > > On 1/23/13 9:17 AM, "Rohit Yadav" <bhais...@apache.org> wrote: > >>Hi Hugo, >> >>I'll see this today. I'm not sure about the impact of fixing it in >>disk offering dao impl as well. >>Both disk and service offering dao and tables are tightly coupled. >>Must be something I missed. >>Will keep you posted. >> >>Regards. >> >>On Wed, Jan 23, 2013 at 6:28 AM, Hugo Trippaers >><htrippa...@schubergphilis.com> wrote: >>> Hey guys, >>> >>> I was working on some stuff when I needed to create a new network >>>service offering using the lastest build from master (and a clean >>>database). The call failed with the following message "Unable to execute >>>API command createnetworkoffering due to invalid value. Invalid >>>parameter value=29bf1bb4-9e0a-4908-9de9-0065ca6cc20c due to incorrect >>>long value, entity not found, or an annotation bug." I needed a systemvm >>>offering in the network offering from the list, the uuid mentioned in >>>the error is the uuid of the system offering. However the system >>>offering is in the database, it is one of the default system offerings. >>> >>> mysql> select id, unique_name,name from disk_offering where uuid = >>>'29bf1bb4-9e0a-4908-9de9-0065ca6cc20c'; >>> +----+--------------------------+-------------------------------------+ >>> | id | unique_name | name | >>> +----+--------------------------+-------------------------------------+ >>> | 9 | Cloud.Com-SoftwareRouter | System Offering For Software Router | >>> +----+--------------------------+-------------------------------------+ >>> >>> It took some digging, but I found the problem. The api framework issues >>>a findByUuid for any uuid's received with the command. So in this case >>>the api dispatcher issued the findByUuid call on the DiskOfferingDao. >>>This call is part of the GenericDaoBase (line 918) and eventually >>>becomes a call to searchIncludingRemoved with a single clause stating >>>the uuid must match. However this call is overridden in >>>DiskOfferingDaoImpl (line 85) and the new function adds a clause stating >>>that the type must be 'Disk'. The service offering we are looking for >>>has type 'Service' so the query yields no results and the call fails. >>> >>> The easy way out would be to remove the check for type equals Disk, >>>which fixes the obvious problem, but I have no idea what else this might >>>cause. Could someone with more clue than me have a look at this? >>> >>> >>> Below the lines from the log for those interested. >>> >>> Cheers, >>> >>> Hugo >>> >>> >>> 2013-01-23 14:52:16,367 DEBUG [cloud.api.ApiServlet] >>>(649447027@qtp-2088502955-10:null) ===START=== 127.0.0.1 -- GET >>>command=createNetworkOffering&response=json&sessionkey=43rxXRv2MDoaxA83zI >>>xgKwtNWCQ%3D&name=test&displayText=test&guestIpType=Isolated&useVpc=on&se >>>rviceOfferingId=29bf1bb4-9e0a-4908-9de9-0065ca6cc20c&servicecapabilitylis >>>t%5B0%5D.service=SourceNat&servicecapabilitylist%5B0%5D.capabilitytype=Su >>>pportedSourceNatTypes&servicecapabilitylist5B05D.capabilityvalue=peraccou >>>nt&servicecapabilitylist%5B1%5D.service=lb&servicecapabilitylist%5B1%5D.c >>>apabilitytype=SupportedLbIsolation&servicecapabilitylist%5B1%5D.capabilit >>>yvalue=dedicated&availability=Optional&state=Creating&status=Creating&all >>>ocationstate=Creating&supportedServices=Dhcp%2CDns%2CFirewall%2CLb%2CUser >>>Data%2CSourceNat%2CStaticNat%2CPortForwarding%2CConnectivity&specifyVlan= >>>false&specifyIpRanges=false&conservemode=false&serviceProviderList%5B0%5D >>>.service=Dhcp&serviceProviderList%5B0%5D.provider=VpcVirtualRouter&servic >>>eProviderList%5B1%5D.service=Dns&serviceProviderList%5B1%5D.provider=VpcV >>>irtualRouter&serviceProviderList%5B2%5D.service=Firewall&serviceProviderL >>>ist%5B2%5D.provider=VirtualRouter&serviceProviderList%5B3%5D.service=Lb&s >>>erviceProviderList%5B3%5D.provider=VpcVirtualRouter&serviceProviderList%5 >>>B4%5D.service=UserData&serviceProviderList%5B4%5D.provider=VpcVirtualRout >>>er&serviceProviderList%5B5%5D.service=SourceNat&serviceProviderList%5B5%5 >>>D.provider=VpcVirtualRouter&serviceProviderList%5B6%5D.service=StaticNat& >>>serviceProviderList%5B6%5D.provider=VpcVirtualRouter&serviceProviderList% >>>5B7%5D.service=PortForwarding&serviceProviderList%5B7%5D.provider=VpcVirt >>>ualRouter&serviceProviderList%5B8%5D.service=Connectivity&serviceProvider >>>List%5B8%5D.provider=NiciraNvp&traffictype=GUEST&_=1358949136255 >>> 2013-01-23 14:56:45,974 DEBUG [cloud.api.ApiDispatcher] >>>(649447027@qtp-2088502955-10:null) Object entity with >>>uuid=29bf1bb4-9e0a-4908-9de9-0065ca6cc20c does not exist in the database. >>> 2013-01-23 14:56:45,975 INFO [cloud.api.ApiServer] >>>(649447027@qtp-2088502955-10:null) Unable to execute API command >>>createnetworkoffering due to invalid value. Invalid parameter >>>value=29bf1bb4-9e0a-4908-9de9-0065ca6cc20c due to incorrect long value, >>>entity not found, or an annotation bug. >