Custom Form creation fails on Orchard 1.4.2

Topics: Troubleshooting
Sep 28, 2012 at 5:27 PM
Edited Sep 28, 2012 at 5:28 PM

Hi, this is an issue with custom forms module on 1.4.2 but I'm not getting any response on it over there and I was wondering if, given its somehow related to the 'dbo.orchard_Common_CommonPartRecord' table, that someone could at least offer advice on troubleshooting this:

I followed the directions here carefully and all goes fine, but when I save or publish a custom form I get a page not found at the designated URL and the below error shows in the logs:

2012-09-27 12:27:56,077 [41] NHibernate.Util.ADOExceptionReporter - Violation of PRIMARY KEY constraint 'PK__orchard___3214EC0744FF419A'. Cannot insert duplicate key in object 'dbo.orchard_Common_CommonPartRecord'. The duplicate key value is (255).
The statement has been terminated.
2012-09-27 12:27:56,077 [41] Orchard.ContentManagement.DefaultContentManager - GenericADOException thrown from IContentHandler by Orchard.Indexing.Handlers.CreateIndexingTaskHandler
NHibernate.Exceptions.GenericADOException: could not insert: [Orchard.Core.Common.Models.CommonPartRecord#255][SQL: INSERT INTO orchard_Common_CommonPartRecord (OwnerId, CreatedUtc, PublishedUtc, ModifiedUtc, Container_id, Id) VALUES (?, ?, ?, ?, ?, ?)] ---> System.Data.SqlClient.SqlException: Violation of PRIMARY KEY constraint 'PK__orchard___3214EC0744FF419A'. Cannot insert duplicate key in object 'dbo.orchard_Common_CommonPartRecord'. The duplicate key value is (255).
The statement has been terminated.

When I look in the dbo.orchard_Common_CommonPartRecord table, there is no record with PK value of 255. The PK isn't an Identity column, but when I create a test page the PK value follows the failed form attempts indicated record id numbers, like they're actually there (ie: if I create a test page now, it will be numbered 256, though no 255 exists). Strange. Any ideas?

 

Thanks in advance for any help/tips!

Oct 2, 2012 at 6:49 PM

No takers? :/

Coordinator
Oct 3, 2012 at 12:54 AM
Edited Oct 3, 2012 at 12:55 AM

But it should be an identity column. Is this on a vanilla Orchard install? Does it repro with 1.5.1?

Oct 3, 2012 at 5:38 PM

It's a 1.4.2 source code instance. No indication of the PrimaryKey being an Identity in SMS or in the table script if I generate from the DB. In any case, though, that may be a problem, but I'm not sure it's the problem, in that I can create pages without issue, for instance. I suspect this is some issue with custom forms module itself that was never rectified with subsequent versions of orchard; may be an orphaned project(?).  I've got a test instance of 1.5.1 source that I can try adding it to and see how that goes. I'll update as to status ASAP.

 

Thanks!

Coordinator
Oct 3, 2012 at 5:41 PM

Thanks.