Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Troubleshooting

Status: 🟢 The diagnostics here work today. ⚪ kargo doctor is planned.

First moves

kargo build -v          # full compiler command lines and resolution detail
kargo self info         # versions, paths, cache sizes
kargo env               # what the build sees (secrets masked)
kargo tree              # the resolved graph

-v is usually enough. It prints the exact kotlinc invocation, which turns "the build failed" into a command you can run yourself.

Toolchain problems

Kotlin 2.4.21 not found and no download starts

Either auto-download = false is set, or the network is unavailable.

kargo toolchain list
kargo toolchain install 2.4.21

JDK not found

Kargo checks [toolchain] jdk, then .kargo.env, then JAVA_HOME, then common paths — see Toolchains.

java -version
echo $JAVA_HOME
[toolchain]
jdk = "/usr/lib/jvm/java-25-openjdk"

Unsupported class file major version

Your java-target exceeds the JDK running your code. java-target = "25" needs a Java 25 runtime; lower it to what you deploy on.

Apple targets fail on Linux or Windows

Expected. Kotlin/Native cannot cross-compile to Apple platforms — you need a macOS host with Xcode.

Dependency problems

Could not resolve com.example:thing:1.0.0

In order of likelihood: a typo in the coordinate; the artifact lives in a repository you have not declared; or credentials are missing for a private one.

kargo tree                         # is it even in the graph?
kargo add com.example:thing:1.0.0  # verifies existence before writing
kargo env                          # are the credentials present?

The wrong version of a transitive dependency wins

Kargo uses Maven's nearest-wins rule, not Gradle's highest-wins. A direct declaration beats everything:

kargo tree --why some-lib
kargo tree --conflicts
[dependencies]
some-lib = "com.example:some-lib:2.0.0"

Checksum mismatch

The downloaded artifact does not match its published checksum. Usually a corrupted cache entry or a proxy mangling the response; occasionally something worse.

kargo self clean
kargo fetch --verify

--offline fails but a normal build works

Something is not in the cache. Run kargo fetch while online, then retry — this is exactly what --offline is for detecting.

Build problems

A stale build, apparently

Incremental compilation is supposed to be correct. Establish whether it is the cache:

kargo clean && kargo build        # clears fingerprints
kargo cache clean && kargo build  # clears the build cache too

If a clean build differs from an incremental one, that is a bug worth filing with both -v outputs.

Sources are not being compiled

Source discovery is by directory convention. A file in src/kotlin/ rather than src/main/kotlin/ is invisible. Check it against Project Layout, and confirm the target name matches the source set: ios-arm64 reads src/iosArm64Main/, not src/ios/.

kargo run cannot find a main class

[package]
main-class = "com.example.MainKt"

A top-level fun main() in Main.kt with package com.example compiles to com.example.MainKt — the Kt suffix is easy to forget.

This command is not yet implemented

The command is accepted by the CLI but not built yet. Check Implementation Status for where it sits.

Manifest problems

Failed to parse Kargo.toml

The message includes the line. The recurring causes are a bare value where a table belongs, and inline-table syntax spread across lines — TOML requires an inline table to fit on one line:

# Invalid
my-repo = {
  url = "https://example.com"
}

# Valid
my-repo = { url = "https://example.com" }

# Also valid
[repositories.my-repo]
url = "https://example.com"

package.version must be valid semver

version = "1.0" is not semver. Use 1.0.0.

Unresolved ${env:NEXUS_PASSWORD}

The variable is not in .kargo.env and not in the environment. This is an error rather than an empty string on purpose — see Secrets.

Performance

Every build recompiles everything

kargo build --timings
kargo build -v            # look for what missed its fingerprint

Common causes: .kargo/fingerprints/ is being deleted between builds (a CI cache that excludes it); a hook rewriting a source file on every run; a generated file with a timestamp in it, which changes its hash every time.

CI is slow

Cache ~/.kargo/toolchains, ~/.kargo/cache, and ~/.kargo/build-cache — see Continuous Integration.

kargo doctor

Status: ⚪ Planned.

kargo doctor
Checking project health

  ✓ Kotlin 2.4.21 toolchain installed
  ✓ JDK 25 found at /usr/lib/jvm/java-25-openjdk
  ✗ Android SDK platform 36 not installed
      run: sdkmanager "platforms;android-36"
  ! kotlinx-coroutines-core 1.8.0 is declared but never imported
  ! expect fun platformName() has no actual for target js
  ✓ Build cache healthy (2.1 GiB, 87% hit rate)

  1 error, 2 warnings

One command for the class of problem that is really an environment problem.

Getting help

Open an issue with:

  • kargo self info output
  • the failing command with -v
  • your Kargo.toml, with secrets removed
  • what you expected instead

Next