Octopus Server version: v2018.7.8
Hi, we deploy some Web Apps to Azure through Octopus using the “Deploy an Azure Web App” step template by Octopus. One Project recently started failing for every Tenant, even with older releases that were deploying successfully, but the other projects deploy fine.
As you can see in the task log the error happens in Octopus.AzureContext.ps1 when the “Login-AzureRmAccount” command is called, and is around it being unable to find a specific version of the NewtonSoft.Json assembly. I may be misunderstanding how Calamari works but I’m under the impression that this command is running on the Octopus Server Node, but when I run Login-AzureRmAccount manually on the machine it works fine so I’m not clear on the context the script is run in.
Any ideas on what the issue could be?
Thanks!
Task Log
Task ID: ServerTasks-64907
Task status: Failed
Task queued: Thursday, September 13, 2018 5:01:36 PM
Task started: Thursday, September 13, 2018 5:01:36 PM
Task completed: Thursday, September 13, 2018 5:02:06 PM
Task duration: 29 seconds
Server version: 2018.7.8+Branch.master.Sha.7caedf8c767263254aa9f2e8ba3bc8655d46d97f
Server node: [REDACTED MACHINE NAME]
| == Failed: Deploy Identity Server release 0.0.34 to Global for [REDACTED] ==
17:02:06 Info | Step 1: Deploy Identity Database - SQL Azure was manually skipped, and will not be executed
17:02:06 Verbose | Guided failure is not enabled for this task
17:02:06 Fatal | The deployment failed because one or more steps failed. Please see the deployment log for details.
|
| == Success: Acquire packages ==
17:01:37 Info | Acquiring packages
17:01:37 Info | Making a list of packages to acquire
17:01:37 Verbose | No packages are required on any deployment targets
17:01:37 Verbose | Acquire [REDACTED WebAppName].Server.1.2.1808.0601 on Octopus Server
17:01:37 Verbose | Checking package cache for package [REDACTED WebAppName].Server v1.2.1808.0601
17:01:37 Info | Package [REDACTED WebAppName].Server v1.2.1808.0601 was found in cache. No need to download.
17:01:37 Verbose | Using file: E:\Octopus\Packages\[REDACTED WebAppName].Server\[REDACTED WebAppName].Server.1.2.1808.0601.nupkg
17:01:37 Info | All packages have been acquired
17:01:37 Verbose | Acquire Packages completed
|
| Success: Octopus Server
|
| Success: Download package [REDACTED WebAppName].Server v1.2.1808.0601 from Octopus Server (built-in)
17:01:37 Info | Successfully downloaded [REDACTED WebAppName].Server 1.2.1808.0601 (2.174 MB)
17:01:37 Verbose | Stored package in E:\Octopus\Packages\[REDACTED WebAppName].Server\[REDACTED WebAppName].Server.1.2.1808.0601.nupkg
|
| == Failed: Step 2: Deploy [REDACTED WebAppName] ==
17:02:05 Fatal | The step failed: Activity Deploy [REDACTED WebAppName] on Azure Global failed with error 'The remote script failed with exit code 1'.
17:02:05 Verbose | Deploy [REDACTED WebAppName] completed
|
| Failed: Octopus Server on behalf of Azure Global
17:01:38 Verbose | Octopus Server version: 2018.7.8+Branch.master.Sha.7caedf8c767263254aa9f2e8ba3bc8655d46d97f
17:01:38 Verbose | Environment Information:
| OperatingSystem: Microsoft Windows NT 6.3.9600.0
| OsBitVersion: x64
| Is64BitProcess: True
| CurrentUser: NT AUTHORITY\SYSTEM
| MachineName: [REDACTED MACHINE NAME]
| ProcessorCount: 4
| CurrentDirectory: C:\Windows\system32
| TempDirectory: C:\Windows\TEMP\
| HostProcessName: Octopus.Server
| PID: 1600
17:01:38 Verbose | Executing Deploy [REDACTED WebAppName] (type Deploy an Azure Web App) on Octopus Server
17:01:38 Verbose | Using account ID '[Redacted Azure Service Principal]'
17:01:38 Verbose | Using Calamari.Cloud 4.7.34
17:01:38 Verbose | Using Octopus.Dependencies.AzureCmdlets 5.7.0
17:01:38 Verbose | Running this script as the Octopus Server (NT AUTHORITY\SYSTEM)
17:01:38 Verbose | Starting C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in working directory 'E:\Octopus\Work\20180913160138-64907-134' using 'OEM United States' encoding running as 'NT AUTHORITY\SYSTEM' with the same environment variables as the launching process
17:01:39 Verbose | Octopus Deploy: Calamari version 4.7.34
17:01:39 Verbose | Environment Information:
17:01:39 Verbose | OperatingSystem: Microsoft Windows NT 6.3.9600.0
17:01:39 Verbose | OsBitVersion: x64
17:01:39 Verbose | Is64BitProcess: True
17:01:39 Verbose | CurrentUser: NT AUTHORITY\SYSTEM
17:01:39 Verbose | MachineName: [REDACTED MACHINE NAME]
17:01:39 Verbose | ProcessorCount: 4
17:01:39 Verbose | CurrentDirectory: E:\Octopus\Work\20180913160138-64907-134
17:01:39 Verbose | TempDirectory: C:\Windows\TEMP\
17:01:39 Verbose | HostProcessName: Calamari
17:01:41 Info | Deploying package: E:\Octopus\Packages\[REDACTED WebAppName].Server\[REDACTED WebAppName].Server.1.2.1808.0601.nupkg
17:01:41 Verbose | Extracting package to: E:\Octopus\Work\20180913160138-64907-134\staging
17:01:41 Verbose | Extracted 194 files
17:01:41 Verbose | Executing 'E:\Octopus\Work\20180913160138-64907-134\staging\Octopus.Action.CustomScripts.PreDeploy.ps1'
17:01:43 Verbose | Name Value
17:01:43 Verbose | ---- -----
17:01:43 Verbose | PSVersion 5.1.14409.1012
17:01:43 Verbose | PSEdition Desktop
17:01:43 Verbose | PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
17:01:43 Verbose | BuildVersion 10.0.14409.1012
17:01:43 Verbose | CLRVersion 4.0.30319.42000
17:01:43 Verbose | WSManStackVersion 3.0
17:01:43 Verbose | PSRemotingProtocolVersion 2.3
17:01:43 Verbose | SerializationVersion 1.1.0.1
17:01:43 Verbose | PowerShell Environment Information:
17:01:43 Verbose | OperatingSystem: Microsoft Windows NT 6.3.9600.0
17:01:43 Verbose | OsBitVersion: x64
17:01:43 Verbose | Is64BitProcess: True
17:01:43 Verbose | CurrentUser: NT AUTHORITY\SYSTEM
17:01:43 Verbose | MachineName: [REDACTED MACHINE NAME]
17:01:43 Verbose | ProcessorCount: 4
17:01:43 Verbose | CurrentDirectory: E:\Octopus\Work\20180913160138-64907-134\staging
17:01:43 Verbose | CurrentLocation: E:\Octopus\Work\20180913160138-64907-134\staging
17:01:43 Verbose | TempDirectory: C:\Windows\TEMP\
17:01:45 Verbose | HostProcessName: powershell
17:01:45 Verbose | TotalPhysicalMemory: 14679604 KB
17:01:45 Verbose | AvailablePhysicalMemory: 11388872 KB
17:01:45 Verbose | Authenticating with Service Principal
17:01:45 Verbose | Attempt 1 of 5 failed: Could not load file or assembly 'Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.
17:01:45 Verbose | Waiting for 5 seconds before retrying...
17:01:50 Verbose | Retrying...
17:01:50 Verbose | Authenticating with Service Principal
17:01:50 Verbose | Attempt 2 of 5 failed: Could not load file or assembly 'Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.
17:01:50 Verbose | Waiting for 5 seconds before retrying...
17:01:55 Verbose | Retrying...
17:01:55 Verbose | Authenticating with Service Principal
17:01:55 Verbose | Attempt 3 of 5 failed: Could not load file or assembly 'Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.
17:01:55 Verbose | Waiting for 5 seconds before retrying...
17:02:00 Verbose | Retrying...
17:02:00 Verbose | Authenticating with Service Principal
17:02:00 Verbose | Attempt 4 of 5 failed: Could not load file or assembly 'Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.
17:02:00 Verbose | Waiting for 5 seconds before retrying...
17:02:05 Verbose | Retrying...
17:02:05 Verbose | Authenticating with Service Principal
17:02:05 Error | Login-AzureRmAccount : Could not load file or assembly 'Newtonsoft.Json,
17:02:05 Error | Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of
17:02:05 Error | its dependencies. The system cannot find the file specified.
17:02:05 Error | At
17:02:05 Error | E:\Octopus\Work\20180913160138-64907-134\staging\Octopus.AzureContext.ps1:72
17:02:05 Error | char:9
17:02:05 Error | + Login-AzureRmAccount -Credential $creds -TenantId $OctopusAzu ...
17:02:05 Error | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17:02:05 Error | + CategoryInfo : NotSpecified: (:) [Connect-AzureRmAccount], File
17:02:05 Error | NotFoundException
17:02:05 Error | + FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.Azure.
17:02:05 Error | Commands.Profile.ConnectAzureRmAccountCommand
17:02:05 Error | PreDeploy script returned non-zero exit code: 1
17:02:05 Error | Running rollback conventions...
17:02:05 Error | PreDeploy script returned non-zero exit code: 1
17:02:05 Verbose | Process C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in E:\Octopus\Work\20180913160138-64907-134 exited with code 1
17:02:05 Verbose | Updating manifest with output variables
17:02:05 Verbose | Updating manifest with action evaluated variables
17:02:05 Fatal | The remote script failed with exit code 1
17:02:05 Fatal | The action Deploy [REDACTED WebAppName] on Azure Global failed
|
| Canceled: Step 3: Approve
17:02:05 Verbose | Step "Approve" runs only when all previous steps succeeded; skipping
|
| Canceled: Step 4: Swap Slots
17:02:05 Verbose | Step "Swap Slots" runs only when all previous steps succeeded; skipping
|