Skip to content

Commit 697d168

Browse files
authored
docs: add troubleshooting pages and FAQ (#104)
## Summary - Extract 5 error-driven sections from the monolithic FAQ into individual troubleshooting pages with a consistent Error/Solution/Context structure - Restructure remaining FAQ content using Mintlify `AccordionGroup` and `CodeGroup` components - Add both Troubleshooting and FAQ pages to `docs.json` navigation - Boolean flags section kept as a `##` heading to preserve `#boolean-flags` anchor links from ~77 client_reference pages
1 parent 055db84 commit 697d168

8 files changed

Lines changed: 238 additions & 2 deletions

File tree

docs.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,19 @@
159159
"group": "Troubleshooting",
160160
"icon": "wrench",
161161
"pages": [
162-
"troubleshooting/what_do_i_do_if_kosli_is_down"
162+
"troubleshooting/what_do_i_do_if_kosli_is_down",
163+
"troubleshooting/docker_api_version_error",
164+
"troubleshooting/zsh_no_such_user",
165+
"troubleshooting/github_kosli_api_token",
166+
"troubleshooting/subshell_stderr",
167+
"troubleshooting/whitespace_path"
168+
]
169+
},
170+
{
171+
"group": "FAQ",
172+
"icon": "circle-question",
173+
"pages": [
174+
"faq/faq"
163175
]
164176
},
165177
{

faq/faq.md

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
---
2+
title: FAQ
3+
description: "Frequently asked questions"
4+
---
5+
6+
<AccordionGroup>
7+
8+
<Accordion title="Where can I find API documentation?">
9+
Kosli API documentation is available for logged-in Kosli users at [app.kosli.com/api/v2/doc](https://app.kosli.com/api/v2/doc/).
10+
You can also find the link at [app.kosli.com](https://app.kosli.com) after clicking your avatar (top-right corner of the page).
11+
</Accordion>
12+
13+
<Accordion title="Do I have to provide all the flags all the time?">
14+
A number of flags won't change their values often (or at all) between commands, like `--org` or `--api-token`. Some will differ between e.g. workflows, like `--flow`. You can define them as environment variables to avoid unnecessary redundancy. Check [Environment variables](/getting_started/install#assigning-flags-via-environment-variables) to learn more.
15+
</Accordion>
16+
17+
<Accordion title="What is dry run and how to use it?">
18+
You can use dry run to disable writing to `app.kosli.com` — e.g. if you're just trying things out, or troubleshooting (dry run will print the payload the CLI would send in a non dry run mode).
19+
20+
There are three ways to enable a dry run:
21+
1. Use the `--dry-run` flag (no value needed) to enable it per command
22+
2. Set the `KOSLI_DRY_RUN` environment variable to `true` to enable it globally (e.g. in your terminal or CI)
23+
3. Set the `KOSLI_API_TOKEN` environment variable to `DRY_RUN` to enable it globally (e.g. in your terminal or CI)
24+
</Accordion>
25+
26+
<Accordion title="What is the --config-file flag?">
27+
A config file is an alternative to using Kosli flags or environment variables. Usually you'd use a config file for values that rarely change — like api token or org — but you can represent all Kosli flags in a config file. The key for each value is the same as the flag name, capitalized, so `--api-token` becomes `API-TOKEN`, and `--org` becomes `ORG`, etc.
28+
29+
You can use JSON, YAML, or TOML format:
30+
31+
<CodeGroup>
32+
```json kosli-conf.json
33+
{
34+
"ORG": "my-org",
35+
"API-TOKEN": "123456abcdef"
36+
}
37+
```
38+
39+
```yaml kosli-conf.yaml
40+
ORG: "my-org"
41+
API-TOKEN: "123456abcdef"
42+
```
43+
44+
```toml kosli-conf.toml
45+
ORG = "my-org"
46+
API-TOKEN = "123456abcdef"
47+
```
48+
</CodeGroup>
49+
50+
When calling a Kosli command you can skip the file extension. For example, to list environments with `org` and `api-token` in the configuration file:
51+
52+
```shell
53+
kosli list environments --config-file kosli-conf
54+
```
55+
56+
`--config-file` defaults to `kosli`, so if you name your file `kosli.<yaml|toml|json>` and the file is in the same location as where you run Kosli commands from, you can skip the `--config-file` altogether.
57+
</Accordion>
58+
59+
<Accordion title="Reporting the same artifact and evidence multiple times">
60+
If an artifact or evidence is reported multiple times there are a few corner cases:
61+
62+
**Template** — When an artifact is reported, the template for the flow is stored together with the artifact. If the template has changed between reports, the last template is considered the template for that artifact.
63+
64+
**Evidence** — If a given named evidence is reported multiple times, the compliance status of the last reported version is considered the compliance state of that evidence. If an artifact is reported multiple times with different git-commits, the last reported version of the named commit-evidence is considered the compliance state.
65+
66+
**Evidence outside the template** — If an artifact has evidence (commit or artifact evidence) that is not part of the template, the state of the extra evidence will affect the overall compliance of the artifact.
67+
</Accordion>
68+
69+
<Accordion title="How to set compliant status of generic evidence">
70+
The `--compliant` flag is a [boolean flag](#boolean-flags).
71+
To report generic evidence as non-compliant use `--compliant=false`:
72+
73+
```shell
74+
kosli report evidence artifact generic server:1.0 \
75+
--artifact-type docker \
76+
--name test \
77+
--description "generic test evidence" \
78+
--compliant=false \
79+
--flow server
80+
```
81+
82+
`--compliant` is set to `true` by default, so to report as compliant simply skip the flag altogether.
83+
</Accordion>
84+
85+
</AccordionGroup>
86+
87+
## Boolean flags
88+
89+
Flags with values can usually be specified with an `=` or with a **space** as a separator.
90+
For example, `--artifact-type=file` or `--artifact-type file`.
91+
However, an explicitly specified boolean flag value **must** use an `=`.
92+
For example, if you try this:
93+
```
94+
kosli attest generic Dockerfile --artifact-type file --compliant true ...
95+
```
96+
You will get an error stating:
97+
```
98+
Error: accepts at most 1 arg(s), received 2
99+
```
100+
Here, `--artifact-type file` is parsed as if it was `--artifact-type=file`, leaving:
101+
```
102+
kosli attest generic Dockerfile --compliant true ...
103+
```
104+
Then `--compliant` is parsed as if *implicitly* defaulting to `--compliant=true`, leaving:
105+
```
106+
kosli attest generic Dockerfile true ...
107+
```
108+
The parser then sees `Dockerfile` and `true` as the two
109+
arguments to `kosli attest generic`.

labs/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ These labs provide a progressive, practical introduction to Kosli's core feature
99
Each lab builds on the previous one — complete them in order.
1010

1111
<Info>
12-
Want something shorter first? [Try Kosli locally](/tutorials/get_familiar_with_Kosli) is a 10-minute Docker-based demo that requires no GitHub account or CI pipeline.
12+
Want something shorter first? [Try Kosli locally](/tutorials/try_kosli_locally) is a 10-minute Docker-based demo that requires no GitHub account or CI pipeline.
1313
</Info>
1414

1515
<Info>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
title: "Docker API version error in GitHub Actions"
3+
description: 'How to fix the "client version 1.47 is too new" error when running the Kosli CLI in GitHub Action workflows.'
4+
---
5+
6+
## Error
7+
8+
```
9+
Error response from daemon: client version 1.47 is too new. Maximum supported API version is 1.45
10+
```
11+
12+
## Solution
13+
14+
Set the `DOCKER_API_VERSION` environment variable in your workflow:
15+
16+
```yaml
17+
env:
18+
DOCKER_API_VERSION: "1.45"
19+
```
20+
21+
## Context
22+
23+
The latest Kosli CLI defaults to Docker API version 1.47, but GitHub Action workflows currently support a maximum of 1.45.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
title: "GitHub can't see KOSLI_API_TOKEN secret"
3+
description: "How to make the KOSLI_API_TOKEN secret available in GitHub Actions workflows."
4+
---
5+
6+
## Error
7+
8+
Kosli CLI commands fail in GitHub Actions because `KOSLI_API_TOKEN` is not set, even though the secret exists in your repository.
9+
10+
## Solution
11+
12+
Add the secret to your workflow's environment variables explicitly:
13+
14+
```yaml
15+
env:
16+
KOSLI_API_TOKEN: ${{ secrets.kosli_api_token }}
17+
```
18+
19+
## Context
20+
21+
Secrets in GitHub Actions are not automatically exported as environment variables. You must map them explicitly in each workflow or job.

troubleshooting/subshell_stderr.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
title: "CLI in subshell captures stderr"
3+
description: "How to handle Kosli CLI debug output being captured in subshell variables in CI workflows."
4+
---
5+
6+
## Error
7+
8+
When capturing Kosli CLI output in a subshell variable in CI, the variable contains debug output mixed with the expected value:
9+
10+
```shell
11+
DIGEST="$(kosli fingerprint "${IMAGE_NAME}" --artifact-type=docker)"
12+
13+
echo "DIGEST=${DIGEST}"
14+
DIGEST=[debug] calculated fingerprint: 2c6079df5829...
15+
2c6079df58292ed10e8074adcb74be549b7f841a1bd8266f06bb5c518643193e
16+
```
17+
18+
## Solution
19+
20+
Explicitly set `--debug=false` when running Kosli CLI commands in a subshell:
21+
22+
```shell
23+
DIGEST="$(kosli fingerprint "${IMAGE_NAME}" --artifact-type=docker --debug=false)"
24+
```
25+
26+
## Context
27+
28+
The Kosli CLI writes debug information to `stderr` and all other output to `stdout`. In a local terminal, a `$(subshell)` captures only `stdout`. However, in many CI workflows (including GitHub and GitLab), `stdout` and `stderr` are multiplexed together, causing debug output to leak into captured variables.

troubleshooting/whitespace_path.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
title: "Path/Image name is a single whitespace character"
3+
description: "How to fix the whitespace path error when using multi-line Kosli CLI commands."
4+
---
5+
6+
## Error
7+
8+
```
9+
Error: failed to calculate artifact fingerprint: stat : no such file or directory. The directory path is ' '.
10+
```
11+
12+
## Solution
13+
14+
Check your multi-line command for extraneous whitespace after line-continuation backslashes (`\`). Remove any spaces or tabs after the `\` on each line.
15+
16+
## Context
17+
18+
When using multi-line commands, whitespace added after a line-continuation backslash is interpreted as the artifact path or image name argument.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
title: "zsh: no such user or named directory"
3+
description: "How to fix the zsh error when using arguments starting with ~ in Kosli CLI commands."
4+
---
5+
6+
## Error
7+
8+
```shell
9+
kosli list snapshots prod ~3..NOW
10+
```
11+
```plaintext
12+
zsh: no such user or named directory: 3..NOW
13+
```
14+
15+
## Solution
16+
17+
Wrap the argument in quotation marks (single or double):
18+
19+
```shell
20+
kosli list snapshots prod '~3..NOW'
21+
```
22+
or
23+
```shell
24+
kosli list snapshots prod "~3..NOW"
25+
```

0 commit comments

Comments
 (0)