Closed Ghoughpteighbteau closed 1 month ago
Thanks for reporting this @Ghoughpteighbteau; I agree it should be updating in place. We'll take a look.
Hi @Ghoughpteighbteau, sorry you're running into this. Can you confirm that both the local configs
and the remote pulumi
are directories, not files?
If yes, could you try specifying the remote path as /home/pulumi/
, with a trailing slash?
yep yep!
this is my file tree
/home/oehpr/dev/lightship/devops/infrastructure/tile-proxy
├──configs
│ ├──docker-compose.yml
│ ├──nginx
│ │ ├──conf.d
│ │ │ ├──cantopotiles.conf
│ │ │ ├──healthCheck.conf
│ │ │ ├──proxy_params
│ │ │ └──usgstopotiles.conf
│ │ ├──mime.types
│ │ └──nginx.conf
│ └──opsready-sshd.conf
├──index.ts
├──package-lock.json
├──package.json
├──Pulumi.prod.yaml
├──Pulumi.test.yaml
├──Pulumi.yaml
├──tile-caching-system.drawio
└──tsconfig.json
i've updated the target to include a trailing slash
// now for configuration files, including nginx and sshd settings
const copyConfigs = new remote.CopyToRemote(`${stack}-tp-${proxyId}-configs`, {
connection,
source: new pulumi.asset.FileArchive("configs"),
remotePath: "/home/pulumi/",
}, { dependsOn: waitForCloudInit, parent: proxy });
and I reran pulumi up
obelisk in infrastructure/tile-proxy on tile-caching [!] via v20.15.1 via test took 28s
at 09:32:21 ❯ pl up
Previewing update (test):
Type Name Plan Info
pulumi:pulumi:Stack tile-proxy-test
└─ aws:ec2:Instance test-tp-0
+- ├─ command:remote:Command test-tp-0-apply-configs replace [diff: ]
~ └─ command:remote:CopyToRemote test-tp-0-configs update [diff: ~source]
Resources:
~ 1 to update
+-1 to replace
2 changes. 15 unchanged
Do you want to perform this update? yes
Updating (test):
Type Name Status Info
pulumi:pulumi:Stack tile-proxy-test **failed** 1 error
└─ aws:ec2:Instance test-tp-0
~ └─ command:remote:CopyToRemote test-tp-0-configs **updating failed** [diff: ~source]; 1 error
Diagnostics:
command:remote:CopyToRemote (test-tp-0-configs):
error: failed to create remote directory /home/pulumi/configs: sftp: "Failure" (SSH_FX_FAILURE)
pulumi:pulumi:Stack (tile-proxy-test):
error: update failed
:shrug:
Oh, sorry you asked about the remote as well, here's that tree as it currently stands.
pulumi
└── configs
├── docker-compose.yml
├── nginx
│ ├── conf.d
│ │ ├── cantopotiles.conf
│ │ ├── healthCheck.conf
│ │ ├── proxy_params
│ │ └── usgstopotiles.conf
│ ├── mime.types
│ └── nginx.conf
└── opsready-sshd.conf
What happened?
I'm trying to upload some configuration files to my ec2 instance. However whenever I make a change pulumi fails to deploy because CopyToRemote can't update. It attempts to make a target directory when the target directory already exists and bails out
Example
results in:
config is just some sshd_configs, a docker-compose.yml file and some nginx configs.
Output of
pulumi about
Additional context
I can sorta work around this issue by making sure to move the directory first thing when I remote into the ec2 instance, but it's brittle and if something goes wrong the pulumi script can not recover.
CopyToRemote should not die when it is performing an update. It should update.
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).