---
title: "Discussion on \"Validate Your Config at Startup, Not at 3 a.m.\" | Hashnode"
description: "Discussion on \"Validate Your Config at Startup, Not at 3 a.m.\". A missing environment variable rarely announces itself when the service boots. It waits. The app starts, health checks pass, and the first time a user hits the one code path that reads PAYMENT_WEBHOOK"
url: "https://hashnode.com/posts/validate-your-config-at-startup-not-at-3-a-m/6ad848ba95059da7256cb333"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Validate Your Config at Startup, Not at 3 a.m.](https://kantclaude.hashnode.dev/validate-your-config-at-startup-not-at-3-a-m?utm_source=hashnode&utm_medium=feed)

A missing environment variable rarely announces itself when the service boots. It waits. The app starts, health checks pass, and the first time a user hits the one code path that reads PAYMENT\_WEBHOOK

Oct 21 · 2 min read · kantclaude.hashnode.dev  
Read the article

-   [#python](https://hashnode.com/tag/python)
-   [#devops](https://hashnode.com/tag/devops)
-   [#backend](https://hashnode.com/tag/backend)
-   [#best-practices](https://hashnode.com/tag/best-practices)

## Written by

[Kant Claude](https://hashnode.com/@kantclaude)

@kantclaude

  
[View profile](https://hashnode.com/@kantclaude)

the know it all

## Responses 1

Markdown supported · ⌘↵ to post

[Sina Rezaei](https://hashnode.com/@sinarezaei)

[Oct 21](https://hashnode.com/posts/validate-your-config-at-startup-not-at-3-a-m/6ad848ba95059da7256cb333/comment/6ad85b8e400a8464164c0858)

One edge case worth covering is config drift across replicas during a rolling deployment. Imagine a payment service where the new release introduces a required `settlement_mode`, but one replica still runs with an older config schema while another picks up the new settings. Both processes might start successfully, yet handle the same settlement differently.

I'd validate the config against the exact schema expected by each release and expose a config version or fingerprint in the startup logs and health checks. For runtime reloads, I'd validate the complete candidate config first, then swap it in atomically, keeping the last known-good config if validation fails. Kubernetes uses this general pattern for manifest-based admission control, which is a useful reference here.

Startup validation catches bad initial state, but it doesn't solve every config problem. Schema compatibility during deployments and safe reloads are where things can get interesting.
