This article was created in response to a support issue logged with K2. The content may include typographical errors and may be revised at any time without notice This article is not considered official documentation for K2 software and is provided “as is” with no warranties.

Issue

In K2 Management page, an "Object reference not set to an instance of an object" error is shown whenever you try to access a workflow page, or open a category.

Image

Symptoms

  • The Setup Manager indicated that it encountered some error when attempting to install or upgrading to 4.7 (or above)
  • Installer trace logs generated by the Setup Manager shows the following kspx packages encountered errors when deploying:
    • DocuSign_Feature_Activation.kspx
    • K2 for SharePoint 2013.kspx
    • K2 Package and Deployment for SharePoint.kspx
    • Management.kspx
    • SmartForms Tester Collateral.kspx
  • If you try to deploy the above packages manually using the Package and Deployment tool, you will encounter a number of "Authorization Failed" errors
  • Your K2 database is restored from a backup from another K2 environment
  • This environment has a different administrator account and K2 service account, and you are using these accounts to run the Setup Manager or deploy the packages.

Troubleshooting Steps

If you analyze the errors shown by the Package and Deployment tool, you will notice those views failed to deploy because some images those views depended on failed to deploy. The Management page relies on these views to function properly, so if these views are not deployed, the Management page will throw an "Object reference not set to an instance of an objec" error when you try to access certain pages.

Image

These images are uploaded to your K2 database via the Forms Image SmartObject. If you execute this SmartObject from the SmartObject Service Tester, you will also encounter an "Authorization Failed" error.

Image

In this case, please try the following to resolve the issue:

  1. Open your K2 Management page
  2. Go to Integration > SmartBox Object 
  3. Select Forms Image 
  4. Make sure the K2 service account/administrator account, or the user who is running the Package and Deployment tool has the rights to execute all the methods in Forms Image. If no user accounts are shown in the Object Permissions list, then do not try to add any users to it.

    Image

  5. If you have added the user account to SmartBox Object, then please deploy the packages again. This time you should be able to deploy the packages without encountering the same error.
  6. Once the packages are deployed, go to your K2 Management page again, and check if the error is still occuring.