MSBA-308 · Lesson 4 of 12 · 20 min

Domain review: troubleshooting

▶ Video coming soon A video version of this lesson is on the way.

Lena's practice assessment had flagged troubleshooting as her second weakest domain, which surprised her. She had fixed more broken workflows than anyone at Tidewater. On Thursday Priya explained why the score and the experience did not match. "When a workflow breaks here, you know the repository, you know what changed and you can click around until you see it," she said. "The exam gives you a log excerpt or a YAML file and four options. You can't click. You have to read." The second domain, Consume and troubleshoot workflows, carries 15 to 20 of the exam weight. It has three subgroups: interpreting workflow behavior and results, accessing artifacts and logs, and using and managing workflow templates.

A method for reading failures

Priya gave Lena a fixed order of questions to ask of any failure scenario, so that she would read the evidence instead of guessing from the symptom.

A flowchart of five questions. One: did the workflow run at all? If no, check the trigger, branch and path filters, and whether the workflow is disabled. Two: which job and step failed first? Three: is it the same in every matrix variant? Four: what is the first error line, not the last? Five: what changed, in the repository, the runner image, an action version, a secret or a permission? Each leads to a typical fix.
Five questions to ask of any failed run, in order.

Did it run at all? Many troubleshooting questions are about workflows that never started. The trigger may not match: a push to a branch not listed under branches, a change only in files excluded by paths-ignore, a pull request from a fork where the event is pull_request_target rather than pull_request, or a scheduled workflow in a repository with no activity for 60 days, which GitHub disables automatically in public repositories. The workflow may have been disabled by hand. Or the file may be on a branch where it does not count: most events use the workflow file from the commit or branch that triggered them, but schedule and workflow_dispatch use the default branch's version unless you choose another ref.

Which job and step failed first? The run summary shows the job graph. A red job with gray jobs after it usually means the later jobs were skipped because of needs, not that they failed. In the logs, start at the first step with an error. Later steps often fail only because an earlier one did.

Is it the same in every variant? For matrix jobs, compare variants. A failure on Windows only points at paths, line endings or shell differences. A failure on one runtime version points at a dependency or an API change. The outline asks you to correlate job names to matrix axes and to rerun individual matrix jobs; the run page lets you rerun a single failed job, or all failed jobs, without rerunning the whole workflow.

What is the first error line? Logs are long, and the last red line is often a consequence. Look for the first line marked as an error, or for an ::error:: annotation, which appears at the top of the run summary too.

What changed? If the repository did not change, something else did: the runner image, an action that was referenced by a moving tag, a secret that was rotated or deleted, a token permission default, or a policy at the organization level. Lesson 2's runner image example is one case of this.

Reading logs and run history

The outline asks you to identify triggers and effects from configuration and logs, and to diagnose failures using logs and run history. Several details in a run's log are worth knowing by sight.

Log sections and what each reveals.
WhereWhat it tells you
Set up jobRunner name and image version, the GITHUB_TOKEN permissions granted, and which actions were downloaded at which refs
Run summary headerThe event that triggered the run, the actor, the branch and commit
AnnotationsErrors and warnings raised by ::error:: and ::warning:: commands or by problem matchers
Post stepsCleanup and cache save; a skipped cache save means an exact key hit
Complete jobOrphan process cleanup and the final job status
Run attemptsEach rerun is a new attempt; earlier attempts stay in the history

Two diagnostic switches deserve a mention. Setting the repository secret or variable ACTIONS_STEP_DEBUG to true adds debug messages to step logs; ACTIONS_RUNNER_DEBUG adds runner diagnostic logs. When you rerun a job from the UI, you can tick a box to enable debug logging for that attempt only, which is usually the better choice than leaving debug on for everyone.

Worked problem

A permissions failure

A job that comments on pull requests fails with "Resource not accessible by integration". It worked last month. The organization recently changed its default workflow permissions. What does the log show, and what is the fix?

Show solution
  1. Open Set up job: the GITHUB_TOKEN permissions list shows what the token was granted for this job.
  2. If pull-requests is read only, the token cannot write the comment.
  3. The organization's default has likely moved to read-only, which is GitHub's recommended setting.
  4. Add permissions: pull-requests: write to the job, keeping everything else at the default.

Answer: The token lacks pull-requests write permission after the default changed; grant it at the job level with a permissions key.

Another common pattern is the fork pull request. A run triggered by pull_request from a fork gets a read-only token and no access to repository secrets, so a step that needs a secret fails or sees an empty value. That is intended. The safe fix is usually to split the work: run untrusted checks on pull_request, and do anything that needs secrets in a separate workflow that does not check out or run the fork's code. Using pull_request_target to give fork runs secrets while checking out the fork's code is exactly the pattern GitHub warns against, and from December 2026 GitHub blocks pull_request_target by default in public repositories. Tidewater learned this when Malik's fork pull request could not publish a preview.

Matrix failures

The outline gives matrices a bullet of their own in this domain: interpret expansions, correlate job names to axes, analyze failures across variants and rerun individual jobs. Job names in the run list include the matrix values in parentheses, such as test (windows-latest, 24), unless the job has a name expression that changes it.

Worked problem

Which variants failed?

A matrix of os: [ubuntu-latest, windows-latest] and node: [22, 24] shows test (windows-latest, 22) failed and test (windows-latest, 24) canceled, while both Ubuntu jobs passed. fail-fast is not set. What happened?

Show solution
  1. fail-fast defaults to true, so when one matrix job fails, GitHub cancels the jobs still running.
  2. The canceled job did not necessarily have a problem; it was stopped.
  3. Both failures and cancellations are on Windows, so start with a Windows-specific cause.
  4. Rerun the failed jobs, or set fail-fast: false while investigating so every variant reports a real result.

Answer: Windows with Node 22 failed and fail-fast canceled Windows with Node 24; investigate Windows first and consider fail-fast: false while debugging.

Artifacts and logs in the UI and API

The second subgroup is short: locate workflows, logs and artifacts in the UI and through the API, and download and manage artifacts. In the UI, artifacts appear at the bottom of a run's summary page, and logs can be downloaded per job or for the whole run as an archive. Through the REST API, you can list a repository's workflow runs, download a run's logs, list and download artifacts, and delete them. The GitHub CLI wraps the same operations: gh run list, gh run view with the log option, gh run download and gh run rerun.

Artifacts are scoped to a run. A later job in the same run downloads them by name with the download action. A different workflow can download them too, given the run ID and a token with permission to read Actions in that repository. Artifacts expire after their retention period; once expired they cannot be recovered. The current major version of the artifact actions uploads artifacts that are immutable after upload, so two jobs cannot both upload to the same artifact name in one run: give each a unique name, such as one per matrix variant, and merge them later if needed.

Templates, reusable workflows and composite actions

The third subgroup is where many candidates mix up terms, and the outline addresses it directly: it asks you to distinguish starter workflows from reusable workflows from composite actions.

Three ways to reuse automation, and how they differ.
Starter workflow (template)Reusable workflowComposite action
What it isA file copied into a repository as a starting pointA workflow other workflows call with jobs.<id>.usesAn action whose runs are a list of steps
After useIndependent; changes to the template do not reach copiesCentral and versioned; callers get updates by refCentral and versioned; callers get updates by ref
GranularityWhole workflowOne or more whole jobsSteps inside a caller's job
Can containAnything a workflow canJobs, runners, environments, secrets passed inSteps only; no jobs or runner choice
Where it livesworkflow-templates in the organization .github repositoryAny repository the caller can accessAny repository with an action.yml

Organization templates live in a workflow-templates folder in the organization's .github repository, each with a properties file giving its name, description and icon. Since September 2025, templates can come from a non-public .github repository and still be offered to the organization's members, which the outline names explicitly. A template may use the $default-branch placeholder, which is replaced when it is copied. Tidewater kept its node-ci template in its .github repository beside the shared reusable workflow it calls.

Three columns. Starter workflow: a template file is copied into three repositories, and each copy then changes independently. Reusable workflow: three repositories each call one central workflow at a version tag, and an update to the central file reaches them all. Composite action: one action is used as a step inside jobs in three repositories.
A template is copied once; a reusable workflow and a composite action are called each time.

Disabling versus deleting

The last bullet in the domain asks you to contrast disabling and deleting workflows. Disabling a workflow, from the Actions tab or with the API or gh workflow disable, stops it from being triggered while keeping the file and the run history. It can be enabled again at any time. Deleting the workflow file from the repository removes it from the default branch; its past runs remain in the history until they are deleted, but the workflow no longer runs from that branch. Disabling is the right choice for a temporary pause, such as a noisy scheduled job during an outage. Deleting is right when the workflow is truly retired. GitHub also disables scheduled workflows automatically in public repositories after 60 days without activity.

Getting more detail from a run

When the normal log is not enough, there are two extra levels of logging. Step debug logging adds detailed output from the runner and from actions that write debug messages; it is turned on by setting a secret or variable named ACTIONS_STEP_DEBUG to true, or by ticking the debug option when rerunning jobs. Runner diagnostic logging, turned on with ACTIONS_RUNNER_DEBUG, adds the runner's own process logs to the downloadable log archive. Both are for diagnosis and are usually switched off again afterwards because they make logs long. An exam question that asks how to see more about why an action behaves strangely, without changing the workflow file, points to rerunning with debug logging.

Annotations are the other quick source. Errors and warnings written with workflow commands, or produced by problem matchers, appear on the run summary and, when a file and line are given, beside the code in the pull request. Reading annotations first often saves scrolling through a long log.

Priya's advice on logs was simple: read the run summary, then the annotations, then the failing step, and only then the full log with debug output. Each level costs more time than the one before, and most failures are explained at the first or second. On the exam the same order applies to the evidence a question shows: start with what the summary or annotation says before reading a long excerpt line by line.

Common mistakes

  • MistakeStarting at the last error line in a long log.

    InsteadFind the first step and the first line that failed; later errors are often consequences.

  • MistakeTreating canceled matrix jobs as failures.

    Insteadfail-fast cancels running jobs when one fails; only the failed job tells you about a real problem.

  • MistakeCalling a starter workflow and a reusable workflow the same thing.

    InsteadA starter workflow is copied once; a reusable workflow is called by ref every time.

  • MistakeDeleting a workflow to pause it.

    InsteadDisable it; deleting removes the file from the branch.

That evening Lena retook only the troubleshooting questions from her practice assessment review, this time writing the five method questions in the margin before choosing an answer. Her error log showed the change at once: the misses that remained were details she did not know, not evidence she had misread.

Summary and key terms

  • Troubleshooting is 15 to 20 of the exam and is mostly about reading evidence accurately.
  • Ask in order: did it run, which job and step failed first, is it every variant, what is the first error, what changed.
  • Set up job shows the image version, token permissions and action refs.
  • Fork pull requests get no secrets and a read-only token by design.
  • fail-fast cancels other matrix jobs; rerun failed jobs individually.
  • Starter workflows are copied; reusable workflows and composite actions are called by ref.
  • Disable to pause a workflow; delete the file to retire it.
Run attempt
One execution of a workflow run; each rerun creates a new attempt.
Annotation
An error or warning attached to a run, shown on the summary page.
ACTIONS_STEP_DEBUG
A secret or variable that turns on debug messages in step logs.
Starter workflow
A workflow template copied into a repository and then independent.
Workflow template
An organization's starter workflow stored in the .github repository's workflow-templates folder.
Disabled workflow
A workflow that keeps its file and history but cannot be triggered until enabled.

Practice problems

Work each problem on paper first, then reveal the answer to check.

  1. Which log section shows the token permissions a job received?

    Show answer

    Set up job.

  2. Why might a scheduled workflow in a quiet public repository stop running?

    Show answer

    GitHub disables scheduled workflows after 60 days without repository activity.

  3. How can you rerun only the matrix job that failed?

    Show answer

    Use Re-run failed jobs or rerun that single job from the run page.

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz