Commercebuddy gives Warning Key violation or data integrity error.

This applies to CartIt Unix 4.0 with CommerceBuddy 1.0 ONLY


I get "Warning Key violation or data integrity error" when I try to check my orders



In CartIt 4.0, a data integrity error means the data on the server does not match that which is expected by CommerceBuddy. CommerceBuddy records the next invoice and account numbers. If they do not match, CommerceBuddy locks the cart to prevent further corruption. Usually this means that the files on the server have been tampered with or are not the most current.

The Most common causes are:

  1. The server operator or web site administrator restored an old backup of the data files.
  2. The web site was moved to a different server and the site was not locked in the interim. This has the same effect as an old backup because the files are not the most current.
  3. Other malfunctions on the server (such as a full disk drive, lack of inodes, or inability to write to the count file )




The easiest method to repair this is to look in CommerceBuddy and see the "To-do" list. It will read something like: "Contact your CartIt Commerce Developer and tell them that you have a Data Integrity Error. CartIt reported the next invoice number set to be 1132 The next invoice number should have been 23510"

This means the invoices.count file in your cartit data directory contains the number 1132 when it should have been 23510. If invoices.count is corrupted most likely we will find the accounts.count, neworders.dat, and neworders.txt corrupted as well.

You will need to make make a backup of the neworders.txt and neworders.dat (rename the files with .old on the end) Then create a new neworders.txt and neworders.dat that is blank. change the permissions (chmod) on these files to 777.

Edit the invoices.count file to contain the next invoice number as reported by commercebuddy.

Look in the orders view on CommerceBuddy and note the highest account number. You may need to edit the account number contained in accounts.count file to reflect that highest number.

Once you have done this, connect again with CommerceBuddy and "Get orders". If all is ok the cart will be unlocked and running again. Otherwise look in the To-do list for errors.

After this is done, you should try to determine why this happened. Did you edit the files on the server? Did your host replace them with a backup? Did the server have a problem of some sort? Did you lock the site before changing Web hosting providers? You should use a dedicated server or Virtual Dedicated Server for hosting your site- shared hosting still works- but you should give your business a better chance of success than using a cheap $5/month hosting account.