pulumi / pulumi-command

Apache License 2.0
57 stars 23 forks source link

Confusing file does not exist error #446

Open t0yv0 opened 1 month ago

t0yv0 commented 1 month ago

What happened?

In the case where the remote path does not exist, I get a cryptic "file does not exist" error. Would be lovely to distinguish missing local and remote paths and identify which one is missing in the error message.

  file-copy:
    type: command:remote:CopyFile
    properties:
      connection:
        host: ${inst.publicIp}
        user: ec2-user # The default user for Amazon Linux AMI
        privateKey: ${priv-key.privateKeyOpenssh}
      localPath: ./Pulumi.yaml
      remotePath: "~/Pulumi.yaml"

Example

Above.

Output of pulumi about

CLI          
Version      3.111.1
Go Version   go1.22.1
Go Compiler  gc

Plugins
NAME     VERSION
aws      unknown
command  unknown
tls      unknown
yaml     unknown

Host     
OS       darwin
Version  14.4.1
Arch     arm64

This project is written in yaml

Current Stack: anton-pulumi-corp/imds-v2/dev

TYPE                                 URN
pulumi:pulumi:Stack                  urn:pulumi:dev::imds-v2::pulumi:pulumi:Stack::imds-v2-dev
pulumi:providers:aws                 urn:pulumi:dev::imds-v2::pulumi:providers:aws::default
aws:ec2/securityGroup:SecurityGroup  urn:pulumi:dev::imds-v2::aws:ec2/securityGroup:SecurityGroup::segroup
pulumi:providers:tls                 urn:pulumi:dev::imds-v2::pulumi:providers:tls::default
tls:index/privateKey:PrivateKey      urn:pulumi:dev::imds-v2::tls:index/privateKey:PrivateKey::priv-key
aws:ec2/keyPair:KeyPair              urn:pulumi:dev::imds-v2::aws:ec2/keyPair:KeyPair::key-pair
aws:ec2/instance:Instance            urn:pulumi:dev::imds-v2::aws:ec2/instance:Instance::inst
pulumi:providers:command             urn:pulumi:dev::imds-v2::pulumi:providers:command::default
command:remote:CopyFile              urn:pulumi:dev::imds-v2::command:remote:CopyFile::file-copy
command:remote:Command               urn:pulumi:dev::imds-v2::command:remote:Command::init-cmd

Found no pending operations associated with dev

Backend        
Name           pulumi.com
URL            https://app.pulumi.com/anton-pulumi-corp
User           anton-pulumi-corp
Organizations  anton-pulumi-corp, moolumi, pulumi
Token type     personal

No dependencies found

Pulumi locates its logs in /var/folders/gd/3ncjb1lj5ljgk8xl5ssn_gvc0000gn/T/com.apple.shortcuts.mac-helper// by default

Additional context

N/A

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