Coveo for Sitecore 5 is now available!

Cannot insert the value NULL into column ID, table YourSitecoreSite_Core.dbo.Properties column does not allow nulls. INSERT fails.

Description

When calling http://<yoursitecoresite>/coveo/rest, you get this error :

Cannot insert the value NULL into column 'ID', table 'YourSitecoreSite\_Core.dbo.Properties'; column does not allow nulls. INSERT fails.

You also get the same result if you open the database [YourSitecoreSite]_Core in SQL Studio and perform this query :

INSERT INTO [dbo].[properties] ([dbo].[key], [dbo].[value]) VALUES ('TestKey', 'Test Value')

Explanation

There’s a constraint missing in the dbo.Properties table of [YourSitecoreSite]_Core database.

Environment

  • Coveo for Sitecore 1000+
  • Error Messages
  • REST API

Resolution

You need to recreate the constraints in your Sitecore database. The simplest way is to run the following query in your [YourSitecoreSite]_Core database:

USE [YourSitecoreSite_CoreSitecore_Core]
GO
ALTER TABLE [dbo].[Properties] ADD CONSTRAINT [DF_Properties_ID] DEFAULT (newid()) FOR [ID]
GO