[Orchestrator] Orchestration Console and Web Service are not working anymore

If you have the problem that the Orchestration Console and Web Service cannot be opened and the following error is logged:

The server encountered an error processing the request. The exception message is 'An error occurred while executing the command definition. See the inner exception for details.'. See server logs for more details. The exception stack trace is:     System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)

at System.Data.EntityClient.EntityCommandDefinition.Execute(EntityCommand entityCommand, CommandBehavior behavior)
at System.Data.EntityClient.EntityCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.EntityClient.EntityCommand.ExecuteScalar[T_Result](Func`2 resultSelector)
at System.Data.Objects.ObjectContext.ExecuteFunction(String functionName, ObjectParameter[] parameters)
at Microsoft.SystemCenter.Orchestrator.WebService.OrchestratorContext.OnContextCreated()

You might be missing some objects in the Orchestrator DB... exactly what will show up in a WCF Trace configured in the web.config of the web service.

In one case, the following Service 'https://schemas.microsoft.com/SystemCenter/Orchestrator/Maintenance/MaintenanceService' and Queue [Microsoft.SystemCenter.Orchestrator.Maintenance].[MaintenanceServiceQueue] were missing from the Orchestrator DB, so a first check would be here.

If not a quicker way to solve this issue would be a restore of the Orchestrator DB to a time prior to this error.

The service and queue can be recreated manually by running the following queries on the Orchestrator DB:

  1. MaintenanceServiceQueue

USE [Orchestrator]

GO

/****** Object:  ServiceQueue [Microsoft.SystemCenter.Orchestrator.Maintenance].[MaintenanceServiceQueue]    Script Date: 8/10/2016 7:19:31 AM ******/

CREATE QUEUE [Microsoft.SystemCenter.Orchestrator.Maintenance].[MaintenanceServiceQueue] WITH STATUS = ON , RETENTION = OFF , ACTIVATION (  STATUS = ON , PROCEDURE_NAME = [Microsoft.SystemCenter.Orchestrator.Maintenance].[MaintenanceWorker] , MAX_QUEUE_READERS = 1 , EXECUTE AS N'dbo'  ), POISON_MESSAGE_HANDLING (STATUS = ON)  ON [PRIMARY]

GO

 


2.MaintenanceService

USE [Orchestrator]

GO

/****** Object:  BrokerService [https://schemas.microsoft.com/SystemCenter/Orchestrator/Maintenance/MaintenanceService]    Script Date: 8/10/2016 7:20:22 AM ******/

CREATE SERVICE [https://schemas.microsoft.com/SystemCenter/Orchestrator/Maintenance/MaintenanceService]  ON QUEUE [Microsoft.SystemCenter.Orchestrator.Maintenance].[MaintenanceServiceQueue] ([DEFAULT])

GO