pulumi / pulumi-command

Apache License 2.0
64 stars 26 forks source link

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

Open gavindsouza opened 1 week ago

gavindsouza commented 1 week ago

What happened?

Running pulumi up -s dev -y fails when run consecutively. Although, if I change the resource_name, the build runs successfully.

Similar thread I found: #285

Example

build_image = command.local.Command(
    "build-service-image",
    create=(
    "buildah --signature-policy=policy.json build "
    f" --build-arg=FRAPPE_VERSION='{frappe_commit_sha}'"
    f" --build-arg=PYTHON_VERSION='{python_version}'"
    f" --build-arg=NODE_VERSION='{node_version}'"
    f" --tag='{image_name}'"
    " --jobs=4"
    " --file=Containerfile"
    )
)

publish_image = command.local.Command(
    "publish-service-image",
    create=(
        f"buildah login ghcr.io -u {os.environ['GITHUB_USER']} --password-stdin && "
        f"buildah --signature-policy=policy.json push {image_name}"
    ),
    opts=pulumi.ResourceOptions(depends_on=[build_image]),
    stdin=os.environ["GITHUB_PAT"],
)

Output of pulumi about

CLI
Version      3.137.0
Go Version   go1.23.2
Go Compiler  gc

Plugins
KIND      NAME     VERSION
resource  aws      6.58.0
resource  command  1.0.1
language  python   unknown

Host
OS       nixos
Version  24.05 (Uakari)
Arch     x86_64

This project is written in python: executable='/***/venv/bin/python' version='3.12.7'

Backend
Name           pulumi.com
URL            https://app.pulumi.com/***
User           ***
Organizations  ***
Token type     personal

Dependencies:
NAME            VERSION
pip             24.3.1
pre_commit      4.0.1
pulumi_aws      6.58.0
pulumi_command  1.0.1

Pulumi locates its logs in /tmp by default
warning: Failed to get information about the current stack: No current stack

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).

gavindsouza commented 1 week ago

btw, I'm not approaching this further, just thought I should report it nevertheless. I moved on to just continue using pulumi_docker_build library instead.

mjeffryes commented 1 week ago

Thanks for reporting this @gavindsouza you can work around this error in by setting addPreviousOutputInEnv = false, but I think at minimum we should keep this issue open to track improving the error message to suggest the workaround. (And even better if we can find a way to avoid the error altogether, though that might be challenging.)