# Investigate a bug

Turn a symptom into candidate files, then verify a concrete hypothesis.

Canonical page: https://ontlgy.io/docs/guides/investigate-a-bug/

**Scenario:** a service times out on some requests after a configuration change, and you do not yet know which code reads that setting. Use a repository you indexed for [the first query](https://ontlgy.io/docs/start/first-query/) and investigate without modifying it. Replace `OWNER/REPO` and the example vocabulary with names from your own repository.

## 1. Describe the behavior in code vocabulary

```text
Using ontlgy in OWNER/REPO, locate where the request timeout setting is read
and applied for outgoing calls. Read the relevant files and explain why some
requests might time out after the configuration change. Do not change
configuration yet.
```

A suitable `locate` call is:

```json
{"repo":"OWNER/REPO","task":"request timeout setting outgoing calls","limit":5}
```

## 2. Read and verify

Expect candidate files and symbols for the configuration loader and the code that uses the value. Ranking is not guaranteed, so treat these as places to read, not conclusions.

Check:

- Where is the setting read, and what is the default when it is unset?
- Is the value applied to every call path, or only some of them?
- Was the service restarted after the setting changed?
- Is the failing environment running the revision you are reading? Compare the indexed commit with the deployed one.

Open the cited files yourself. The index returns locations and relationships, not a verdict.

## 3. State a hypothesis and a check

A useful answer might be: “The outgoing client reads the timeout once at startup, so the running service still uses the old value. Verify the running configuration, restart the service and repeat the failing request.” That is a hypothesis until you inspect the running deployment.

For an unrelated bug, replace the example with names that appear in the repository. If `locate` abstains, try a more specific symbol name with `search` or inspect the source directly. Do not treat a search miss as evidence that the implementation is absent.

Next: [Assess impact before making a change](https://ontlgy.io/docs/guides/change-impact/).
