Skip to content
Ameen Abozaid
JNR-054

Troubleshooting

  • 6 Lessons
  • 3 h practice (estimate)
On this page 8 topics

Overview

Topics

  • Reading logs
  • reproducing bugs
  • stack traces
  • environment differences

Learn first

3 h of practice (estimate)

Learning outcomes

  1. Reproduce a reported bug reliably, locally or in a test.
  2. Read logs and stack traces from a deployed service to localize a failure.
  3. Identify environment differences (config, data, versions) that explain "works on my machine".
  4. Write a short bug report with root cause, fix, and a regression test.

Lessons

  1. 01A troubleshooting method
  2. 02Logs and stack traces in production
  3. 03Environment differences
  4. 04From bug to regression test
  5. 05Asking for help well
  6. 06Demo: diagnosing a production fault from logs

Lab and exercises

Lab

JNR-054-LAB1 · Break the Shop

Outcomes: 1–4 · Time: ~3 h The instructor injects three faults into a deployed Shop (bad config, data-dependent bug, dependency change). Diagnose each with only logs and the codebase. Acceptance: root cause, fix, and regression test for each.

Exercises (assessment: live troubleshooting session)

IDOutcomeTask
JNR-054-EX011From the report "checkout sometimes fails", write the steps and data needed to reproduce it reliably.
JNR-054-EX021Reproduce a given bug locally in a failing test before looking for the fix.
JNR-054-EX032Given a 30-line stack trace with three "Caused by" sections, name the root cause and the first line in your own code.
JNR-054-EX042Using logs, find the first error for request id abc123 and explain the sequence.
JNR-054-EX053Build a comparison table of local versus production for config, data, and versions and mark the likely culprit for a given symptom.
JNR-054-EX064Write a bug report with symptom, root cause, fix, and regression test for a bug of your choice.
JNR-054-EX074Rewrite a poor help request ("it doesn't work, please help") into a good one.
Show solutions
  • EX01 List the user, data (for example an order without coupon), sequence of calls, and environment; confirm it fails every time.
  • EX02 The test builds the data from the report, asserts the expected behavior, and fails for the same reason as the report.
  • EX03 The last "Caused by" is the root cause; the first frame with your package (for example com.shop...) shows where.
  • EX04 Filter logs by the request id; read the lines in time order up to the first ERROR.
  • EX05 For example a missing environment variable in production explains a startup failure; a null column in production data explains a data-dependent failure.
  • EX06 Use the template: Symptom, Steps, Root cause, Fix, Regression test, Prevention.
  • EX07 "Order API returns 500 for orders without a coupon on staging; works locally. Error and logs attached. I checked Java and env vars. Next I will compare data."
  • Common mistakes (fixing without reproducing, changing several things at once) are assessed in the live session.

Quiz

Outcomes: O1 reproduce · O2 logs and stack traces · O3 environment differences · O4 bug report and regression test.

A self-check for you: nothing is graded, saved or sent anywhere. Choose an answer, then check it. You can try again as often as you like.

  1. 1What comes first when troubleshooting?O1
  2. 2Why change one thing at a time?O1
  3. 3In a stack trace, the root cause is usually:O2
  4. 4A correlation (request) id helps to:O2
  5. 5Which should never be logged?O2
  6. 6"Works on my machine" is often caused by differences in:O3
  7. 7To check what is really running in production, verify:O3
  8. 8The regression test should be written:O4
  9. 9A good bug report includes:O4
  10. 10A good help request includes:O4

Practical part

Seven exercises JNR-054-EX01 to EX07 plus the lab; assessed in a live troubleshooting session. Pass: quiz 8/10, at least five exercises correct, and root cause, fix, and regression test for each of the three lab faults.

Common mistakes

Fixing without reproducing; changing several things at once.

Assessment

Live troubleshooting session.

Career relevance

Incident handling (MID-050) and advanced troubleshooting (SRC-015).

Type to search levels, phases, modules and lessons.