Skip to content

error: fork/exec /bin/sh: argument list too long #285

@glennpratt

Description

@glennpratt

What happened?

Running pulumi up on an existing stack on Linux fails.

Poking at the code, I see this is because of PULUMI_COMMAND_STDOUT/PULUMI_COMMAND_STDERR and the previous run containing rather long output.

if out.Stdout != "" {
cmd.Env = append(cmd.Env, fmt.Sprintf("%s=%s", util.PULUMI_COMMAND_STDOUT, out.Stdout))
}
if out.Stderr != "" {
cmd.Env = append(cmd.Env, fmt.Sprintf("%s=%s", util.PULUMI_COMMAND_STDERR, out.Stderr))
}

Since I don't use this feature and I don't always have the option of adjusting limits, I'd like an option to turn it off. Furthermore, I'd prefer if the option could be made off by default as well, as I don't generally need this information in state files.

Example

strace

sudo -E strace -E PATH=$PATH -u $USER -f -e trace=execve -s 1000 -v --signals=SIGPWR pulumi up 2> log

From log above, we can tell our command is not particularly long, the environment is massive.

execve("/bin/sh", ["/bin/sh", "-c", "ansible REDACTED"], ["SHELL=/bin/bash", ...REDACTED..., "PULUMI_COMMAND_STDOUT=ansible-playbook [core 2.14.6]\n  config file REDACTED"...]) = -1 E2BIG (Argument list too long)

Output of pulumi about

CLI
Version      3.75.0
Go Version   go1.20.5
Go Compiler  gc

Host
OS       ubuntu
Version  20.04
Arch     x86_64

Backend
Name           REDACTED
URL            file://~
User           REDACTED
Organizations

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

Metadata

Metadata

Assignees

Labels

good-first-issueStart here if you'd like to start contributing to Pulumihelp-wantedWe'd love your contributions on this issuekind/bugSome behavior is incorrect or out of specresolution/fixedThis issue was fixed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions