Bird
0
0

A microservice fails to load its configuration from environment variables and crashes. Which is the most likely cause?

medium📝 Analysis Q14 of 15
Microservices - Configuration and Secrets Management
A microservice fails to load its configuration from environment variables and crashes. Which is the most likely cause?
AThe service code has a syntax error unrelated to config
BEnvironment variables were not set before service startup
CThe service uses hardcoded values instead of env vars
DThe database is down
Step-by-Step Solution
Solution:
  1. Step 1: Understand environment variable loading

    Microservices read environment variables at startup. If variables are missing, config loading fails.
  2. Step 2: Identify cause of crash

    If env vars are not set before starting, the service cannot find needed config and may crash or error out.
  3. Final Answer:

    Environment variables were not set before service startup -> Option B
  4. Quick Check:

    Missing env vars cause config load failure [OK]
Quick Trick: Set env vars before starting service [OK]
Common Mistakes:
  • Blaming unrelated syntax errors
  • Assuming hardcoded values cause crashes
  • Confusing database issues with config loading

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Microservices Quizzes