[Question]: What is the cause of the instability of deploying to an environment?
Question
The deploy to environments step and "Publish To Environment" action seem to be very unstable. I have an artefact package that contains several apps. The deployment fails frequently, 8 of the last 10 runs (CI/CD or Publish to Environment) It may happen on the first app, the 3rd or in this case the 4th. All with the same error in the installation status is:
Operation was not found. The job for id '00000000-0000-0000-0000-000000000000' was not found. - Job Id : 00000000-0000-0000-0000-000000000000
The pipeline log is attached. job-logs.txt
Also seeing this frequently now - interestingly only seems to be the Production environment for me, my QA and FAT seem to work ok
@freddydk Any feedback on this?
Not yet - trying to get a repro scenario up running so that I can troubleshoot this.
Managed to get a repro yesterday. The scenario involved used 11 AppSource Apps and 16 PTEs. My repro script was follows:
$allApps = @(
"C:\...\app1.app"
"C:\...\app2.app"
etc
)
$ErrorActionPreference = 'stop'
$environment = "<environment>"
if (-not (Get-Variable 'bcAuthContext')) {
$bcAuthContext = New-BcAuthContext -includeDeviceLogin
}
$ptes = @()
$bcauthcontext = Renew-BcAuthContext $bcauthcontext
$allApps | ForEach-Object {
$appJson = Get-AppJsonFromAppFile -appFile $_
if ($appJson.idRanges.from -lt 100000) {
$ptes += $_
}
else {
Write-Host "$($appJson.publisher)_$($appJson.name)"
Install-BcAppFromAppSource -bcAuthContext $bcauthcontext -environment $environment -languageId 'en-US' -appId $appJson.id -installOrUpdateNeededDependencies -acceptIsvEula
}
}
$bcauthcontext = Renew-BcAuthContext $bcauthcontext
Publish-PerTenantExtensionApps -bcAuthContext $bcauthcontext -environment $environment -appFiles $ptes
When creating a brand new environment and running this script - it failed on the 5th PTE in the first attempt with a protocol violation on the server. I have fixed the publishing to ignore this error and I could run the above script 6 times with new environments and all was successful.
I expect that this should handle the instabilities described in this issue as well.
Thanks Freddy.