Blocking error RegisterServiceInstanceObjects when upgrading to K2 5.6/5.7

K2 5.7 Upgrade Error: Blocking Issue with Orphaned Service Instances

Error Message:

  •             07:30:39:>> AuthorizationBase.RegisterServiceInstanceObjects: Current ServiceType and ServiceInstance details: ServiceType.Guid = GUIDValue1. ServiceInstance.Guid = GUIDValue2 . ServiceInstance.Name = ServiceInstanceName

                07:30:39:>> ConnectionHelper.GetServerInstance: Create 'AuthorizationClient' instance using ConnectionContext

                07:30:39:>> AuthorizationBase.RegisterObject: Validate Parent

                07:30:39:>> AuthorizationBase.Execute: Logged Error: Failed: System.Exception: Item 'GUIDValue1' does not exist

       at SourceCode.Install.Package.Actions.Authorization.AuthorizationBase.RegisterObject(String name, Guid id, Guid parentID, Guid classID, String className, Boolean inherit, Boolean propagate, IIdentityReference owner)

       at SourceCode.Install.Package.Actions.Authorization.AuthorizationBase.RegisterServiceInstanceObjects(Guid classId, String className, Boolean inherit, Boolean propagate, String ownerFqn, IdentityType identityType)

       at SourceCode.Install.Package.Actions.Authorization.RegisterObjectsForServiceInstances.ExecuteTarget(Target target)

       at SourceCode.Install.Package.Actions.Authorization.AuthorizationBase.Execute(Target target)

                07:30:39:>> AuthorizationBase.Execute: Finish RegisterObjectsForServiceInstances 'RegisterObjectsForServiceInstances'. Successful: False

              07:30:39:>> Target.Execute: !Completed: RegisterObjectsForServiceInstances, Success: False

Root Cause:

  • Service Instance Security feature (introduced in K2 5.6) verifies valid Service Instances before assigning permissions.
  • Orphaned Service Instances (without associated Service Types) can trigger this error.

Troubleshooting Steps:

  1. Identify Orphaned Instances:

    • Run the SQL query:
      SQL
      SELECT * FROM [SmartBroker].[ServiceInstance] WHERE [ServiceTypeGuid] NOT IN (SELECT [Guid] FROM [SmartBroker].[ServiceType])
  2. Delete Orphaned Instances:

    • Remove any identified orphaned instances from the [SmartBroker].[ServiceInstance] table.
  3. Resume Upgrade:

    • Rerun the Setup Manager and choose the "Recover" option to continue the upgrade process.

Prevention:

  • Avoid creating orphaned instances by deleting service instances before deleting their associated service types.

Additional Considerations:


Comments

Popular posts from this blog

Blocking Error during K2 5.6 Server migration

Client Credentials flow with K2 Cloud with Odata, Workflow REST or SCIM