Deployment error on azure web app

I’m trying to deploy an angular web app to Azure App Service on Windows through Octopus but I’m getting the below error.


The version 13.0.2 of the Calamari.AzureWebApp.netfx tool has not been extracted, it will be extracted automatically.

February 10th 2022 16:10:29

Info

Version 13.0.2 of the Calamari.AzureWebApp.netfx tool has been extracted successfully

February 10th 2022 16:27:22

Error

Unable to execute C:\Windows\system32\bash.exe, please ensure that C:\Windows\system32\bash.exe is installed and is in the PATH.

February 10th 2022 16:27:22

Error

System.Exception: Error when attempting to execute C:\Windows\system32\bash.exe: The system cannot find the file specified ---> System.ComponentModel.Win32Exception: The system cannot find the file specified

February 10th 2022 16:27:22

Error

at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)

February 10th 2022 16:27:22

Error

at Calamari.Common.Features.Processes.SilentProcessRunner.ExecuteCommand(String executable, String arguments, String workingDirectory, Dictionary`2 environmentVars, String userName, SecureString password, Action`1 output, Action`1 error)

February 10th 2022 16:27:22

Error

--- End of inner exception stack trace ---

February 10th 2022 16:27:22

Error

at Calamari.Common.Features.Processes.SilentProcessRunner.ExecuteCommand(String executable, String arguments, String workingDirectory, Dictionary`2 environmentVars, String userName, SecureString password, Action`1 output, Action`1 error)

February 10th 2022 16:27:22

Error

at Calamari.Common.Features.Processes.CommandLineRunner.Execute(CommandLineInvocation invocation)

February 10th 2022 16:27:22

Error

The command that caused the exception was: "C:\Windows\system32\bash.exe" "Bootstrap.309-4687-a17a-44f96dfad0f6.Octopus.AzureContext.sh" "C006707B5035327266426BF97A37BFDE"

February 10th 2022 16:27:22

Error

Running rollback behaviours...

February 10th 2022 16:27:22

Error

Script 'C:\Octopus\Tentacle\Work\20220210161029-12892-48\staging\deploy.sh' returned non-zero exit code: -1. Deployment terminated.

February 10th 2022 16:28:27

Fatal

The remote script failed with exit code 1

16:08:50 Verbose | Acquiring isolation mutex RunningScript with NoIsolation in ServerTasks-12892
16:08:50 Verbose | Executable directory is C:\Windows\system32\WindowsPowershell\v1.0
16:08:50 Verbose | Executable name or full path: C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe
16:08:50 Verbose | No user context provided. Running as current user.
16:08:51 Verbose | Starting C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in working directory ‘C:\Octopus\Tentacle\Work\20220210160849-12892-37’ using ‘OEM United States’ encoding running as ‘NT AUTHORITY\SYSTEM’ with the same environment variables as the launching process
16:08:51 Verbose | Process C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in C:\Octopus\Tentacle\Work\20220210160849-12892-37 exited with code 0
16:08:51 Verbose | Using Calamari.win-x64 21.0.1
16:08:51 Verbose | Acquiring isolation mutex RunningScript with NoIsolation in ServerTasks-12892
16:08:51 Verbose | Executable directory is C:\Windows\system32\WindowsPowershell\v1.0
16:08:51 Verbose | Executable name or full path: C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe
16:08:51 Verbose | No user context provided. Running as current user.
16:08:52 Verbose | Starting C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in working directory ‘C:\Octopus\Tentacle\Work\20220210160851-12892-38’ using ‘OEM United States’ encoding running as ‘NT AUTHORITY\SYSTEM’ with the same environment variables as the launching process
16:08:53 Verbose | Process C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in C:\Octopus\Tentacle\Work\20220210160851-12892-38 exited with code 1
16:08:53 Verbose | Using Calamari.win-x64 21.0.1
16:08:53 Info | The version 21.0.1 of the Calamari.win-x64 tool has not been extracted, it will be extracted automatically.
16:08:53 Verbose | Acquiring isolation mutex Calamari.win-x64 with NoIsolation in ServerTasks-12892
16:08:53 Verbose | Executable directory is C:\Windows\system32\WindowsPowershell\v1.0
16:08:53 Verbose | Executable name or full path: C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe
16:08:53 Verbose | No user context provided. Running as current user.
16:08:54 Verbose | Starting C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in working directory ‘C:\Octopus\Tentacle\Work\20220210160853-12892-39’ using ‘OEM United States’ encoding running as ‘NT AUTHORITY\SYSTEM’ with the same environment variables as the launching process
16:08:54 Verbose | Process C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in C:\Octopus\Tentacle\Work\20220210160853-12892-39 exited with code 0
16:08:55 Verbose | Acquiring isolation mutex Calamari.win-x64 with FullIsolation in ServerTasks-12892
16:08:55 Verbose | Executable directory is C:\Windows\system32\WindowsPowershell\v1.0
16:08:55 Verbose | Executable name or full path: C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe
16:08:55 Verbose | No user context provided. Running as current user.
16:08:57 Verbose | Starting C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in working directory ‘C:\Octopus\Tentacle\Work\20220210160855-12892-40’ using ‘OEM United States’ encoding running as ‘NT AUTHORITY\SYSTEM’ with the same environment variables as the launching process
16:09:00 Verbose | Checking for C:\Octopus\Tentacle\Tools\Calamari.win-x64\21.0.1\Success.txt
16:09:00 Verbose | Package: C:\Octopus\Tentacle\Work\20220210160855-12892-40\Calamari.win-x64.21.0.1.nupkg
16:09:41 Verbose | Destination: C:\Octopus\Tentacle\Tools\Calamari.win-x64\21.0.1
16:09:41 Verbose | 364 files extracted
16:09:41 Verbose | Calamari.win-x64 21.0.1 extracted to C:\Octopus\Tentacle\Tools\Calamari.win-x64\21.0.1
16:09:41 Verbose | Removing write permissions on C:\Octopus\Tentacle\Tools\Calamari.win-x64\21.0.1 for BUILTIN\Users
16:09:41 Verbose | Cleaning up old Calamari.win-x64 versions…
16:09:41 Verbose | Keeping only Calamari.win-x64 version 21.0.1…
16:09:41 Verbose | Found no old versions of Calamari.win-x64 to delete…
16:09:41 Verbose | Process C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in C:\Octopus\Tentacle\Work\20220210160855-12892-40 exited with code 0
16:09:41 Info | Version 21.0.1 of the Calamari.win-x64 tool has been extracted successfully
16:09:42 Verbose | Acquiring isolation mutex RunningScript with NoIsolation in ServerTasks-12892
16:09:42 Verbose | Executable directory is C:\Windows\system32\WindowsPowershell\v1.0
16:09:42 Verbose | Executable name or full path: C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe
16:09:42 Verbose | No user context provided. Running as current user.
16:09:44 Verbose | Starting C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in working directory ‘C:\Octopus\Tentacle\Work\20220210160941-12892-41’ using ‘OEM United States’ encoding running as ‘NT AUTHORITY\SYSTEM’ with the same environment variables as the launching process
16:09:44 Verbose | Calamari Version: 21.0.1
16:09:44 Verbose | Environment Information:
16:09:44 Verbose | OperatingSystem: Microsoft Windows NT 10.0.17763.0
16:09:44 Verbose | OsBitVersion: x64
16:09:44 Verbose | Is64BitProcess: True
16:09:44 Verbose | CurrentUser: NT AUTHORITY\SYSTEM
16:09:44 Verbose | MachineName: WIN-CH8L0D81M04
16:09:44 Verbose | ProcessorCount: 2
16:09:44 Verbose | CurrentDirectory: C:\Octopus\Tentacle\Work\20220210160941-12892-41
16:09:44 Verbose | TempDirectory: C:\Windows\TEMP
16:09:45 Verbose | HostProcess: Calamari (2340)
16:09:45 Verbose | Package wwau-frontline-ui version 2022.2.10.154809 hash 8e4098acab1c7212a44de5ee841c55de57c4f048 has not been uploaded.
16:09:45 Verbose | Finding earlier packages that have been uploaded to this Tentacle.
16:09:45 Verbose | No earlier packages for wwau-frontline-ui has been uploaded
16:09:45 Verbose | Found 0 earlier versions of wwau-frontline-ui on this Tentacle
16:09:45 Verbose | Process C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in C:\Octopus\Tentacle\Work\20220210160941-12892-41 exited with code 0
16:09:45 Verbose | Exit code: 0
16:09:45 Verbose | Acquiring isolation mutex RunningScript with NoIsolation in ServerTasks-12892
16:09:45 Verbose | Executable directory is C:\Windows\system32\WindowsPowershell\v1.0
16:09:45 Verbose | Executable name or full path: C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe
16:09:45 Verbose | No user context provided. Running as current user.
16:09:46 Verbose | Starting C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in working directory ‘C:\Octopus\Tentacle\Work\20220210160945-12892-42’ using ‘OEM United States’ encoding running as ‘NT AUTHORITY\SYSTEM’ with the same environment variables as the launching process
16:09:47 Verbose | Process C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in C:\Octopus\Tentacle\Work\20220210160945-12892-42 exited with code 0
16:09:47 Verbose | Using Calamari.win-x64 21.0.1
16:09:47 Verbose | Acquiring isolation mutex RunningScript with NoIsolation in ServerTasks-12892
16:09:47 Verbose | Executable directory is C:\Windows\system32\WindowsPowershell\v1.0
16:09:47 Verbose | Executable name or full path: C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe
16:09:47 Verbose | No user context provided. Running as current user.
16:09:48 Verbose | Starting C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in working directory ‘C:\Octopus\Tentacle\Work\20220210160947-12892-43’ using ‘OEM United States’ encoding running as ‘NT AUTHORITY\SYSTEM’ with the same environment variables as the launching process
16:09:48 Verbose | Calamari Version: 21.0.1
16:09:48 Verbose | Environment Information:
16:09:48 Verbose | OperatingSystem: Microsoft Windows NT 10.0.17763.0
16:09:48 Verbose | OsBitVersion: x64
16:09:48 Verbose | Is64BitProcess: True
16:09:48 Verbose | CurrentUser: NT AUTHORITY\SYSTEM
16:09:48 Verbose | MachineName: WIN-CH8L0D81M04
16:09:48 Verbose | ProcessorCount: 2
16:09:48 Verbose | CurrentDirectory: C:\Octopus\Tentacle\Work\20220210160947-12892-43
16:09:48 Verbose | TempDirectory: C:\Windows\TEMP
16:09:49 Verbose | HostProcess: Calamari (404)
16:09:49 Verbose | Package wwau-frontline-ui version 2022.2.10.154809 hash 8e4098acab1c7212a44de5ee841c55de57c4f048 has not been uploaded.
16:09:49 Verbose | Finding earlier packages that have been uploaded to this Tentacle.
16:09:49 Verbose | No earlier packages for wwau-frontline-ui has been uploaded
16:09:49 Verbose | Found 0 earlier versions of wwau-frontline-ui on this Tentacle
16:09:49 Verbose | Process C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in C:\Octopus\Tentacle\Work\20220210160947-12892-43 exited with code 0
16:09:49 Verbose | Exit code: 0
16:09:49 Info | No earlier versions of wwau-frontline-ui were found on the target so we can’t perform a delta upload.
16:09:49 Info | Uploading package wwau-frontline-ui (180.937 MB)…
16:09:49 Verbose | Requesting upload…
16:09:49 Info | Beginning streaming transfer of wwau-frontline-ui@S2022.2.10.154809@AADDC0507B80E44BB03DEC76F9E3C941.nupkg
16:09:55 Info | Stream transfer complete
|
| == Failed: Step 3: Deploy an Azure Web App (Web Deploy) ==
16:28:27 Fatal | The step failed: Activity Deploy an Azure Web App (Web Deploy) on eu2-tgt-lsmi-crt-web failed with error ‘The remote script failed with exit code 1’.
16:28:27 Verbose | Deploy an Azure Web App (Web Deploy) completed
|
| == Failed: Worker on behalf of eu2-tgt-lsmi-crt-web ==
16:09:55 Verbose | Octopus Server version: 2022.1.552
16:09:55 Verbose | Environment Information:
| IsRunningInContainer: True
| OperatingSystem: Linux 5.4.0-1062-azure #65~18.04.1-Ubuntu SMP Tue Oct 12 11:26:28 UTC 2021
| OsBitVersion: x64
| Is64BitProcess: True
| CurrentUser: root
| MachineName: octopus-i020121-665fbf9d5-mxkdp
| ProcessorCount: 2
| CurrentDirectory: /Octopus
| TempDirectory: /tmp/
| HostProcessName: Octopus.Server
| PID: 1
16:09:55 Verbose | Executing Deploy an Azure Web App (Web Deploy) (type Deploy an Azure Web App (Web Deploy)) on DynamicWorker 22-02-10-1412-83je5
16:09:55 Verbose | Using account ID ‘Accounts-86’
16:09:56 Verbose | Acquiring isolation mutex RunningScript with NoIsolation in ServerTasks-12892
16:09:56 Verbose | Executable directory is C:\Windows\system32\WindowsPowershell\v1.0
16:09:56 Verbose | Executable name or full path: C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe
16:09:56 Verbose | No user context provided. Running as current user.
16:09:57 Verbose | Starting C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in working directory ‘C:\Octopus\Tentacle\Work\20220210160955-12892-44’ using ‘OEM United States’ encoding running as ‘NT AUTHORITY\SYSTEM’ with the same environment variables as the launching process
16:09:57 Verbose | Process C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in C:\Octopus\Tentacle\Work\20220210160955-12892-44 exited with code 0
16:09:57 Verbose | Using Calamari.AzureWebApp.netfx 13.0.2
16:09:58 Verbose | Acquiring isolation mutex RunningScript with NoIsolation in ServerTasks-12892
16:09:58 Verbose | Executable directory is C:\Windows\system32\WindowsPowershell\v1.0
16:09:58 Verbose | Executable name or full path: C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe
16:09:58 Verbose | No user context provided. Running as current user.
16:09:59 Verbose | Starting C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in working directory ‘C:\Octopus\Tentacle\Work\20220210160957-12892-45’ using ‘OEM United States’ encoding running as ‘NT AUTHORITY\SYSTEM’ with the same environment variables as the launching process
16:09:59 Verbose | Process C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in C:\Octopus\Tentacle\Work\20220210160957-12892-45 exited with code 1
16:09:59 Verbose | Using Calamari.AzureWebApp.netfx 13.0.2
16:09:59 Info | The version 13.0.2 of the Calamari.AzureWebApp.netfx tool has not been extracted, it will be extracted automatically.
16:10:00 Verbose | Acquiring isolation mutex Calamari.AzureWebApp.netfx with NoIsolation in ServerTasks-12892
16:10:00 Verbose | Executable directory is C:\Windows\system32\WindowsPowershell\v1.0
16:10:00 Verbose | Executable name or full path: C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe
16:10:00 Verbose | No user context provided. Running as current user.
16:10:01 Verbose | Starting C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in working directory ‘C:\Octopus\Tentacle\Work\20220210160959-12892-46’ using ‘OEM United States’ encoding running as ‘NT AUTHORITY\SYSTEM’ with the same environment variables as the launching process
16:10:01 Verbose | Process C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in C:\Octopus\Tentacle\Work\20220210160959-12892-46 exited with code 0
16:10:04 Verbose | Acquiring isolation mutex Calamari.AzureWebApp.netfx with FullIsolation in ServerTasks-12892
16:10:04 Verbose | Executable directory is C:\Windows\system32\WindowsPowershell\v1.0
16:10:04 Verbose | Executable name or full path: C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe
16:10:04 Verbose | No user context provided. Running as current user.
16:10:06 Verbose | Starting C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in working directory ‘C:\Octopus\Tentacle\Work\20220210161004-12892-47’ using ‘OEM United States’ encoding running as ‘NT AUTHORITY\SYSTEM’ with the same environment variables as the launching process
16:10:08 Verbose | Checking for C:\Octopus\Tentacle\Tools\Calamari.AzureWebApp.netfx\13.0.2\Success.txt
16:10:08 Verbose | Package: C:\Octopus\Tentacle\Work\20220210161004-12892-47\Calamari.AzureWebApp.netfx.13.0.2.nupkg
16:10:29 Verbose | Destination: C:\Octopus\Tentacle\Tools\Calamari.AzureWebApp.netfx\13.0.2
16:10:29 Verbose | 115 files extracted
16:10:29 Verbose | Calamari.AzureWebApp.netfx 13.0.2 extracted to C:\Octopus\Tentacle\Tools\Calamari.AzureWebApp.netfx\13.0.2
16:10:29 Verbose | Removing write permissions on C:\Octopus\Tentacle\Tools\Calamari.AzureWebApp.netfx\13.0.2 for BUILTIN\Users
16:10:29 Verbose | Cleaning up old Calamari.AzureWebApp.netfx versions…
16:10:29 Verbose | Keeping only Calamari.AzureWebApp.netfx version 13.0.2…
16:10:29 Verbose | Removing C:\Octopus\Tentacle\Tools\Calamari.AzureWebApp.netfx\13.0.0…
16:10:29 Verbose | Process C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in C:\Octopus\Tentacle\Work\20220210161004-12892-47 exited with code 0
16:10:29 Info | Version 13.0.2 of the Calamari.AzureWebApp.netfx tool has been extracted successfully
16:10:29 Verbose | Acquiring isolation mutex RunningScript with NoIsolation in ServerTasks-12892
16:10:29 Verbose | Executable directory is C:\Windows\system32\WindowsPowershell\v1.0
16:10:29 Verbose | Executable name or full path: C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe
16:10:29 Verbose | No user context provided. Running as current user.
16:10:31 Verbose | Starting C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in working directory ‘C:\Octopus\Tentacle\Work\20220210161029-12892-48’ using ‘OEM United States’ encoding running as ‘NT AUTHORITY\SYSTEM’ with the same environment variables as the launching process
16:10:31 Verbose | Calamari Version: 1.0.0
16:10:31 Verbose | Environment Information:
16:10:31 Verbose | OperatingSystem: Microsoft Windows NT 6.2.9200.0
16:10:31 Verbose | OsBitVersion: x64
16:10:31 Verbose | Is64BitProcess: True
16:10:31 Verbose | CurrentUser: NT AUTHORITY\SYSTEM
16:10:31 Verbose | MachineName: WIN-CH8L0D81M04
16:10:31 Verbose | ProcessorCount: 2
16:10:31 Verbose | CurrentDirectory: C:\Octopus\Tentacle\Work\20220210161029-12892-48
16:10:31 Verbose | TempDirectory: C:\Windows\TEMP
16:10:33 Verbose | HostProcess: Calamari.AzureWebApp (4252)
16:27:22 Verbose | Extracting package to: C:\Octopus\Tentacle\Work\20220210161029-12892-48\staging
16:27:22 Verbose | Extracted 50283 files
16:27:22 Verbose | Executing ‘C:\Octopus\Tentacle\Work\20220210161029-12892-48\staging\deploy.sh’
16:27:22 Verbose | Setting Proxy Environment Variables
16:27:22 Error | Unable to execute C:\Windows\system32\bash.exe, please ensure that C:\Windows\system32\bash.exe is installed and is in the PATH.
16:27:22 Error | System.Exception: Error when attempting to execute C:\Windows\system32\bash.exe: The system cannot find the file specified —> System.ComponentModel.Win32Exception: The system cannot find the file specified
16:27:22 Error | at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
16:27:22 Error | at Calamari.Common.Features.Processes.SilentProcessRunner.ExecuteCommand(String executable, String arguments, String workingDirectory, Dictionary2 environmentVars, String userName, SecureString password, Action1 output, Action1 error) 16:27:22 Error | --- End of inner exception stack trace --- 16:27:22 Error | at Calamari.Common.Features.Processes.SilentProcessRunner.ExecuteCommand(String executable, String arguments, String workingDirectory, Dictionary2 environmentVars, String userName, SecureString password, Action1 output, Action1 error)
16:27:22 Error | at Calamari.Common.Features.Processes.CommandLineRunner.Execute(CommandLineInvocation invocation)
16:27:22 Error | The command that caused the exception was: “C:\Windows\system32\bash.exe” “Bootstrap.309-4687-a17a-44f96dfad0f6.Octopus.AzureContext.sh” “C006707B5035327266426BF97A37BFDE”
16:27:22 Error | Running rollback behaviours…
16:27:22 Error | Script ‘C:\Octopus\Tentacle\Work\20220210161029-12892-48\staging\deploy.sh’ returned non-zero exit code: -1. Deployment terminated.
16:28:27 Verbose | Process C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in C:\Octopus\Tentacle\Work\20220210161029-12892-48 exited with code 1
16:28:27 Verbose | Updating manifest with output variables
16:28:27 Verbose | Updating manifest with action evaluated variables
16:28:27 Fatal | The remote script failed with exit code 1
16:28:27 Fatal | The action Deploy an Azure Web App (Web Deploy) on eu2-tgt-lsmi-crt-web failed
|
| == Skipped: Step 4: Slack Notification ==
16:28:27 Info | Step “Slack Notification” runs only when all previous steps succeeded; skipping
|

The tasks section is where you can check on the status and history of the background tasks your Octopus Server is managing.

Having issues?
Our support team is here to help

Hi @safeer.a,

Thanks for posting your issue, and welcome to the Octopus Deploy community!

It looks like the error being returned is indicating there’s a bash script trying to run during deployment on your Windows-based worker, and because it’s Windows it likely won’t have bash installed by default. We’ve seen this occurring in the past when either Deploy an Azure Web App (Web Deploy) step is configured with a Custom Deployment Script feature, or a script is included in the deployment package and follows the naming convention of one of our supported scripts within a package.

The log is showing the deployment is hanging on a deploy.sh, so either that’s configured in your step, or there’s one in the package you’re deploying.

Depending on your use case, you have a few options:

  • Use a linux-based worker instead
  • Install bash on your Windows worker
  • Convert your script in the Deploy an Azure Web App step to Powershell so it runs natively

If the deploy.sh is bundled in the package and running unintentionally, then would it be possible to rename it?

I hope this is helpful, and let me know if you have any further questions!

Best,
Patrick

Hi @safeer.a,

Apologies for the quick follow-up here, but I had a colleague point out a few things in my previous suggestions and I wanted to let you know about them!

Using a linux-based worker unfortunately doesn’t work with Web Deploy, so you won’t be able to use that unless you instead use our newer Deploy an Azure App Service step.

I missed that you’re using one of our hosted instances and therefore one of our own dynamic workers, so installing bash there isn’t really a workable solution.

Sorry about any confusion I’ve caused, and let me know if I can further clarify on these.

Kind regards,
Patrick

Thanks for your reply. I’ve removed the deploy.sh script and also changed the step template to new one as mentioned but facing below error.

Task ID:        ServerTasks-12970
Related IDs:    Deployments-1372, Channels-271, Releases-1052, Projects-231, Spaces-1, Environments-1
Task status:    Failed
Task queued:    Friday, 11 February 2022 2:41:41 PM +00:00
Task started:   Friday, 11 February 2022 2:41:41 PM +00:00
Task completed: Friday, 11 February 2022 2:42:20 PM +00:00
Task duration:  39 seconds
Server version: 2022.1.552
Server node:    octopus-i020121-665fbf9d5-mxkdp

                    | == Failed: Deploy Compass.Web.Portal release 0.0.8 to Test ==
14:41:41   Verbose  |   Step 1:  Approval Request does not apply to the current environment, and will not be executed
14:41:41   Verbose  |   Step 2: Approve Release does not apply to the current environment, and will not be executed
14:41:41   Verbose  |   Guided failure is not enabled for this task
14:42:19   Verbose  |   Releasing workers that required packages.
14:42:19   Verbose  |   Successfully called release for dynamic pool lease Leases-4263433 : 22-02-11-1248-kdxbr
14:42:20   Fatal    |   The deployment failed because one or more steps failed. Please see the deployment log for details.
                    | 
                    |   == Success: Acquire packages ==
14:41:41   Info     |     Acquiring packages
14:41:41   Info     |     Making a list of packages to acquire
14:41:41   Info     |     Leasing Windows2019 dynamic worker...
14:41:42   Info     |     Obtained worker lease successfully.
14:41:42   Verbose  |     Leased worker 22-02-11-1248-kdxbr from pool Windows 2019 Worker Pool (lease Leases-4263433).
14:41:42   Verbose  |     Package wwau-compass-web v7.1.1-alpha.10 is required by action 'Deploy an Azure App Service'
14:41:42   Verbose  |     No packages are required on the Octopus Server
14:41:42   Verbose  |     Delta compression is enabled for package transfers from the Octopus Server to deployment targets
14:41:42   Verbose  |     Machine DynamicWorker 22-02-11-1248-kdxbr still needs packages wwau-compass-web v7.1.1-alpha.10 for action ('Deploy an Azure App Service')
14:41:42   Verbose  |     Checking package cache for package wwau-compass-web v7.1.1-alpha.10
14:41:42   Info     |     Downloading wwau-compass-web v7.1.1-alpha.10 to package cache...
14:41:42   Verbose  |     Downloading wwau-compass-web v7.1.1-alpha.10 from NuGet feed 'artifactory-nuget-preview' using cache policy UseCache...
14:41:42   Verbose  |     Downloading package (attempt 1 of 3)
14:41:42   Verbose  |     Downloading wwau-compass-web v7.1.1-alpha.10 to '/cache/PackageCache/Feeds-1121/wwau-compass-web@S7.1.1-alpha.10@D098C727251D6A40B58E8EC8A1352D48.nupkg'
14:41:42   Verbose  |     Downloaded wwau-compass-web v7.1.1-alpha.10 (2.083 MB) to '/cache/PackageCache/Feeds-1121/wwau-compass-web@S7.1.1-alpha.10@D098C727251D6A40B58E8EC8A1352D48.nupkg' with SHA1 ecd06ba339e8af55f826a883d971d9985c512595.
14:41:42   Info     |     Downloaded wwau-compass-web v7.1.1-alpha.10 (2.083 MB) with SHA1 ecd06ba339e8af55f826a883d971d9985c512595.
14:41:52   Info     |     All packages have been acquired
14:41:52   Verbose  |     Acquire Packages completed
                    |   
                    |     Success: DynamicWorker 22-02-11-1248-kdxbr
                    |     
                    |       Success: Upload package wwau-compass-web v7.1.1-alpha.10
14:41:42   Verbose  |         Acquiring isolation mutex RunningScript with NoIsolation in ServerTasks-12970
14:41:42   Verbose  |         Executable directory is C:\Windows\system32\WindowsPowershell\v1.0
14:41:42   Verbose  |         Executable name or full path: C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe
14:41:42   Verbose  |         No user context provided. Running as current user.
14:41:44   Verbose  |         Starting C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in working directory 'C:\Octopus\Tentacle\Work\20220211144142-12970-27' using 'OEM United States' encoding running as 'NT AUTHORITY\SYSTEM' with the same environment variables as the launching process
14:41:44   Verbose  |         Process C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in C:\Octopus\Tentacle\Work\20220211144142-12970-27 exited with code 0
14:41:44   Verbose  |         Using Calamari.win-x64 21.0.1
14:41:44   Verbose  |         Acquiring isolation mutex RunningScript with NoIsolation in ServerTasks-12970
14:41:44   Verbose  |         Executable directory is C:\Windows\system32\WindowsPowershell\v1.0
14:41:44   Verbose  |         Executable name or full path: C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe
14:41:44   Verbose  |         No user context provided. Running as current user.
14:41:46   Verbose  |         Starting C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in working directory 'C:\Octopus\Tentacle\Work\20220211144144-12970-28' using 'OEM United States' encoding running as 'NT AUTHORITY\SYSTEM' with the same environment variables as the launching process
14:41:46   Verbose  |         Calamari Version: 21.0.1
14:41:46   Verbose  |         Environment Information:
14:41:46   Verbose  |         OperatingSystem: Microsoft Windows NT 10.0.17763.0
14:41:46   Verbose  |         OsBitVersion: x64
14:41:46   Verbose  |         Is64BitProcess: True
14:41:46   Verbose  |         CurrentUser: NT AUTHORITY\SYSTEM
14:41:46   Verbose  |         MachineName: WIN-GG68LRG63J2
14:41:46   Verbose  |         ProcessorCount: 2
14:41:46   Verbose  |         CurrentDirectory: C:\Octopus\Tentacle\Work\20220211144144-12970-28
14:41:46   Verbose  |         TempDirectory: C:\Windows\TEMP\
14:41:47   Verbose  |         HostProcess: Calamari (3664)
14:41:47   Verbose  |         Package wwau-compass-web version 7.1.1-alpha.10 hash ecd06ba339e8af55f826a883d971d9985c512595 has not been uploaded.
14:41:47   Verbose  |         Finding earlier packages that have been uploaded to this Tentacle.
14:41:47   Verbose  |         No earlier packages for wwau-compass-web has been uploaded
14:41:47   Verbose  |         Found 0 earlier versions of wwau-compass-web on this Tentacle
14:41:47   Verbose  |         Process C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in C:\Octopus\Tentacle\Work\20220211144144-12970-28 exited with code 0
14:41:47   Verbose  |         Exit code: 0
14:41:47   Verbose  |         Acquiring isolation mutex RunningScript with NoIsolation in ServerTasks-12970
14:41:47   Verbose  |         Executable directory is C:\Windows\system32\WindowsPowershell\v1.0
14:41:47   Verbose  |         Executable name or full path: C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe
14:41:47   Verbose  |         No user context provided. Running as current user.
14:41:49   Verbose  |         Starting C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in working directory 'C:\Octopus\Tentacle\Work\20220211144147-12970-29' using 'OEM United States' encoding running as 'NT AUTHORITY\SYSTEM' with the same environment variables as the launching process
14:41:49   Verbose  |         Process C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in C:\Octopus\Tentacle\Work\20220211144147-12970-29 exited with code 0
14:41:49   Verbose  |         Using Calamari.win-x64 21.0.1
14:41:49   Verbose  |         Acquiring isolation mutex RunningScript with NoIsolation in ServerTasks-12970
14:41:49   Verbose  |         Executable directory is C:\Windows\system32\WindowsPowershell\v1.0
14:41:49   Verbose  |         Executable name or full path: C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe
14:41:49   Verbose  |         No user context provided. Running as current user.
14:41:51   Verbose  |         Starting C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in working directory 'C:\Octopus\Tentacle\Work\20220211144149-12970-30' using 'OEM United States' encoding running as 'NT AUTHORITY\SYSTEM' with the same environment variables as the launching process
14:41:51   Verbose  |         Calamari Version: 21.0.1
14:41:51   Verbose  |         Environment Information:
14:41:51   Verbose  |         OperatingSystem: Microsoft Windows NT 10.0.17763.0
14:41:51   Verbose  |         OsBitVersion: x64
14:41:51   Verbose  |         Is64BitProcess: True
14:41:51   Verbose  |         CurrentUser: NT AUTHORITY\SYSTEM
14:41:51   Verbose  |         MachineName: WIN-GG68LRG63J2
14:41:51   Verbose  |         ProcessorCount: 2
14:41:51   Verbose  |         CurrentDirectory: C:\Octopus\Tentacle\Work\20220211144149-12970-30
14:41:51   Verbose  |         TempDirectory: C:\Windows\TEMP\
14:41:52   Verbose  |         HostProcess: Calamari (1208)
14:41:52   Verbose  |         Package wwau-compass-web version 7.1.1-alpha.10 hash ecd06ba339e8af55f826a883d971d9985c512595 has not been uploaded.
14:41:52   Verbose  |         Finding earlier packages that have been uploaded to this Tentacle.
14:41:52   Verbose  |         No earlier packages for wwau-compass-web has been uploaded
14:41:52   Verbose  |         Found 0 earlier versions of wwau-compass-web on this Tentacle
14:41:52   Verbose  |         Process C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in C:\Octopus\Tentacle\Work\20220211144149-12970-30 exited with code 0
14:41:52   Verbose  |         Exit code: 0
14:41:52   Info     |         No earlier versions of wwau-compass-web were found on the target so we can't perform a delta upload.
14:41:52   Info     |         Uploading package wwau-compass-web (2.083 MB)...
14:41:52   Verbose  |         Requesting upload...
14:41:52   Info     |         Beginning streaming transfer of wwau-compass-web@S7.1.1-alpha.10@13CE1F7A43255949AC8AF3D7CE0EFFC5.nupkg
14:41:52   Info     |         Stream transfer complete
                    |       
                    |   == Failed: Step 3: Deploy an Azure App Service ==
14:42:19   Fatal    |     The step failed: Activity Deploy an Azure App Service on aea-cmpau-web-poc-web failed with error 'The remote script failed with exit code 100'.
14:42:19   Verbose  |     Deploy an Azure App Service completed
                    |   
                    |     == Failed: Worker on behalf of aea-cmpau-web-poc-web ==
14:41:52   Verbose  |       Octopus Server version: 2022.1.552
14:41:52   Verbose  |       Environment Information:
                    |       IsRunningInContainer: True
                    |       OperatingSystem: Linux 5.4.0-1062-azure #65~18.04.1-Ubuntu SMP Tue Oct 12 11:26:28 UTC 2021
                    |       OsBitVersion: x64
                    |       Is64BitProcess: True
                    |       CurrentUser: root
                    |       MachineName: octopus-i020121-665fbf9d5-mxkdp
                    |       ProcessorCount: 2
                    |       CurrentDirectory: /Octopus
                    |       TempDirectory: /tmp/
                    |       HostProcessName: Octopus.Server
                    |       PID: 1
14:41:52   Verbose  |       Executing Deploy an Azure App Service (type Deploy an Azure App Service) on DynamicWorker 22-02-11-1248-kdxbr
14:41:52   Verbose  |       Acquiring isolation mutex RunningScript with NoIsolation in ServerTasks-12970
14:41:52   Verbose  |       Executable directory is C:\Windows\system32\WindowsPowershell\v1.0
14:41:52   Verbose  |       Executable name or full path: C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe
14:41:52   Verbose  |       No user context provided. Running as current user.
14:41:54   Verbose  |       Starting C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in working directory 'C:\Octopus\Tentacle\Work\20220211144152-12970-31' using 'OEM United States' encoding running as 'NT AUTHORITY\SYSTEM' with the same environment variables as the launching process
14:41:54   Verbose  |       Process C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in C:\Octopus\Tentacle\Work\20220211144152-12970-31 exited with code 0
14:41:54   Verbose  |       Using Calamari.AzureAppService.win-x64 2.1.1
14:41:54   Verbose  |       Acquiring isolation mutex RunningScript with NoIsolation in ServerTasks-12970
14:41:54   Verbose  |       Executable directory is C:\Windows\system32\WindowsPowershell\v1.0
14:41:54   Verbose  |       Executable name or full path: C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe
14:41:54   Verbose  |       No user context provided. Running as current user.
14:41:56   Verbose  |       Starting C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in working directory 'C:\Octopus\Tentacle\Work\20220211144154-12970-32' using 'OEM United States' encoding running as 'NT AUTHORITY\SYSTEM' with the same environment variables as the launching process
14:41:56   Verbose  |       Calamari Version: 1.0.0
14:41:56   Verbose  |       Environment Information:
14:41:56   Verbose  |       OperatingSystem: Microsoft Windows NT 10.0.17763.0
14:41:56   Verbose  |       OsBitVersion: x64
14:41:56   Verbose  |       Is64BitProcess: True
14:41:56   Verbose  |       CurrentUser: NT AUTHORITY\SYSTEM
14:41:56   Verbose  |       MachineName: WIN-GG68LRG63J2
14:41:56   Verbose  |       ProcessorCount: 2
14:41:56   Verbose  |       CurrentDirectory: C:\Octopus\Tentacle\Work\20220211144154-12970-32
14:41:56   Verbose  |       TempDirectory: C:\Windows\TEMP\
14:41:57   Verbose  |       HostProcess: Calamari.AzureAppService (3820)
14:42:03   Verbose  |       Extracting package to: C:\Octopus\Tentacle\Work\20220211144154-12970-32\staging
14:42:03   Verbose  |       Extracted 50 files
14:42:17   Verbose  |       Deployment type: Package
14:42:17   Info     |       Uploading package to aea-cmpau-web-poc-web
14:42:17   Verbose  |       Path to upload: C:\Octopus\Tentacle\Work\20220211144154-12970-32\staging\app.zip
14:42:17   Verbose  |       Target Site: aea-cmpau-web-poc-web
14:42:19   Verbose  |       Publishing C:\Octopus\Tentacle\Work\20220211144154-12970-32\staging\app.zip to https://waws-prod-sy3-027.publish.azurewebsites.windows.net:443/api/zipdeploy
14:42:19   Error    |       Running rollback behaviours...
14:42:19   Error    |       Not Found
14:42:19   Error    |       System.Exception
14:42:19   Error    |       at Calamari.AzureAppService.Behaviors.AzureAppServiceBehaviour.UploadZipAsync(PublishingProfile publishingProfile, HttpClient client, String uploadZipPath, String targetSite) in C:\buildAgent\work\cdb95c8a359b9bc9\source\Calamari\Behaviors\AzureAppServiceBehaviour.cs:line 155
14:42:19   Error    |       at Calamari.AzureAppService.Behaviors.AzureAppServiceBehaviour.Execute(RunningDeployment context) in C:\buildAgent\work\cdb95c8a359b9bc9\source\Calamari\Behaviors\AzureAppServiceBehaviour.cs:line 114
14:42:19   Error    |       at Calamari.Common.Plumbing.Pipeline.PipelineCommand.ExecuteBehaviour(RunningDeployment context, IBehaviour behaviour)
14:42:19   Error    |       at Calamari.Common.Plumbing.Pipeline.PipelineCommand.Execute(ILifetimeScope lifetimeScope, IVariables variables)
14:42:19   Error    |       at Calamari.Common.Plumbing.Pipeline.PipelineCommand.Execute(ILifetimeScope lifetimeScope, IVariables variables)
14:42:19   Error    |       at Calamari.Common.CalamariFlavourProgramAsync.Run(String[] args)
14:42:19   Verbose  |       Process C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in C:\Octopus\Tentacle\Work\20220211144154-12970-32 exited with code 100
14:42:19   Verbose  |       Updating manifest with output variables
14:42:19   Verbose  |       Updating manifest with action evaluated variables
14:42:19   Fatal    |       The remote script failed with exit code 100
14:42:19   Fatal    |       The action Deploy an Azure App Service on aea-cmpau-web-poc-web failed
                    |     
                    |   == Skipped: Step 4: Slack - Detailed Notification ==
14:42:19   Info     |     Step "Slack - Detailed Notification" runs only when all previous steps succeeded; skipping
                    |   

Good afternoon @safeer.a,

Just jumping in for Patrick as he is currently on leave for the day.

Sorry to hear the new step template did not work, thank you for providing the logs they do really help see why this is happening.

The lines below indicate you may have WEBSITE_WEBDEPLOY_USE_SCM set to false in your Azure Web App.

14:42:19   Verbose  |       Publishing C:\Octopus\Tentacle\Work\20220211144154-12970-32\staging\app.zip 
to https://waws-prod-sy3-027.publish.azurewebsites.windows.net:443/api/zipdeploy

Whilst this was required for the old Deploy Web App (Web Deploy) step, it is not required in the new step, it actually makes the new step error out when trying to deploy as it is trying to look for a different endpoint.

Are you able to remove the WEBSITE_WEBDEPLOY_USE_SCM setting in Azure, save the settings and then re-try the deployment please.

Hopefully that gets your app working again, let me know if you are still having issues though.

Kind Regards,

Clare Martin

1 Like

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.