THIS IS ARCHIVED DOCUMENTATION

Cannot insert the value NULL into column ID, table _Core.dbo.Properties column doesn't allow nulls. INSERT fails.

Description

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

Cannot insert the value NULL into column 'ID', table '<INSTANCE_HOSTNAME>_Core.dbo.Properties'; column doesn't allow nulls. INSERT fails.

You also get the same result if you open the database <INSTANCE_HOSTNAME>_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 the <INSTANCE_HOSTNAME>_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 <INSTANCE_HOSTNAME>_Core database:

USE [<INSTANCE_HOSTNAME>_CoreSitecore_Core]

GO

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

GO