Skip to content
Latchkey

Pulumi "Running program ... failed" language runtime error in CI

Pulumi ran your program with the language runtime and it raised an unhandled exception before finishing. The wrapper line is generic; the real error is the traceback printed just above it.

What this error means

A pulumi up or pulumi preview step ends with "error: Running program '/path' failed with an unhandled exception:" followed by a language-specific stack trace.

pulumi
error: Running program '/home/runner/work/app/app' failed with an unhandled exception:
    <ref *1> TypeError: Cannot read properties of undefined (reading 'id')
        at /home/runner/work/app/app/index.ts:14:31

Common causes

A bug or unset config in the program

The program dereferenced something undefined, read a missing config value, or threw for another reason during resource registration.

Missing dependencies masked as a runtime error

A dependency was not installed, so an import or require inside the program throws at load time.

How to fix it

Read the traceback above the wrapper line

  1. Scroll up to the first exception line and file:line reference.
  2. Fix the code path or supply the missing config value.
  3. Install dependencies first if the error is an import failure.

Supply required config for the stack

If the program reads config that is unset in CI, set it (secret if sensitive) so the program does not throw.

Terminal
pulumi config set app:apiUrl https://api.example.com

How to prevent it

  • Install dependencies before Pulumi so imports resolve.
  • Provide all required stack config values in CI.
  • Validate config early in the program with clear error messages.

Frequently asked questions

What causes ""Running program ... failed""?
The program dereferenced something undefined, read a missing config value, or threw for another reason during resource registration.
How do I fix "Running program ... failed"?
Read the traceback above the wrapper line

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card