Skip to Content
Troubleshooting

Diagnose and fix the most common LATdx CLI failures.

Quick checks

Before drilling into a specific failure mode, run these to confirm the basics:

  • latdx --version to confirm the binary is on PATH.
  • latdx daemon status to see whether a daemon is running for the current workspace.
  • latdx cache status to size up workspace cache and temp state.
  • sf org list to confirm Salesforce auth and the default org alias.
  • latdx --version -o my-org to verify the org is reachable and the managed package is installed.

Daemon connection issues

WARNING

Errors mentioning socket/connect/request timeout, or test runs that hang on daemon connect.

The CLI talks to a per-workspace daemon over a Unix socket (or named pipe on Windows). Stale sockets, crashed daemons, or a corrupted workspace cache can leave the connection wedged.

Re-run with verbose output

Capture detailed diagnostics so the next steps target the real cause:

latdx test run -n MyTest -o my-org -v

Check daemon and cache state

latdx cache status

Clear daemon and cache artifacts

latdx cache clear --all

Retry the original command

Org mode can still fall back to direct core execution when the daemon fails, so the run will complete either way.

TIP

Each git worktree gets its own daemon. If only one worktree misbehaves, restart that worktree’s daemon with latdx daemon restart instead of clearing every workspace.


Org and package readiness issues

WARNING

Package not installed/outdated errors, or org alias resolution issues.

LATdx requires an authenticated org and the latdx-sf managed package (or a source install) to run org-mode tests.

Verify auth and the default org

sf org list

Pass an explicit org alias

latdx test run -n MyTest -o my-org

For list mode:

latdx test list -o my-org

Check package status quickly

latdx --version -o my-org

Verify source install inputs

If using source install mode, confirm LATDX_SF_SOURCE_PATH and the repo checkout point at a valid sfdx-project.json workspace.

TIP

Set a default org once with sf config set target-org=my-org and you can drop -o my-org from every command.


Debug log storage exceeded

WARNING

Error indicates debug log storage exceeded. Run stops before normal test results complete.

Salesforce caps ApexLog storage per org at 1 GB. Once full, no further test runs can write logs until the storage is reclaimed.

  1. Accept the CLI prompt to delete logs and retry when offered.
  2. If needed, rerun the command and confirm the cleanup prompt.
  3. Reduce repeated high-volume runs while diagnosing and use targeted test selection.
NOTE

In non-interactive environments (CI=true or non-TTY stdout) the CLI auto-deletes logs and retries instead of prompting. Set LATDX_AUTO_CONFIRM=true to force the same behavior in an interactive terminal.


Compilation and test failures

WARNING

Compile problems in output, or tests fail with stack traces or class/method errors.

These typically point at real Apex defects, but can also surface adapter or execution-strategy bugs. Narrow scope and switch strategies to isolate.

Re-run with verbose output

latdx test run -n MyTest -o my-org -v

Isolate execution strategy

Add --sequential to disable packed execution, or set LATDX_LATDB=off to switch from dbsim to full mode.

Narrow scope to one test method

latdx test run -t MyTest.testMethod -o my-org

Verify the file mode path contains test methods

If running in file mode, confirm the path exists and exposes Apex test methods:

latdx test list -f force-app/main/default/classes/MyTest.cls

Input validation errors

WARNING

Cannot use --class-names or --tests with --file or --dir

WARNING

Cannot use --method with --dir or org mode

The CLI enforces one input family per run so the daemon path and the in-process file path do not clash.

  1. Choose exactly one input family per run:
    • Org mode: --class-names or --tests (or no file/dir).
    • File mode: --file or --dir.
  2. Use --method only with --file.
TIP

latdx test list accepts the same input families. Use it to dry-run discovery before launching test run.


latdx: command not found

WARNING

latdx: command not found

The CLI ships as a platform-specific release binary; the shell needs to find it on PATH.

Install the CLI binary

Follow the steps in docs/user/cli-quickstart.md under Install the CLI Binary.

Open a fresh terminal session

So PATH updates from the install step are reloaded.

Verify

latdx --help

Bypassing the automatic FLS/OLS grant

WARNING

You manage latdx_TestRunnerAccess (or an equivalent permset) yourself and want LATdx to stop deploying it, or the running user lacks permission to deploy metadata on a tightly controlled sandbox and you see a warning like Test-runner access grant failed, continuing anyway: ....

The grant is best-effort: LATdx deploys and assigns a permset before each org-mode run. The opt-out env var is read at daemon startup, so the daemon must be restarted for the new value to take effect.

Stop the daemon

So the new env var is picked up on restart:

latdx daemon stop

Launch with the opt-out env var

LATDX_SKIP_TEST_RUNNER_ACCESS=1 latdx test run -o my-org -n MyTest

Make it persistent

If you need this consistently, export the variable in your shell profile so every daemon spawn inherits it.

NOTE

The grant is cached two ways: in-memory on the LatdxCore instance, and on disk at ~/.latdx/runner-access/<orgId>.json. With the cache warm, the grant step adds well under a second per run.

NOTE

If the org’s schema changes (custom object added/edited), LATdx detects the fingerprint change and regenerates the permset automatically on the next run. Deleting the org’s file under ~/.latdx/runner-access/ forces a full regenerate on the next run.


See also

Last updated on