Documentation

39.6 Exit code 4: invalid settings

39.6 Exit code 4: invalid settings

What you will learn

  • Separate TOML syntax, schema, semantic, and cross-field validation
  • Use templates and exact command extensions
  • Migrate settings without silently changing meaning

Prerequisites: Chapter 36 exit-code reference, Chapter 38 output completion, and the Chapter 39 overview.

This page describes nlmx 4.16.2. Troubleshooting must preserve the failed attempt: keep its exact command, working directory, log, resolved settings, input/model identities, partial outputs, and process exit code. Correct one causal condition at a time and compare the new evidence with the failed run. Never convert a nonzero exit into success in a wrapper, and never interpret exit 0 as scientific acceptance without the command-native verdict.

Exit 4 means a settings document or resolved configuration is invalid. Work in layers. First, TOML must parse: quotes, brackets, arrays, table headers, and duplicate keys must be correct. Second, the schema must recognize every key and type. Third, individual values must satisfy ranges/enumerations. Fourth, cross-field rules must hold—for example a method may require learners, covariance information, an ETA-bearing parameter, or compatible resampling choices.

Generate a fresh template from the same executable and command. Compare your file against it by dotted key, not visual position. Command-specific extensions are intentional (.covar, .qcd, .qcn, .eda, .custom, .report, .nca, .init, .screen, .vpc, .forest, .sims, .er, .gen, .ask). A wrong extension can indicate the wrong schema; rename only after confirming the content belongs to that command.

Unknown keys are not harmless comments. They can be old-version keys, typos, or a file for another command. Invalid ranges are also not an invitation to relax a guardrail. Determine why the requested value exists and whether its meaning/default changed between versions. For migrations, freeze old/new executable versions, templates, resolved settings, and a controlled comparison result.

CLI overrides can make a valid file resolve into an invalid combination. Record the complete command, not just the file. After repair, retain the effective settings written by nlmx and diff them against the failed attempt. The acceptance question is whether the intended method/population/numerics remained the same, not merely whether TOML parses.

Page checklist

  • Did you retain the exact exit code, stage, message, hint, log, and partial output?
  • Did you identify one causal layer before changing anything?
  • Is the recovery a new, traceable attempt with the same intended estimand?
  • Did you check command-native and scientific acceptance after process completion?

See the previous page, next page, and complete error reference.