Fistron docs

fistron.io

Find out why a CI job failed

Fistron answers “CI failed. Why?” with a root cause analysis (RCA): a classification, a probable root cause and a recommended action, every claim citing the evidence it rests on. When the evidence does not settle it, Fistron says insufficient evidence and lists what is missing. That is a valid answer, not an error.

A case is a directory with the failed job’s log and a case.toml that binds it to its platform (repository, run, job, commit, pull request). Fistron imports it from the job’s URL.

Before you start

In CI, automatically

When your administrator has added Fistron’s CI files (admin-repositories.md), every failed run is analysed for you:

With a control plane configured, the reports are also uploaded to the project: open Documents and look for the kind rca.

In the local UI

  1. Open Operations and choose analyze.
  2. Paste the failed job’s or build’s link into the url field, for example https://github.com/acme/shop/actions/runs/1001/job/5001 or a Jenkins build https://jenkins.example.com/job/acceptance-tests/157/, leave the case directory empty and click Run. Fistron imports the case first, as case-import does, into cases/<the link's path> (cases/acme-shop-actions-runs-1001-job-5001), then analyses it (ADR 0138). By default the reasoner is auto (the model of the role reasoner when there is one, else the rules), Fistron looks up once what the analysis lacks and reasons again, and the report goes into the case (<case>/report).
  3. On the run’s page, under the documents it wrote, open report.json. The first step of its reconciliation says where the case was imported.

To share the answer with your pull or merge request or a colleague, open Share it under it (use-my-growth.md).

A case you already have (imported before, or files you collected) is analysed by entering its case directory and leaving the url empty. Run the same link again and the case is analysed again, not imported again; to import it anew, give another case directory or use case-import, which also binds a merge or pull request and a Kubernetes location.

The same on the command line:

fistron analyze https://github.com/acme/shop/actions/runs/1001/job/5001 \
    --reasoner llm --config fistron.toml --acquire --report-dir reports/shop-5001

or in two steps, with the case where you want it:

fistron case import https://github.com/acme/shop/actions/runs/1001/job/5001 \
    --config fistron.toml --output private-cases/shop-5001
fistron analyze private-cases/shop-5001 --reasoner llm --config fistron.toml \
    --acquire --report-dir reports/shop-5001

--acquire lets Fistron read missing evidence live and read-only from what the configuration allows (the platform, Kubernetes through a read-only MCP server); in the UI and the control plane it is on by default. The report directory gets report.json, report.md and a self-contained report.html.

On the command line, a build whose tests failed gets every cause of it: its failed tests in groups, and a cause for each, with the questions asked in the terminal (--no-input in CI), as fistron causes analyze does (Investigate a failed build); --feature and --test narrow it, --max-rounds and --max-acquisitions are each cause’s budget, and report.json is the causes report (report: build_causes). A job that stopped before its tests, or --single, gets one RCA of the whole case, the report of before (report: rca): keep --single in scripts and CI jobs that read that report.

What the analysis may look up (ADR 0110): the files the model asks for from the pipeline’s repository, from the repositories the build cloned (with [acquisition.github] build_sources = true) and from the project’s own sources; the last successful build of the same job (Jenkins, GitHub Actions, GitLab). On Jenkins, when tests failed, the baseline is the newest build where those tests passed, even if that build failed for other tests. A file of the cloned repositories that an error of the log names (OpenTofu’s and Terraform’s on <file> line <n>) is asked for even when the model does not ask for it. A file is read at the revision the build checked out when the build names it (its parameters, the git plugin, HEAD is now at <sha> in its log), so a branch deleted after its merge still reads; a path the test report gives relative to the test suite (features/step_definitions/...) is found in the repository’s folder that holds it. When the build ran from a fork’s branch that is gone (merged and deleted), the file is looked for where the branch went, in this order: the build’s revision in the fork’s parent (the code host names it; else a readable repository of the same name); the pull request whose head was that branch, whatever its state, at its head and then its merge commit; the parent at the branch, else at its default branch. A file read from the merge commit or a branch is marked “not the build’s exact revision: line numbers may differ”, so the analysis matches it by the step’s text or the function’s name. Each attempt (repository, ref, path and the answer) is in the evidence. Only then are you asked, once for all the files the same attempts missed, saying which steps failed: the commit or branch the build ran them from, or the files. The test code a failed test’s backtrace runs through (the step’s definition and the helpers it called, not a library’s) is read from those repositories before the analysis forms a first hypothesis, so it can say on which host a failing command ran instead of assuming the test controller. What a failed test expects of the deployment and did not find (a command missing where a step runs, a database user or role that does not exist) is looked up by its name in the same repositories (the code host’s search), so the file that installs a host’s packages or creates the users is read and compared with the test; a mismatch is a cause in the test or the deployment, not in the product. Add the deployment’s repository to the project’s Analysis sources for it to be searched. What it could not read is listed under Looked up, not read with why: the setting that is missing (build_sources = true, no [acquisition.github]), or that the analysis concluded before asking for it. A baseline that does not exist (the job keeps no successful build) is a fact there and in the report’s missing evidence, not an open request, and the recommendation says how to keep one.

What the analysis cost: a run of the local UI shows Model calls: the calls, the tokens in (and how many the provider’s cache served) and out, the cost when the endpoint has its prices (price_in, price_out), and about how many tokens the whole case would have been, pasted into a model (ADR 0148). A case the rules answer makes no call. The model gets the logs with their repeated lines and passing tests folded, each fold said where it happened; a line with an error is never folded, and the case keeps the whole log. When the folded lines could change its answer, the model asks for them and the next round shows them in full; the report’s steps say which. A project can switch this off in [llm.techniques] (llm-configuration.md).

The same failure again: give the analysis a directory of earlier analyses (--reuse <dir>, the field reuse of the operation’s options), for example the directory your CI keeps its report.json files in. When the failure’s signature (its error signals, failed tests and failed command, with numbers, ids and times masked) is that of an earlier concluded analysis of another run, that analysis is reused: no model is asked, and the report names the earlier one, when it was made and the evidence of this run that matched. A failure with one signal more or less is a different failure and is analysed afresh.

On GitHub Actions (ADR 0127):

In a control plane

  1. Open the project’s Work page and click Start an operation.
  2. Choose analyze, paste the job’s or build’s link into the url field, leave the case directory empty and click Start. The work goes to an agent that reaches the link (a Jenkins build: the agent with that Jenkins), imports the case into cases/<the link's path> and analyses it; the defaults use the project’s model, look up what is missing once, and write the report into the case. Fistron’s configuration comes from the agent’s (Configuration of the agent, its [acquisition]).
  3. A case already on that agent (from case-import): start analyze with its case directory and no url.
  4. On the work’s page, open the report under Documents written. The report shows Looked up, not read, the Baseline (found, with a link to its run, or not and why) and the Reconciliation: each round, what was missing, what read it and the evidence it added.

For a flaky test on GitHub Actions, the Flaky tests page does both steps with one click, Analyze the newest failure (Handle flaky tests and quarantine).

Name the repositories an analysis may read

An analysis reads the run’s own code and, with [acquisition.github] build_sources = true, the repositories its build cloned. When a failure lives in code the build does not clone (the Terraform modules a pipeline deploys with, a private library), an admin of the project names it once:

  1. Open the project’s Analysis sources page (under the project’s settings) and click Name the sources.
  2. Under Repositories of code, enter them one a line: owner/name for GitHub, gitlab:group/project for GitLab (gitlab.com, or the GitLab of the agent’s configuration, a self-hosted one too), or the repository’s address; @ref after it for a branch, a tag or a revision.
  3. Under Repositories of documentation, the work’s wiki or runbooks, written the same way: an analysis reads them for how the work is done. A file you upload (a runbook as a PDF) belongs on Documents.
  4. Click Save the sources. The table lists each with where it is, what it holds and who added it, and under it each source as the agent’s own tokens read it: one it does not read says what it lacks (a GitLab project not in [acquisition.gitlab] projects, a token that does not reach it).

The project’s agents read them only when their configuration accepts them ([agent] control_plane_sources = true, agent.md), with their own tokens, for a build on any CI: a Jenkins build reads a GitLab source too. A report names the source of each file it read, its kind and who added it; when the agent does not accept them, the analysis says so.

From a log you paste or upload

When Fistron cannot read the job itself (a Jenkins without an agent in its network, a job of another team, a log someone sent you), give it the log.

  1. Open Analyze a CI log: in the Guide panel on a project’s page, on the project’s Work page, or on Runs in the local UI.
  2. Paste the job’s console output into The log, or choose a file. Remove passwords and tokens first: the log is kept as you give it.
  3. Optionally fill in What it is a log of, for example acceptance tests, build 1234.
  4. Choose the reasoner: the model of the role reasoner, or the rules.
  5. Choose How sensitive it is: Public, Internal (the default) or Confidential. A model receives the log only when its endpoint is allowed that class of data (Configure models (LLM endpoints)).
  6. Click Analyze the log. The work (the run in the local UI) opens; when it has succeeded, open report.json among its documents. The log is kept beside it as ci-log.json.

Of a log longer than 5,000,000 characters, its end is analysed and the form says how many lines were left out.

When the log names the code its run ran on GitHub (a Jenkins pipeline from SCM: Obtained <script> from git https://github.com/…, Checking out Revision …, the files [Pipeline] load read), Fistron reads that script and those files at that revision, if the agent’s configuration allows the repository ([acquisition.github] repositories). The report then cites them. Nothing else is read from a platform: the report lists what is missing (the test report, the change), which an import by the job’s URL would add.

On the command line:

fistron analyze-log console.txt --name "nightly #301" --reasoner llm \
    --data-class internal --config fistron.toml --output logs/nightly-301

- instead of the file reads the log from standard input.

See every group of failures first

A build that failed many tests often fails for several causes, and some tests fail only because an earlier one did. In the GUI, all of this is Investigate a failed build. Before an RCA, see the groups:

fistron causes groups https://jenkins.example.com/job/acceptance/185/
fistron causes groups <link> --feature salt_ssh      # only your part of the suite

It reads the build’s test reports alone (Cucumber JSON with each step’s duration, else JUnit), uses no model and writes <case>/.causes/causes.json:

Part Says
Groups the failed tests with one error signature (the error without numbers, times and addresses) and one failed step: one cause, as far as the rules can tell
Cascades tests that failed within a second after an earlier test of their feature failed: most likely they miss the state it makes, so investigate that test first
After the first cause is fixed cascades with an error of their own: they may still fail once the first cause is fixed
Signals what the error and the durations say: exit 127 (a command missing where it runs), another protocol on a port, a round timeout (30, 60, 120 s), a failure within seconds, an empty value

A link is imported as a case first, as analyze imports it; a case directory is read as it is. Your coding assistant has the same as the tool failure_groups (Use Fistron from your coding assistant).

A cause for each group

fistron causes analyze https://jenkins.example.com/job/acceptance/185/
fistron causes analyze <link> --test "Bootstrap with salt-ssh"    # one group of yours

Each group gets one RCA of its own tests and the cascades that follow them, with the model of the role reasoner (else the rules) and the evidence it may look up, as analyze does. Under each group:

Line Says
cause the classification, the layer to fix it in (test, pipeline, infrastructure, product), static (from the build’s files and the code and configuration read) or verified (from the environment read live), the confidence and the cause
do the recommended action
the claims each with where its evidence is (file:line)
insufficient evidence what is missing to decide; the other groups still get theirs

Nothing to set: each cause may take 6 rounds of reasoning and looking up and 12 files, and the first 10 groups get one. Change them when you need to: --rounds 1-6, --files 1-30, --max-causes 0-100. --reuse <earlier causes.json> takes the cause of a group an earlier report explained (the same error and step), so a failure already explained costs nothing; --no-acquire reads only the build’s files.

Two more for a long build. --max-tokens <n> is a budget of the model’s tokens, in and out, for the whole investigation: once it is spent no further group is started, and the report says how many groups were left and what was used; a cause that was started is finished. --first <test> (repeat it) names the tests to look at first, each by its name or a part of it: a group with such a test is analysed before the others, so the budget goes where you want it.

A cause in the product is checked against the history of the product’s files it cites: when the file was changed on purpose (its commit says security, or a removal or deprecation with the bug it is for), the cause says Not a product bug, names the commit and asks to adapt the test or its configuration, never to revert the change. Without that history (no repository file cited, or no access to it) the cause says it was not read.

The coding assistant’s analyze_ci_failure gives the same report for a build whose failed tests fall into groups (ADR 0162).

Who changed a file, and why

fistron causes history shop/chart values.yaml --ref release-5.1 --search "port: 5432"
fistron causes history group/project path/to/file --platform gitlab

The file’s newest commits through GitHub or GitLab (read-only; the repository on the configuration’s allowlist, [acquisition.github] repositories or [acquisition.gitlab] projects): their authors, the bugs their messages name and the words that say a change was made on purpose; with --search, the commit that removed the string. Who changed a file comes from here, never from a header or a comment in it. The assistant’s tool is file_history.

When the analysis needs you

A cause that Fistron could not conclude, or that names what it lacks, asks a person one concrete question at a time: run a read-only command where the job failed and paste its output, attach a file, run the failed job again, or give the agent a source. Each question says why it is asked and what its answer decides; open it to read it whole. An experiment only you can run (on the system under test, in a container, with the key a service uses) gives the command to copy and says Where to run it for your deployment and how to check you are in the right place, what to check First make sure, and Another answer that serves as well. A command that changes something is never asked.

Before it asks, Fistron reads what your answers and the context you stated show, whole: it searches the code it reads for a message, a banner or an error they show, or a failed step’s words, and it reads the file of the case’s sources that installs a path they show on the system (/etc/motd there is a file whose path ends with etc/motd, an image’s root). What you gave is evidence the analysis never contradicts nor lists as missing, and an experiment you ran in the same environment supports its cause.

In a terminal, fistron causes analyze asks right away. Paste the output and end with a line ., type file <path>, or skip; the group’s cause is then looked for again with your answer. With --json or --no-input (in CI) the report ends with the open questions; answer them later:

fistron answer <case-directory> --question g1-0e3789c5 --file pods.txt
fistron answer <case-directory> --question g1-0e3789c5 --skip

An answer is evidence from “a person, ,

In the local UI and on a control plane’s agents the analysis is the work causes-analyze: it writes the report as a document of the workspace (<case>/report/causes.json, kind build_causes) and ends, its open questions waiting in the report for 24 hours. The work causes-answer answers one of them (or skips it) and looks for that cause again. It may run on another agent: the case is imported again from the report’s build, and the earlier answers come back from the report, with who gave them and when.

The failed step, the test’s history and the work already open

fistron causes step features/install.feature:12 --checkout ~/suite
fistron causes test "Install the server" --history containers.json --history k8s.json
fistron causes open-work shop/chart --file values.yaml --test "Install the server"

The assistant’s tools are step_source, test_history and open_work.

Fix it: the test or the code

After fistron causes analyze, with the repository checked out at the build’s revision:

fistron causes repairs <case> --repository . --output fistron-repair
fistron causes fix <case> --repository . --verify "pytest {tests}" --output fistron-fix

Both need the licence feature repair and the closed core. In CI, Fistron does this by itself after the analysis (ADR 0171).

Read the report

Part Says
Status concluded, or insufficient_evidence
Classification and Confidence the kind of failure, and how sure
Probable root cause the cause, when one is supported; in a file that was read, with its lines (pipeline.groovy:143-152)
Recommended action what to do; for a cause in a file, the change to make there
Missing evidence what would change or confirm the answer
Reasoner rules or the model that answered (llm:<endpoint>/<model>)
Claims each statement with the ids of the evidence it cites
Evidence gaps what is missing, sometimes with a command to obtain it
Evidence the log lines, files and API answers that were read

With several reasoner endpoints, or --consensus N, only a unanimous answer is accepted; otherwise the result is insufficient evidence.

Troubleshooting

Symptom Cause and fix
Analyze the log answers 403 You need the role Engineer in the project.
“… is a link; give it as url” The link was entered as the case directory: put it into the url field and leave the case directory empty.
“… importing it needs Fistron’s configuration” An analysis of a link needs the configuration with [acquisition]: enter it under the options’ config (on an agent, the agent’s own is used).
“… a pull or merge request” analyze takes a failed job or build; a change is assessed by assess-change.
The import is refused The URL must be a job on the configured platform, without credentials, query or fragment, and its repository on the allowlist.
The output directory is refused It must be a new directory that does not exist yet. Inside a git work tree it must be ignored by git.
The GitHub job is refused Only failed jobs (failure, timed_out) are imported.
A truncated or refused log The log exceeds the size limit (max_bytes on GitLab, max_artifact_bytes on GitHub): raise it in the configuration.
The report says the model failed and names the rules reasoner The endpoint was unavailable; the CI job falls back to rules. Check the endpoint.
Evidence is listed as missing although the log has it The endpoint’s data class is below the evidence’s: see Configure models (LLM endpoints).
In GitLab CI, the job’s log cannot be read Use a project access token with read_api; the CI job token cannot read job logs.
No pods or events in the report of a deployment Run Fistron before your teardown stage, or in the failing job’s after_script (ci-job.md).

Details: ci-job.md, acquisition.md, github.md, gitlab.md.