Troubleshooting
These messages were reproduced with the lmscript compiler used by the documentation checks. Save the linked failure scripts under examples/ first. The commands below set --source-name to reproduce these exact labels; without it, the diagnostic uses the supplied path. Source names and line numbers are part of each diagnostic.
GitHub tool installation failures
An LMCode block with cli and install may need to download a host binary from a GitHub release. The first diagnostic line keeps the legacy _dsl_ install prefix; the indented lines explain the failure and possible remedies.
_dsl_: install github:lmctl-ai/lmmagnum@latest: GitHub API rate limit exceeded (HTTP 403) Unauthenticated GitHub API calls are limited to 60 requests per hour per IP. Rate limit resets at the local time shown by your host (in about N minutes). x-ratelimit-remaining: 0; resource: core Remedies: set GITHUB_TOKEN to any token; pin an exact tag; or retry after the reset. Verified cached binary: not available; the install cannot continue without a usable cached binary
When the GitHub API reports a rate limit, set GITHUB_TOKEN to any valid token; no scopes are needed, and gh auth token prints a token for an authenticated GitHub CLI. Or pin the install source to an exact release tag such as github:lmctl-ai/lmmagnum@v0.1.0. A pinned host already in the verified tool cache needs no release lookup. Retrying after the displayed reset also works. A verified cached binary is used after a transient lookup failure; the diagnostic says whether one was available.
A 403 that is not a rate limit includes GitHub's response text, for example abuse detection or organization access restrictions. For 404, check the public owner and repository spelling and that a release exists; private repositories also return 404 without GITHUB_TOKEN. For 401, replace an invalid or expired GITHUB_TOKEN. Never share the token value.
Download errors name the asset and URL. A checksum error reports the expected and downloaded SHA-256 values; ask the tool owner to verify the published asset and digest, and do not bypass the check. Network errors name the URL and suggest checking network access, DNS, proxy and firewall. Release assets are downloaded as binaries directly; archive extraction is not part of install=.
If the platform is unsupported, use a Linux, macOS or Windows x64 or arm64 host, or ask the tool owner to publish the expected platform asset.
Unknown name: check spelling or assign it first
lmscript --source-name undeclared-name.lms examples/undeclared-name.lms
This command prints this exact compiler error and exits with code 2:
error:undeclared-name.lms:1:9: Undeclared variable 'greet'
The program refers to greet without defining it. Define the function or value before use, or correct the spelling.
Missing map key: use has or get
lmscript --source-name missing-map-key.lms examples/missing-map-key.lms
This command prints this exact runtime error and exits with code 1:
error:missing-map-key.lms:2:16: map record has no key "email"; test with record.has("email") or read record.get("email", default)
When a key is optional, check it first with record.has("email") or use record.get("email", "not provided") to supply a default.
Failed require: fix the condition or input
lmscript --source-name failed-require.lms examples/failed-require.lms
This command prints this exact runtime error, followed by an error summary, and exits with code 1:
error: score must be positive === LMScript Error Summary (1 error) === 1. score must be positive ==========================================
require stops the script when its first argument is false. Check where score comes from and whether zero or negative values need their own behavior.
Example scripts
The failure examples are intentionally invalid and are run by the documentation checker with a stable source name. See the exact source and expected output here:
Start with the quick cheat sheet for common forms and safe defaults, or see the user guide error reference.