On this page3 sections
DebuggingIntermediate3-5 min reference

Environment Debugging

"Works locally, fails in CI/staging" is rarely a code bug — it's a difference in config, data, versions, or timing between environments. This sheet is the checklist for isolating that difference fast. It pairs with Docker for QA and Linux & CLI for Testers (linked below).

The usual culprits

AreaCheck
Config / env varsSame NODE_ENV, URLs, flags, secrets?
DataSame seed/state? Missing or stale records?
VersionsNode/JDK/browser/dependency versions match?
ServicesAll dependencies up + reachable from this env?
Time / locale / TZServer timezone, locale, clock skew
NetworkFirewalls, proxies, DNS, CORS origins per env
ResourcesCI agent slower / less RAM (timing, OOM)
BuildSame build artifact, or rebuilt differently?

Isolate it

  1. Diff the config — env vars and feature flags between the two environments first.
  2. Reproduce in a container (same image as CI) to remove "my machine" variables.
  3. Check the data — is the failing record present and in the expected state?
  4. Pin versions — compare lockfiles, browser, runtime.
  5. Read the logs in the failing env at the failure timestamp.

Common mistakes

  • Assuming a code bug when it's a config/data/version difference.
  • Different .env / secrets between local and CI that nobody diffed.
  • Tests depending on local data that doesn't exist in CI.
  • Timezone/locale differences breaking date/number assertions.
  • Ignoring that the CI agent is slower → timing-sensitive flake.