Symptoms
When working with K2 smartforms the following error appears frequently: "SmartObject Unknown could not be found." This error appears on various forms (not on one specific form or subset of forms) and when it happens form freezes for about a minute and shows this error. After page refresh - the error disappears, but it can occur again in several minutes.
Diagnoses
After reviewing logs you may notice that when error "SmartObject Unknown could not be found" appears on different forms (frequently large forms, and they are freezing for prolonged period of time at the time of error) in K2 service log it is visible that method get SMO, which lists/enumerates all SMOs timeouts, see sample error from log below.
Sample error:
"Error","SmartObjects","10520","DatabaseError","SourceCode.SmartObjects.Runtime.SmartObjectManagementServer rGetSmartObjects(int lastNumberOfModified)]","10520 SmartObject Runtime.Management Database Error: 'Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
But on a form/in GUI it eventually displays "SmartObject Unknown could not be found" error which is a bit misleading.
This can be related with the fact that in your K2 environment in the past, deploying SMOs, you created new versions. Doing that a lot of times could make the database tables excessively big and cause such issues.
You may use the following query against K2 DB to verify this:
SELECT Count(SystemName), SystemName FROM SmartBroker.SmartObject GROUP BY SystemName
You may analyze this query results to see whether your SmartBroker.SmartObject has a lot of versions for SmartObjects.
Next you can record SQL Server trace at the time when these errors occurs. It could be the case that 1 certain query or queries have especially long duration. If any of your queries runs for more than 30 second it means that it exceed default SQL command timeout which is 30 seconds. It is possible that there are a lot of complex data which takes a long time to process which means that you can try to increase the time out limit.
Resolution
In case you confirmed that you have SQL queries which exceed default time out setting you may try and increase K2 CommandTimeout setting. Please refer to the following KB article for details:
http://help.k2.com/kb001204_