Linux Bug Report: 7 Essential Fields and a Worked Example

A Linux bug report is easier to act on when it includes one command that fails and one that succeeds. Here the same Python script prints sample inside its project directory and raises FileNotFoundError one directory higher. Copy the seven-field template for your own issue, or jump to the completed ticket or run the commands.

Two evidence folders represent passing and failing inputs for a Linux bug report.

Linux bug report template: 7 fields to copy

If you already have a terminal open at the failure, copy the error first. To open a Linux bug report, paste the following into your issue tracker and fill it in while you can still inspect the session.

1. Summary and user impact:
2. Program version and runtime environment:
3. Starting directory and smallest input:
4. Exact commands to reproduce:
5. Expected result and basis for that expectation:
6. Actual output and exit status:
7. Comparison run and the one condition changed:

Start your Linux bug report with the last good run

In your Linux bug report, write down what you expected to happen, what actually happened, and the last time you saw the expected result. If you never saw it work, say so. That distinction matters when someone tries to decide whether a recent update caused a regression.

For a command-line program, include the exact invocation, working directory, program version and relevant input. Mention your distribution and shell when they affect the procedure. A long package inventory makes it harder to spot the one version that matters.

Run the two-minute example on Linux

Open Bash on the affected machine and record the environment below. Then run the Bash block below. It creates a fresh temporary fixture and leaves your shell in its original directory. The traceback from the second invocation is the expected observation. Read the three printed status lines individually; the final printf has its own exit status.

. /etc/os-release
printf '%s\n' "$PRETTY_NAME"
uname -srmo
bash --version | head -1
python3 --version

Copy into Bash

(
  work=$(mktemp -d) || exit 1
  mkdir -p "$work/project" || exit 1
  cd "$work/project" || exit 1
  printf '%s\n' 'sample' > input.txt
  printf '%s\n' 'print(open("input.txt").read().strip())' > report.py
  python3 report.py
  printf 'control exit: %s\n' "$?"
  cd .. || exit 1
  python3 project/report.py
  printf 'comparison exit: %s\n' "$?"
  printf '%s\n' 'parent-only' > input.txt
  python3 project/report.py
  printf 'shadow exit: %s\n' "$?"
)
Observed on macOS arm64, Bash 3.2.57 and Python 3.9.6
Starting directory and inputOutput or errorExit
Project, bundled file presentsample0
Parent, no local input.txtFileNotFoundError for input.txt1
Parent, local input.txt containing parent-onlyparent-only0

Read an unexpected result before filing

The example assumes that Bash can create a temporary directory and that the same Python 3 executable runs both commands. If your output differs, use the first message that departs from the expected transcript to decide what belongs in your Linux bug report.

Interpreting the two runs
What you observeWhat to check next
Neither status line appears.Look above the prompt for an error from mktemp, mkdir or cd. The setup can exit before it reaches Python. Record the failing setup command and its message.
Both commands report that python3 is missing.Record the interpreter your application actually uses. A shell lookup failure happens before the script can try to open its input.
The control prints sample and the comparison fails on input.txt.The result matches the observed path dependency. Ask who owns the input file before proposing a code change.
The comparison prints a different value and exits successfully.Check for an input.txt in the parent directory. Reading another file with the same name can silently produce the wrong report. Repeat in the fresh temporary directory created by the Bash block.

The last case also makes a useful regression test. In a disposable copy, give the parent file a distinct marker such as parent-only. If the intended contract is to read the bundled file, a passing run must print sample from both locations. Checking only for exit status zero would miss the wrong-file error. In the recorded run the parent file supplied the output. Include that value alongside the status in your own ticket.

A complete Linux bug report to copy

Copy the following text into your issue tracker. Its Steps field links to the runnable example above. The recorded results come from macOS. Replace the environment and observations with your Linux run before submitting a Linux-specific claim.

Summary: Report generator fails when launched from its parent directory.
Impact: A caller outside the project cannot read the bundled sample.
Environment observed: macOS arm64, Bash 3.2.57, Python 3.9.6.
Linux distribution and Python version: pending independent confirmation.

Steps: Create project/report.py and project/input.txt using the runnable fixture at https://kioptrix.com/how-to-write-a-linux-bug-report-someone-can-reproduce/#example. Run inside project, then from its parent before and after adding parent/input.txt.

Expected (if the file is bundled): both runs print sample and exit 0.
Observed control: sample on stdout, exit 0.
Observed comparison: exit 1. Last stderr line:
FileNotFoundError: [Errno 2] No such file or directory: 'input.txt'
Observed third run: parent-only on stdout, exit 0 after adding parent/input.txt.
Changed condition for the first comparison: the process starts one directory higher. Both commands
launch the same script, with the same interpreter and the same input file.
Acceptance check: repeat all three cases after the fix. Compare stdout
and both exit statuses. Confirm the bundled-input contract with the owner.

Python found project/report.py. The exception names input.txt because open() resolves a relative path against the current working directory. If the caller supplies the input, a command-line argument may be the right interface. If the application bundles the input, test whether it can find the resource from either directory. See the Python reference for open().

Debugging notes for preparing a Linux bug report
Keep the failing command and its successful comparison together in your notes.

What evidence belongs in a Linux bug report?

  • Copy the command and error as selectable text. Preserve capitalization, quoting and the filename mentioned by the error.
  • Replace customer data with a tiny invented fixture. Re-run the example after replacing it to make sure it still fails in the same way.
  • Change one condition per run. Record a successful comparison alongside the failing case.
  • For an intermittent issue, give a count such as “failed on 2 of 10 runs” and include the observation window. A single successful retry leaves the frequency unknown.

Close a Linux bug report with an acceptance check

End your Linux bug report with a check someone else can repeat. For the bundled-input example, run the generator from the project directory and its parent, then compare the output. If the agreed design requires an input argument, test a valid path and a missing path instead. A good acceptance check follows the intended behavior and stays useful after the original reporter closes the terminal.

Catch a fix that silently exits successfully. For the version that reads bundled input, agree on two observable results: a successful exit and the word sample on standard output. Run from both directories. If the parent-directory run now exits successfully but prints nothing, record a partial fix. That result would pass a check that looked only at the exit status. Paste both output and status into the closing comment so a reviewer can repeat the decision.

How to update a Linux bug report after a successful retry

Ask your reviewer to send the directory they started in and the version printed by their interpreter. A successful retry from inside the project is already the control case in this example. It adds little evidence until the reviewer also tries the parent directory. For longer sessions, use the Kioptrix lab session note to keep command, output and interpretation together.

For a Linux service, the comparison might be an interactive shell versus a scheduled run. Keep the input and program version fixed, then inspect the working directory used in each case. If the run never starts, use the systemd timer troubleshooting guide before filing an application bug.

Service startup errors: 203/EXEC points to the executable or interpreter, 200/CHDIR to the working directory, and application errors to the job log.
For a service-only failure, record whether systemd reached the application. A failure while changing directory calls for different evidence from a Python exception.

From first symptom to a useful Linux bug report

When preparing a Linux bug report, the first error you see often appears several steps after the first thing that went wrong. Before reducing an example, describe the user-visible task in one sentence. “I need the daily inventory as a CSV file” tells a maintainer what success looks like. “Python printed a traceback” describes one piece of evidence. If the script later exits successfully but writes an empty CSV file, that distinction keeps the ticket from closing too soon.

Date the first failure in your Linux bug report

Suppose the export worked on Tuesday and failed on Friday. If nobody ran it on Wednesday or Thursday, Friday is the first observed failure. It is tempting to attribute the change to Thursday’s package update. Record the update as a candidate explanation and leave the onset window open. Somebody reading the ticket can then compare package versions without assuming the answer before trying the experiment.

If you can still run an older copy, give it the same invented input and launch it from the same directory. Record the version string of each copy separately. If the old copy succeeds under those conditions, you have a useful regression boundary. If both copies fail, leave both outcomes in the Linux bug report. That result can save the maintainer an afternoon spent looking through unrelated recent commits.

Reduce one dimension at a time

Imagine the real input contains ten thousand rows. Try a ten-row copy first. If it still fails, try one row. If the failure disappears, put back half of what you removed and try again. Keep the original file untouched. The goal is to produce a small file you can share and explain. In the worked example, one line containing the word sample is enough because Python fails before reading any content.

A reduction can accidentally change the problem. Replacing a spreadsheet with an empty text file may produce a parsing error, even though the original failure happened when opening a path. Compare the error class, filename and step that failed after every substantial reduction. When those signals change, identify the new result as a separate observation. A shorter reproducer is useful only while it preserves the behavior under investigation.

Make locations unambiguous

In a Linux bug report, “run from the folder above” only makes sense if readers know where they started. Show a two-line directory listing or name the files in prose. In our example, the parent contains a project folder, and the project folder contains both report.py and input.txt. Naming that layout removes an entire round of questions about whether the input should sit beside the script or beside the caller.

Working directories can reveal a person’s login name or the name of an unreleased product. Create a neutral fixture under a temporary directory and describe its layout relative to that root. Replace private path prefixes consistently. If two different paths collapse to the same placeholder, the resulting transcript can conceal the distinction that triggered the failure. Running the example again from the clean directory is an inexpensive way to catch that mistake.

Give a Linux bug report a passing input and a failing input

Suppose a regional export contains two rows, but the totals column comes out blank. Give the maintainer two small inputs and run the same parser against both. In this example, the only difference is the delimiter.

printf 'east,7\nwest,9\n' | awk -F, '{print $2}'
printf 'east;7\nwest;9\n' | awk -F, '{print $2}'
printf 'east;7\nwest;9\n' | awk -F, '{print NF}'

The first command prints 7 and 9. The second prints two empty lines. The third prints 1 twice: the parser saw one field per row. Include this last observation so the person reading the ticket can distinguish a blank field from an empty input file.

Example ticket update. “The same command extracts both amounts from the comma sample. With semicolons it reads both rows but finds one field in each. Which delimiter does the export contract specify?” Once the owner confirms that contract, the team can assign the fix to the producer or the reader. These plain two-field samples keep the test independent of real customer data.

Choosing a log excerpt for a Linux bug report

A log excerpt in a Linux bug report should help a reviewer make one decision. For the Python example, that decision is whether the interpreter failed to locate the script or the script failed to locate its input. The last exception line names the input. A traceback frame identifying the call to open supplies the preceding step. Together those two facts explain more than a screenshot of a terminal window filled with unrelated output.

Write down which stream carried the message

Tools that feed a pipeline can return ordinary output on standard output and diagnostics on standard error. A reader who redirects only standard output may get an empty file even though the terminal displayed a long error. For a local test with invented data, you can keep the two streams separate. In the runnable Bash block, replace the first invocation of python3 project/report.py and its comparison status line with the lines below. Run the entire block again. At that point the shell is inside the newly created parent directory and the fixture exists. After the closing parenthesis, your shell returns to its original directory.

python3 project/report.py > run.stdout 2> run.stderr
status=$?
printf 'exit status: %s\n' "$status"
printf 'Captured files in: %s\n' "$PWD"

The shell creates the two files in your current directory. Choose a fresh test directory for this variation because redirection replaces the contents of existing files with those names. Read the captured output before attaching it. A filename, a record identifier or a token printed by a real application can survive even when the example command looks harmless. Share only the excerpt needed to understand the observation.

Record time with enough context

Systemd timer not running diagnosis: match NEXT and LAST to the service journal, then verify fresh output
Example for a scheduled export: capture the trigger time, service result and timestamp of the resulting file.

For an interactive one-command example, the order of events usually matters more than the wall clock. For a scheduled job, include the time zone and the window you inspected. “No output at 09:00” leaves open which machine supplied the clock and whether you checked before the job normally finished. State the scheduled time, the time you looked and the evidence you would expect to see after a successful run.

Keep observations from separate machines clearly labeled. A laptop displaying local time and a server logging UTC may describe the same event with different dates around midnight. Preserve the original timestamps alongside any conversion. A maintainer can then check the conversion and compare nearby events without guessing which entries you shifted. This level of detail belongs in a timing-related ticket. It adds little to a deterministic file lookup example.

Writing a Linux bug report for an intermittent failure

What does one successful retry establish? Two testers run the same release. One reports “works here” after one attempt. The other sees two failures in ten attempts. Can the maintainer close the ticket?

Compare your decision with the worked answer

Keep it open. Record the denominator as well as the failure count. A single successful attempt is compatible with an intermittent failure. Compare starting directories, inputs and runtime versions before pooling the runs.

Copy into the ticket. Illustrative record: same build and input; project directory 0 failures in 5 attempts; parent directory 2 failures in 5 attempts. Preserve one failing trace and one passing trace from the parent directory. Repeat both conditions after the proposed fix.

When a failure comes and goes, the smallest useful example may be a sequence of attempts. Keep a short run log with an attempt number, starting state, outcome and one distinguishing detail. For instance, distinguish the first launch after starting the application from a second launch within the same session. Report the observed counts along with the conditions. Two failures in ten attempts describe that experiment and leave the underlying failure rate open.

Separate retries that change state from clean reruns. An unsuccessful export may still create an output directory or a partial file. A second attempt can therefore exercise a different branch even when the command line is identical. Record whether the destination existed before each run. If the test uses disposable fixtures, begin from a fresh copy for each comparison and keep a failed copy for inspection. This also gives reviewers a concrete starting state to recreate.

A final handoff check for your Linux bug report

Read your Linux bug report once as someone who has never seen the repository. Can you identify the program, obtain or recreate the input, choose the starting directory and run the command without filling in a missing step? Then read it as the person deciding whether a fix is ready. Can you tell which output is acceptable, what should happen on invalid input and how to recognize an unrelated error?

For the running example, two product decisions lead to different acceptance checks. If the input is bundled, launch from both directories and expect the same sample text with exit status zero. Also move the fixture aside in a disposable copy and check that the program reports the missing resource clearly. If the caller supplies the file instead, document the argument syntax and test two explicit paths, one valid and one absent. Decide which behavior you want before turning either check into a permanent test.

Does your Linux bug report need a screenshot?

In a Linux bug report, a screenshot earns its place when the symptom is visual, such as a disabled button, clipped text or a dialog that obscures another control. For a terminal error, selectable text lets reviewers search an exact string, quote one line and run the command themselves. If a screenshot adds context, include it beside the text and crop it to the relevant area. Preserve the exact error spelling in the accompanying transcript.

Update the Linux bug report after a fix

Identify the build or release you checked. Repeat the original failing case before adding new variations. Record the observed output and exit status and name the successful control that still passes. If the exception disappears but the generated report is empty, describe that as a new observed outcome and compare it with the original acceptance check. The absence of a traceback alone tells you little about whether the user can finish the task.

Closing note to fill in after verification. “Tested build ___ on ___. Inside the project: output ___, status ___. From the parent: output ___, status ___. The bundled-input acceptance check passed / failed.”

Stay Updated with Kioptrix

Get practical guides, useful resources, and new articles delivered to your inbox.

No spam. Unsubscribe anytime. Read our Privacy Policy.