Resolving "Argument list too long" errors in tracked runs

Last updated: September 9, 2025

If you encounter an error message like the following in your tracked runs:

Verification failed: a prerequisite is missing from the runner image: could not run 'ps' command: could not execute command: fork/exec /bin/sh: argument list too long

This error occurs when the total size of environment variables exceeds Linux system limits. The maximum size for environment variables is 128KB (131,072 bytes).

Common Causes

  • Very large environment variables

  • Large dictionaries or data structures passed as environment variables

  • Accumulation of many environment variables

Troubleshooting Steps

  1. Enable debug logging by setting the environment variable SPACELIFT_DEBUG to true in your stack settings

  2. Review your environment variables, particularly looking for:

    • Very large individual variables

    • Large data structures passed as environment variables

    • Redundant variables that could be consolidated

Solutions

To work around this limitation, consider these approaches:

  • Move large configuration values to tfvars files instead of environment variables

  • Split large data structures into smaller, more manageable pieces

  • Review and remove any unnecessary environment variables

  • Consider using alternative configuration methods for large data sets, such as external configuration files

This is a Linux system limitation and cannot be bypassed. The best approach is to restructure your configuration to stay within the 128KB limit.