Products: Nintex Workflow 2013, Nintex Workflow 2010, Nintex Workflow 2007
Summary
The error "Unexpected System.InvalidCastException: Specified cast is not valid. at Nintex.Workflow.Administration.ContentDatabase.GetSiteIdsAndWebApplicationIdsInDatabase(String connectionString) at Hhg=.1xg=.InitAttach(Vxg= context) at Nintex.Workflow.Administration.DatabaseAttacher.Attach() at Nintex.Workflow.AdministrationPages.DatabaseSettings.btnOk_Click(Object sender, EventArgs e) at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint).” is thrown in the SharePoint ULS logs.
Filtering Criteria:
Process | Product | Category | Level |
---|---|---|---|
w3wp.exe | SharePoint Foundation | Runtime | Unexpected |
Symptom
Database fails to mount in Central Administration Nintex Workflow Management Database Settings.
Cause
There is a null or otherwise invalid Guid value present in the dbo.WorkflowInstance table of the Nintex Content Database.
A valid Guid value should be of this format: 00000000-0000-0000-0000-000000000000
More Information here: GUID structure (Windows)
Resolution
- Launch SQL Management Studio and establish a connection to your SharePoint/Nintex SQL Server.
- Execute the following Query against the problematic Database:
-
SELECT DISTINCT SiteId, WebApplicationID FROM WorkflowInstance
-
- You should see a collection of Site Collection ID's and Web Application ID's in the Make note of any rows that contain invalid or NULL values.
- For each row that has an invalid value, there should be another row that contains the correct set of values that would otherwise match. You will need to execute the following Query (Adjusted to fit your requirement) to update the invalid row:
-
UPDATE WorkflowInstance SET WebApplicationID='YourGuidHere' WHERE WebApplicationID IS NULL
-
- Retry the attach operation.