Symptoms
I ran thru the 4.6.11 upgrade on the K2 server and everything worked fine. I tried to go to the K2 server to run the AppDeployment and I keep getting errors. I believe all the security is setup properly as I am using the same account as I used last upgrade.
Error in the installer trace:
1:5: K2Application.InstallApp: 12:20:00:>> Logged Error: Could not install app. Exception: System.Management.Automation.RuntimeException: You cannot call a method on a null-valued expression.
at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
at SourceCode.SharePoint2013.Common.Powershell.Runscript(String scriptfile, Collection`1and errors, CommandParameterr] commandParemeters)
at SourceCode.SharePoint2013.Common.K2Application.InstallApp()
1:5: IISController.IISReset: 12:20:00:>> Do IIS reset, Timeout: 2147483647
1:5: IISController.IIS7Reset: 12:20:01:>> Do iis reset
1:5: K2Application.ClearCache: 12:20:28:>> Cleared app cache, will reload apps on next query.
1:5: K2Application.GetCompatibleWebApplications: 12:20:28:>> Start get compatible SP 2013 web applications
1:6: K2Application.GetCompatibleWebApplications: 12:20:28:>> Found WebApp: Atlas - http://portal/
1:6: K2Application.GetCompatibleWebApplications: 12:20:28:>> Web app app catalog found: 8309091c-276a-4349-b815-eae4be441b1c
1:6: K2Application.GetCompatibleWebApplications: 12:20:28:>> Check if K2 App is installed in catalog
1:6: K2Application.GetCompatibleWebApplications: 12:20:29:>> Could not check applicaiton: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at SourceCode.SharePoint2013.Common.K2Application.GetCompatibleWebApplications()
Diagnoses
The 'K2 for SharePoint Application Deployment.exe' cab file did not contain an 'Sharepoint On-premises' folder this is a bug with the 'K2 for SharePoint Application Deployment.exe' cab file and a TFS item has been logged.
Resolution
As a workaround, copy the whole K2 for Sharepoint 4.6.11 > Installation directory "4. K2 for SharePoint 4.6.11 (4.13350.1734.0)" to the Sharepoint server and run the appdeployment.exe at this location instead.