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.
| ID | State Name | Description |
|---|---|---|
| 7 | Downloading | Local Agent is downloading packages. If stuck, Agent or storage connectivity may be the issue. |
| 2 | Deploying | Orchestrator is executing deployment actions in Service Fabric. |
| 1 | Active | Environment 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.
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
No comments:
Post a Comment