Symptoms
After a environment or runtime site has been changed you may encounter an error such as:
The Following location might be invalid. Continue to: */File.ashx?_SOID etc.
If you click yes you are redirected to a page showing a 401.2 unauthorised error:
"You are not authorized to view this page due to invalid authentication headers."
Diagnoses
We found that a SmartForms Runtime SSL environment field was missing from Environment.Field table after a runtime site was relocated to another server.
Resolution
We readded the SSL URL via a SQL script, restarted the service, and cleared the browser cache. After this the 401.2 errors were resolved and the client could successfully create packages using K2 for SharePoint.