Good news! It did start uploading files
Unfortunately it did not finish and threw this error:
August 21st 2020 10:40:28
Error
OperationStopped: The running command stopped because the preference variable āErrorActionPreferenceā or common parameter is set to Stop: Upload of C:\Octopus\Tentacle\Work\20200821003159-796-7\FtpPackage\dist\educanist\assets\scss\theme_touchspin.scss failed: WinSCP.SessionRemoteException: Error transferring file āC:\Octopus\Tentacle\Work\20200821003159-796-7\FtpPackage\dist\educanist\assets\scss\theme_touchspin.scssā.
August 21st 2020 10:40:28
Error
Copying files to remote side failed.
August 21st 2020 10:40:28
Error
The process cannot access the file because it is being used by another process.
August 21st 2020 10:40:28
Error
At C:\Octopus\Tentacle\Work\20200821003159-796-7\Script.ps1:323 char:5
August 21st 2020 10:40:28
Error
throw $_.Exception.Message
August 21st 2020 10:40:28
Error
August 21st 2020 10:40:28
Error
at , C:\Octopus\Tentacle\Work\20200821003159-796-7\Script.ps1: line 323
August 21st 2020 10:40:28
Error
at , C:\Octopus\Tentacle\Work\20200821003159-796-7\Bootstrap.Script.ps1: line 2163
August 21st 2020 10:40:28
Error
at , : line 1
August 21st 2020 10:40:28
Error
at , : line 1
August 21st 2020 10:40:28
Fatal
The remote script failed with exit code 1
August 21st 2020 10:40:28
Fatal
The action Upload Files By FTP From Package on a Worker failed
Yes you are correct Shawn, actually because I am trying to upload an Angular web application, 90% of the files will be already deployed with some change in them. There will be only 10% new files.
Ah! Okay, Iāve seen this error occur with IIS when the application is still live. Are you disabling the we application prior to deployment? If not, itās possible the web server is locking the file and the upload will fail.
Actually in order to kill the app pool, Iāll have to login to hosting Control panel and reset app pool from there. Which is do able but in my opinion defeats the purpose of having this automated pipeline. I know this is not a problem with Octopus but just wondering if there is a way around that using some PS script?
Maybe? Depends on how much control youāre allowed to have with your hosting provider. Other than that, try to do your deployments when usage would be the least? I was going to suggest maybe some retry logic, but thereās really no telling when the file lock would be released.
I was able to reset app pool manually and upload the files!! Thank you so much for your help throughout the process. I really couldnāt have pulled it off without your great support and special thanks for making a quick change in the template for me and uploading it
Now at least I can manually deploy the site using the Octopus UI and have learned something along the way
I have one question now that is confusing me. When we installed WinSCP module, is it installed at the machine level? If yes then does that mean that every cloud instance of Octopus is hosted on a dedicated VM? Because itās possible if we are using shared machines to install or uninstall packages that are being used by other pipelines?
Secondly, whatās the best way of running a step like installing this WinSCP module that essentially needs to run once per machine?
The new step template will download a temporary copy of the WinSCP PowerShell module and use it for that step only. This done on purpose as to not permanently install something that may not be wanted. The dynamic workers are part of a pool that are spun up and down so even if it was installed, thereās no guarantee that it will be there. Does that make sense? I think that answers both questions?