Skip to main content

Dive: Understanding State and Status in the Orchestrator Database

Deep Dive: State and Status in D365 On-Premise (LBD)

Deep Dive: Understanding State and Status in D365 On-Premise (LBD)

In Dynamics 365 Finance & Operations On-Premises (LBD), troubleshooting often requires looking at two independent layers:

  • The Logical Layer (Orchestrator Database)
  • The Physical Layer (Service Fabric Cluster)

Part 1: The Logical Layer (Orchestrator DB)

The Orchestrator defines what should happen. Its core table is Deployment. The state machine here represents the “intended plan.”

1. DeploymentState (What stage are we in?)

These states follow a generally linear lifecycle.

stateDiagram-v2 [*] --> Undefined Undefined --> Preparing: User Clicks Deploy Preparing --> Downloading: Local Agent downloads package Downloading --> Prepared: Package Ready Prepared --> Deploying: Orchestrator starts SF actions Deploying --> Active: Successful Deployment Deploying --> Inactive: Failed Deployment Active --> Deleting: Removing Environment Deleting --> Deleted
Figure 2: Expected flow of Deployment States.
IDState NameDescription
7DownloadingLocal Agent is downloading packages. If stuck, Agent or storage connectivity may be the issue.
2DeployingOrchestrator is executing deployment actions in Service Fabric.
1ActiveEnvironment is deployed and running.

2. DeploymentStatus (How is it going?)

Status indicates whether the Orchestrator encountered errors:

  • None (0): Normal operation.
  • Failed (2): A deployment step failed.
  • StateTransitionIncomplete (3): A state change failed; deployment is stuck.

Part 2: The Physical Layer (Service Fabric)

When the Orchestrator is stuck in Deploying, it is usually waiting for Service Fabric to complete service or replica transitions.

graph TD Cluster --> Node1 Node1 --> Application Application --> Service Service --> Partition Partition --> R1[Replica 1] Partition --> R2[Replica 2] style R1 fill:#ffcccc,stroke:#333,stroke-width:2px style R2 fill:#ccffcc,stroke:#333,stroke-width:2px
Figure 3: Service Fabric Health Hierarchy. A single unhealthy replica (Red) can block Orchestrator transitions.

ReplicaStatus (Common physical blocker)

  • InBuild: Node is copying data; can be slow if network or disk is slow.
  • Standby: Replica assigned but not active.
  • Ready: Replica is healthy and active.

Troubleshooting: Safe SQL Queries

Run ONLY on: OrchestratorDB

Step 1: Check last Orchestrator Command

Confirms whether the system received your deploy/download click.

SELECT TOP 5 
    Id,
    CommandType,   -- 1=Deploy, 9=Download
    CommandStatus, -- 0=Init, 4=Processing, 2=Processed, 6=Failed
    CreatedDateTime,
    ModifiedDateTime
FROM OrchestratorCommand
ORDER BY CreatedDateTime DESC;

Step 2: Check Deployment State

SELECT TOP 1 
    Id,
    DeploymentState,  -- e.g. 7=Downloading, 2=Deploying
    DeploymentStatus
FROM Deployment;
-- Use WHERE Id='your GUID' if multiple environments exist

Step 3: Join with OrchestratorCommand

SELECT TOP 5
    d.DeploymentState,
    c.CommandType,
    c.CommandStatus,
    c.JobDescription

Comments

Popular posts from this blog

Developing SSRS Reports Using Report Data Provider in D365F&O

Developing SSRS Reports Using Report Data Provider in D365F&O In this article, we will cover the Report Data Provider (RDP) class and the Report Contract class. We will also learn how to implement these classes for reporting needs in Dynamics 365 Finance & Operations and create a report using the RDP class via a step-by-step walkthrough. Report Data Provider (RDP) Framework A Report Data Provider (RDP) class is an X++ class used to access and process data for a report. An RDP class is an appropriate data source type when the following conditions are met: You cannot query directly for the data you want to render on a report. The data to be processed and displayed is complex and requires specific business logic. Report Data Provider Class This is an X++ class used to access and process data for an SSRS report. The RDP class processes business logic based on specified parameters and/or queries and return...

Fix SSRS Parameter Panel Layout Error

Fix SSRS Parameter Panel Layout Error [Fix] SSRS Error: "The parameter panel layout for this report contains more parameters than total cells available" Tags: #SSRS #Dynamics365 #SQLServer #ReportingServices #Troubleshooting If you have been working with SSRS (SQL Server Reporting Services) lately—especially within the Dynamics 365 environment—you might have encountered a frustrating error when trying to deploy a report after adding a new parameter. It usually happens when you add a Hidden Parameter or modify the existing list, and suddenly the deployment fails with this severity code: Error: The parameter panel layout for this report contains more parameters than total cells available. Source: Microsoft.ReportingServices.Library.ReportingService2005Impl.CreateReport The Scenario You have an existing report. You need to add a new par...

Developing SSRS Reports Using a Query in D365F&O

Developing SSRS Reports Using a Query in D365F&O In this tutorial, we will learn how to develop a report based on a predefined Query in the Application Object Tree (AOT) within Visual Studio. This method is often faster than using a Report Data Provider (RDP) class when complex business logic is not required. Scenario: We will create a report that prints a simple list of customer transactions directly from the CustTrans table without writing X++ business logic. Step 1: Create the Project and Query Unlike previous versions of Dynamics, all development for D365F&O occurs inside Visual Studio. Open Visual Studio as an administrator. Create a new Finance and Operations project. In the Solution Explorer , right-click the project node. Select Add > New Item . Select Query from the list and name it CustomerTransactionQuery . Click Add . Configuring the Data Source...