checkId: check.core.services.dependencies plugin: stellaops.doctor.core severity: fail tags: [quick, services, di]
Required Services
Doctor check
check.core.services.dependencies— for operators and developers confirming a Stella Ops service registered its foundational dependencies (clock, logging) in the .NET DI container, a sign the host started up correctly.
What It Checks
Verifies that required infrastructure services are registered in the .NET dependency injection (DI) container. The check resolves the following service types from the IServiceProvider:
| Service Type | Purpose |
|---|---|
TimeProvider | Abstracts system clock for testability and time-based logic |
ILoggerFactory | Provides structured logging across all components |
For each service type, the check attempts GetService<T>(). If the service resolves to null or throws, it is recorded as missing.
The check reports the count of registered vs. missing services and lists the missing ones by name.
Why It Matters
These services are foundational dependencies used by nearly every Stella Ops component. If TimeProvider is missing, time-based features (token expiration, certificate validity, scheduling) will not work. If ILoggerFactory is missing, no structured logging is produced, making troubleshooting impossible. A missing DI registration usually indicates a misconfigured Program.cs or a missing AddStellaOps*() call during startup.
Common Causes
- Services not registered in the DI container during application startup
- Missing
builder.Services.AddXxx()call inProgram.csorStartup.cs - Incorrect service registration order causing dependency resolution failures
- Custom host builder that skips default service registrations
How to Fix
Docker Compose
This is a code-level issue, not a deployment configuration problem. Ensure the service’s Program.cs includes the standard Stella Ops service registration:
builder.Services.AddSingleton(TimeProvider.System);
builder.Services.AddLogging();
Rebuild the container after code changes:
docker compose build <service> --no-cache
docker compose up -d <service>
Bare Metal / systemd
Verify the application is using the standard Stella Ops host builder. Check Program.cs for the required registrations.
Restart after any code changes:
sudo systemctl restart stellaops-<service>
Kubernetes / Helm
This issue requires a code fix and new container image. After fixing the registration, build and push a new image:
docker build -t stellaops/<service>:latest .
docker push stellaops/<service>:latest
kubectl rollout restart deployment/<service>
Verification
stella doctor run --check check.core.services.dependencies
Related Checks
check.core.services.health— aggregates health check results from registered health check servicescheck.core.config.loaded— verifies the configuration system is loaded (a prerequisite for service registration)
See the Doctor reference for the full check catalog, CLI usage, and export bundles.
