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=43rxXRv2MDoaxA83zIxgKwtNWCQ%3D&name=test&displayText=test&guestIpType=Isolated&useVpc=on&serviceOfferingId=29bf1bb4-9e0a-4908-9de9-0065ca6cc20c&servicecapabilitylist%5B0%5D.service=SourceNat&servicecapabilitylist%5B0%5D.capabilitytype=SupportedSourceNatTypes&servicecapabilitylist5B05D.capabilityvalue=peraccount&servicecapabilitylist%5B1%5D.service=lb&servicecapabilitylist%5B1%5D.capabilitytype=SupportedLbIsolation&servicecapabilitylist%5B1%5D.capabilityvalue=dedicated&availability=Optional&state=Creating&status=Creating&allocationstate=Creating&supportedServices=Dhcp%2CDns%2CFirewall%2CLb%2CUserData%2CSourceNat%2CStaticNat%2CPortForwarding%2CConnectivity&specifyVlan=false&specifyIpRanges=false&conservemode=false&serviceProviderList%5B0%5D.service=Dhcp&serviceProviderList%5B0%5D.provider=VpcVirtualRouter&serviceProviderList%5B1%5D.service=Dns&serviceProviderList%5B1%5D.provider=VpcVirtualRouter&serviceProviderList%5B2%5D.service=Firewall&serviceProviderList%5B2%5D.provider=VirtualRouter&serviceProviderList%5B3%5D.service=Lb&serviceProviderList%5B3%5D.provider=VpcVirtualRouter&serviceProviderList%5B4%5D.service=UserData&serviceProviderList%5B4%5D.provider=VpcVirtualRouter&serviceProviderList%5B5%5D.service=SourceNat&serviceProviderList%5B5%5D.provider=VpcVirtualRouter&serviceProviderList%5B6%5D.service=StaticNat&serviceProviderList%5B6%5D.provider=VpcVirtualRouter&serviceProviderList%5B7%5D.service=PortForwarding&serviceProviderList%5B7%5D.provider=VpcVirtualRouter&serviceProviderList%5B8%5D.service=Connectivity&serviceProviderList%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.

Reply via email to