Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc change: Added troubleshooting section for knife search #8724

Merged
merged 4 commits into from
Jan 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions components/docs-chef-io/content/automate/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,46 @@ max_shards_per_node = 1000
```

Once done, run the chef-automate config patch `</path/to/your-file.toml>` to deploy your change.

## Issue: Knife search limits at 10000 records

### Details

The knife node list and knife node search commands are inconsistent in the number of records they return. By default, knife search returns a maximum of 10,000 records.

### Fixes

This issue occurs because OpenSearch, by default, limits the maximum number of records (or documents) returned in a single query to 10,000. This safeguard prevents large queries from overloading the system. This approach will do that if you try to retrieve more than 10,000 records.

#### Step 1: Increase the max_result_window to retrieve more than **10000** records.

In the case of embedded opensearch:

```bash
curl -XPUT "http://127.0.0.1:10144/chef/_settings" \
-d '{
"index": {
"max_result_window": 50000
}
}' \
-H "Content-Type: application/json"
```

Changes can be verified by doing the following:

```bash
curl http://127.0.0.1:10144/_settings?pretty
```

For external OpenSearch, ensure the `max_result_window` is also increased accordingly.

#### Step 2: Patch the config in Automate

To set the value of tracking total hits in OpenSearch, patch the following configuration in the `.toml` file.

```bash
[erchef.v1.sys.index]
track_total_hits = true
```

Once done, run the chef-automate config patch `</path/to/your-file.toml>` to deploy your change.
Loading