DEV Community

Cover image for Debugging production only bugs with preview environments 🐛
Flora Brandão for Upsun

Posted on

Debugging production only bugs with preview environments 🐛

Reproducing a bug that only fails for specific annual accounts in production is a massive grind, especially when all your local tests pass.

Here is how to fix it without risking sensitive data:

  • Branch from main to clone production services, configuration, and data into an isolated environment
  • Use sanitization scripts in your deploy hook to scrub personal details while preserving the exact billing state
  • Open SSH tunnels and attach a remote debugger to step through logic against real failing accounts
  • Validate the fix in the same environment where you diagnosed the bug before merging

Testing fixes against the actual conditions that caused the failure removes the guesswork from debugging.

Check out the full article to see the complete step by step workflow:

From bug report to verified fix in one workflow | Upsun

Follow one bug from ticket to fix: clone production, reproduce it with real data, debug it, and validate the fix before it reaches your customers

favicon upsun.com

Top comments (0)