checkId: check.core.env.variables plugin: stellaops.doctor.core severity: warn tags: [quick, environment, configuration]

Environment Variables

Doctor check check.core.env.variables — for operators confirming a Stella Ops service knows which hosting environment it is running in, so it loads the right config and does not leak development settings into production.

What It Checks

Verifies that expected environment variables are configured for the runtime environment. The check looks for two recommended variables:

VariablePurpose
ASPNETCORE_ENVIRONMENTSets the ASP.NET Core hosting environment (Development, Staging, Production)
DOTNET_ENVIRONMENTSets the .NET hosting environment (fallback for non-ASP.NET hosts)

The check also counts all platform-related environment variables matching these prefixes: STELLA*, ASPNETCORE*, DOTNET*, CONNECTIONSTRINGS*.

Result logic:

Why It Matters

The hosting environment controls which configuration files are loaded (appsettings.Development.json vs. appsettings.Production.json), whether developer exception pages are shown, and how logging is configured. Running in the wrong environment can expose detailed error information in production or apply development-only settings that degrade performance.

Common Causes

How to Fix

Docker Compose

Add the environment variable to your service in docker-compose.yml:

services:
  platform:
    environment:
      ASPNETCORE_ENVIRONMENT: Production

Or in the .env file:

ASPNETCORE_ENVIRONMENT=Production

Bare Metal / systemd

Set the variable in the systemd unit file:

[Service]
Environment=ASPNETCORE_ENVIRONMENT=Production

Or export it in the shell:

export ASPNETCORE_ENVIRONMENT=Production
sudo systemctl restart stellaops-platform

Kubernetes / Helm

Set in Helm values:

env:
  - name: ASPNETCORE_ENVIRONMENT
    value: "Production"

Or in the pod spec directly:

kubectl set env deployment/stellaops-platform ASPNETCORE_ENVIRONMENT=Production

Verification

stella doctor run --check check.core.env.variables

See the Doctor reference for the full check catalog, CLI usage, and export bundles.