VMware Cloud Community
Andrew46
Contributor
Contributor

SQL error in vCloud data collector log

Hi I have a support request open for this issue but I am not getting anywhere quickly so I thought I would ask the question here. I am getting the following error message in the vcloud data collector error log. "Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The INSERT statement conflicted with the FOREIGN KEY constraint "FK_CB_VSM_NETWORK_VC_ID". The conflict occurred in database "VCChargebackVCC02", table "dbo.CB_VSM_SERVER", column 'VC_ID'. "

The system is set up as follows

vCenter chargeback 2.0.2

x64 Windows 2003 server R2

SQL 2008 R2

The database was set up from the wizard. I am using SQL authentication and the user is a dbo.

0 Kudos
6 Replies
IamTHEvilONE
Immortal
Immortal

When exactly does this error occur?

It sounds like there are two vShield Managers to a vCenter OR one vShield Manager that is associated to 2 vShield Managers.  CB_VSM_SERVER table is just to have an association of which vShield Manager is paired to a vCenter.  This should be a 1:1 ratio.

If you have uploaded logs to the support request, private message me the ID number and I'll take a look at it.

Best Regards,

Jon Hemming

0 Kudos
Zimeon
Contributor
Contributor

I actually have the same problem using Chargeback 2.5 after a clean install with a new DB. Chargeback vCloud-DC_Errors.log file contains several occurances of:


"

2012-09-21T09:28:20.378+0300 ERROR [eventProcessorTimer] [util.JDBCExceptionReporter] 0533: The INSERT statement conflicted with the FOREIGN KEY constraint "FK_CB_VSM_NETWORK_VC_ID". The conflict occurred in database "cbm", table "dbo.CB_VSM_SERVER", column 'VC_ID'.

"

CB status shows all green and data collectors run normally. vCloud is still version 1.5 ja vCenter servers are 5.0 (to be upgraded later on). I tried to upgrade CB from 2.0 to 2.5 but that failed so i created a new VM and a new DB with a new DB user. Organizations show up in the CB hiearchy like they should, the medias and templates are also good as are the vapp:s. What is missing are the virtual machines from each vAPP. The Insert statement mentions VSM Network VC ID, but the networks in the organization shows up and IP's as well, havn't checked if they are all there though.

There are also errors in vCenterDC_Errors.log:

2012-09-21T08:45:04.051+0300 ERROR [(5) NetworkInventorySyncJob on VC 3153] [impl.InventoryConstructionAgentImpl] 5750: Invalid Property Path host. 
<Response>
  <Error majorErrorCode="500" minorErrorCode="0" message="Invalid Property Path host." />
</Response>
at com.vmware.vim.vcenter.datacollector.inv.manager.impl.PropertyManagerImpl.getPropertyByPath(PropertyManagerImpl.java:248)
at com.vmware.vim.vcenter.datacollector.inv.manager.impl.ObjectHandlerImpl.processModifyUpdate(ObjectHandlerImpl.java:164)
at com.vmware.vim.vcenter.datacollector.inv.manager.impl.InventoryUpdateManagerImpl.processUpdates(InventoryUpdateManagerImpl.java:54)
at com.vmware.vim.vcenter.datacollector.inv.manager.impl.InventoryConstructionAgentImpl$FilterChangeListenerImpl.updateForView(InventoryConstructionAgentImpl.java:659)
at com.vmware.vim.vcenter.datacollector.inv.manager.impl.InventoryConstructionAgentImpl$FilterChangeListenerImpl.onUpdate(InventoryConstructionAgentImpl.java:644)
at com.vmware.vim.vcenter.datacollector.inv.manager.impl.Inventory$1.onUpdate(Inventory.java:153)
at com.vmware.sdk.toolkit.view.FilterSpecViewImpl.onUpdate(FilterSpecViewImpl.java:85)
at com.vmware.sdk.toolkit.view.ViewBaseImpl$2$1.run(ViewBaseImpl.java:182)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Any thoughts?

0 Kudos
pmasrani
Enthusiast
Enthusiast

Hi all,

We have mainly encountered this issue when VCD installations are more than a year old.

CBM syncs VCD inventory history using VCD events and in VCD, events are retained for a maximum period of 365 days by default.

CBM needs to be installed before one year of VCD (For VCD 1.5.1 or lower) installation for correct functioning, or at least KB http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=200753... needs to be followed, to change the default retention period of events in VCD to 3 years.

Unfortunately, if the issue is already hit with VCD 1.5.1 or lower, not much corrective action can be taken. The best solution is to upgrade VCD to 5.1 and install fresh CBM 2.5, which will sync the current VCD 5.1 inventory from VCD and hence, will not rely on more than 365 days old events. Chargign will be correct from the point of installation of CBM.

Hope that helps.

Thanks,

Piyush

0 Kudos
Zimeon
Contributor
Contributor

Thank you for the reply, but i'm quite sure this isn't the issume that i'm facing. Checked the vCloud installation and it dates back to november 2011, so less than a year ago. Also checked the vCloud database and the ChargebackEventsKeepDays is 365, which is more than what has passed since the installation. It could well be that the CB 2.5 starts working (or requires another re-install) with vCloud 5.1. But obviously, it would be nice to get this one working as well Smiley Happy

0 Kudos
pmasrani
Enthusiast
Enthusiast

Hi,

If your VCD installation is from Nov 2011, then definitely your case is different. Please log a service request for the same and we can follow-up there.

Thanks,

Piyush

0 Kudos
Zimeon
Contributor
Contributor

This issue got fixed with us when we upgrade our vCloud to 5.1. There seems to be an issue regarding the changes done to the networks in 5.1, atleast thats how it seems when you look at the sql error and what has changed regarding networks and how they are grouped/managed in 5.1. Doesnt looklike 2.5 CB is compatible with vCloud 1.5.

0 Kudos