Skip to content

!Rain::S3 Run directive doubles absolute template path #772

@allixsenos

Description

@allixsenos

Bug Description

When a template is passed to rain deploy as an absolute path, the !Rain::S3 Run directive produces a doubled path, causing fork/exec to fail with "no such file or directory".

Steps to Reproduce

  1. Template at /home/user/project/myapp/template.yml contains:

    Code: !Rain::S3
      Path: dist
      Zip: true
      BucketProperty: S3Bucket
      KeyProperty: S3Key
      Run: scripts/build.sh
  2. Run from /home/user/project/:

    rain deploy /home/user/project/myapp/template.yml my-stack -y
  3. Rain resolves Run: scripts/build.sh relative to the template directory:
    /home/user/project/myapp/scripts/build.sh (correct, absolute)

  4. Rain then prepends the working directory to this already-absolute path:
    /home/user/project/home/user/project/myapp/scripts/build.sh (doubled)

Error

error packaging template '/home/user/project/myapp/template.yml': fork/exec /home/user/project/home/user/project/myapp/scripts/build.sh: no such file or directory

Expected Behavior

Rain should detect that the resolved Run path is already absolute and skip prepending the working directory. The Path directive appears to have the same issue.

Workaround

Pass the template as a relative path instead of absolute:

rain deploy myapp/template.yml my-stack -y

Or run the build script externally before rain deploy and omit the Run directive.

Environment

  • Rain version: latest (installed via Homebrew)
  • OS: macOS (Darwin 25.3.0, arm64)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions