Unable to access the Environment Library:The connection string is invalid: [Mail Server]. Index was outside the bounds of the array.
kbt153474
PRODUCTIssue
Unable to access the Environment Library in the K2 Management site and the SmartObjects/Views/Forms in K2 Designer due to the error below:
"The connection string is invalid: [Mail Server].
Index was outside the bounds of the array."
Symptoms
When you click on the Environment Library node, you will see this error:
When opening any SmartObject, View or Form in K2 Designer, the same error appears:
Troubleshooting Steps
The cause of the error is due to the Mail Server environment library fields' field type being incorrectly set to 'Exchange Server' instead of 'Mail Server'.
Please follow the steps below to resolve the issue:
1. Make a backup of your K2 database, in case of a need to roll back.
2. Run the following query and note down the value in 'TypeId'.
Select * from [K2].[Environment].[FieldType]
where FriendlyName = 'Mail Server'
3. Run the following query to update 'TypeId' to the correct value, which is the Type Id of the Mail Server field.
Update [K2].[Environment].[Field]
set TypeId = '<Replace with TypeId from Step 2>'
where FieldName = 'Mail Server'