PolyDeploy icon indicating copy to clipboard operation
PolyDeploy copied to clipboard

DeployClient Unable to overwrite existing file

Open reteid opened this issue 4 years ago • 6 comments

Hi There, Im modifying our Azure Dev Ops release pipeline to deploy modules onto the Staging slot (with the Poly Deploy task) , then do an azure Slot Swap , then Deploy again (with Poly Deploy) to the Prod slot - so that there is no downtime.

However, on the second deployment the Poly Deploy task fails with this error :

##[error]Unhandled: Failed cp: cp: dest file already exists: D:\a\1\s\ModuleName_Install.zip

Here's some additional logging if it helps.

C:\hostedtoolcache\windows\DeployClient.exe\0.9.3\x64\DeployClient.exe --target-uri https://website.net --api-key 123 --encryption-key xyz --no-prompt --installation-status-timeout 60

reteid avatar Oct 21 '21 14:10 reteid

Are you using a hosted runner? Or your own?

mitchelsellers avatar Oct 21 '21 17:10 mitchelsellers

yeah its cloud hosted , Azure Devops the Agent used is "vs2017-win2016"

reteid avatar Oct 22 '21 08:10 reteid

The deploy client copies the packages to the directory with the deploy client (see https://github.com/EngageSoftware/cantarus-polydeploy-client/blob/5eb6c49c1eb384760bf3f2a3dac4e1abc11bc0d6/cantarus-polydeploy-client/index.js#L11-L14). Doing this twice is causing the exception, and I don't see a way around it other than fixing the deploy client. I guess, ideally, we'd be copying the files into independent folders, rather than the root, since they could be a different selection of packages for different runs.

bdukes avatar Oct 22 '21 14:10 bdukes

I've created an issue tracking this at https://github.com/EngageSoftware/cantarus-polydeploy-client/issues/42

bdukes avatar Oct 22 '21 14:10 bdukes

Thanks Brian. my work-around was to rename the package to something random in-between deployments. but this causes there to be multiple packages (of the same module) that get deployed on the second deployment.

reteid avatar Oct 22 '21 15:10 reteid

This fix is included in version 1.1.3 (currently being verified and deployed to https://marketplace.visualstudio.com/items?itemName=engage-software.cantarus-polydeploy-client)

bdukes avatar Oct 22 '21 16:10 bdukes