Skip to content

Fix for #193 ConflictError: The extension ID xxx-PaasDiagnostics-Production-Ext-0 is already in use for this deployment #361

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 19, 2015

Conversation

PashaPash
Copy link
Contributor

Fixed #193: Conflict error in Set-AzureServiceDiagnosticsExtension when executed after a VIP swap.

A code in ExtensionManager.InstallExtension is trying to cleanup old unused extension before uploading a new one. It check for extension usage by iterating though pool of predefined names with the following pattern: Default-PaaSDiagnostics-<slot>-Ext-<num> where <slot> is the target deployment slot. The problem is that extension configuration is persisted during the VIP swap, so Default-PaaSDiagnostics-Staging-Ext-0 could be bound to active deployment in Production slot and vice versa.

Steps to reproduce the issue:

  • Upload new Staging deployment
  • Enable diagnostics for Staging slot. Default-PaaSDiagnostics-Staging-Ext-0 name will be assigned to new config for staging.
  • Perform VIP swap.
    Staging will became Production, but retain Default-PaaSDiagnostics-Staging-Ext-0 as active diagnostics config.
  • Upload a new Staging deployment.
  • Try to enable diagnostics for Staging slot.
  • ExtensionManager.InstallExtension finds no association between current staging and Default-PaaSDiagnostics-Staging-Ext-0 and tries to delete it.

Deletion fails as Default-PaaSDiagnostics-Staging-Ext-0 is used by Production Slot.

I changed ExtensionManager.InstallExtension to check both Staging and Production for extension usage, so it no longer tries to drop the extension used by another slot. ExtensionIdLiveCycleCount increased to 3 to allow one extra extension to be associated with another slot after VIP swap.
Fix is done for Set-AzureServiceDiagnosticsExtension, but similat fix should fix the same problem for RDP and AD extensions.

Existing AzureServiceDiagnosticsExtensionTest and related helpers were updated to use AzureStorageContext - old code that used storage name only was slightly out of date.

HelloNoDiag.cspkg is a minimal cloud service package required by tests that mentions nodiagpackage.csv, seems to be missing after initial code import to github.

PashaPash added 2 commits May 4, 2015 14:28
…0 is already in use for this deployment" for Set-AzureServiceDiagnosticsExtension after VIP Swap.
@azuresdkci
Copy link

Can one of the admins verify this patch?

@azurecla
Copy link

azurecla commented May 4, 2015

Hi @PashaPash, I'm your friendly neighborhood Azure Pull Request Bot (You can call me AZPRBOT). Thanks for your contribution!

In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement. It's all electronic and will take just minutes. I promise there's no faxing. https://cla.azure.com.

TTYL, AZPRBOT;

@azurecla
Copy link

azurecla commented May 4, 2015

@PashaPash, Thanks for signing the contribution license agreement so quickly! Actual humans will now validate the agreement and then evaluate the PR.

Thanks, AZPRBOT;

@hovsepm
Copy link
Contributor

hovsepm commented May 5, 2015

@azuresdkci add to whitelist

@amarzavery
Copy link
Contributor

@singhkay , @huangpf - Can you please review the PR?

@huangpf
Copy link
Contributor

huangpf commented May 5, 2015

+@hyonholee

@markcowl
Copy link
Member

@hyonholee @sighkay @huangpf can you please review this PR

@azuresdkci add to whitelist

@markcowl
Copy link
Member

@azuresdkci retest this please

ogail added a commit that referenced this pull request May 19, 2015
Fix for #193 ConflictError: The extension ID xxx-PaasDiagnostics-Production-Ext-0 is already in use for this deployment
@ogail ogail merged commit 3d88c8c into Azure:dev May 19, 2015
@baywet
Copy link
Member

baywet commented Aug 7, 2015

This fix doesn't seem to be in the bits of the August release, can anybody tell me in which version this will be included?

@huangpf
Copy link
Contributor

huangpf commented Aug 7, 2015

@PashaPash @devigned
Could you please help check it again, and involve the DA team if necessary, as we also got several reports from our side about the DA extension cmdlets? Thanks.

@PashaPash
Copy link
Contributor Author

@huangpf integration test for this PR - VipSwapWithDiagnosticsExtensionTest - passes on v0.9.6-August2015 tag (d67cd34), so it seems to be different issue. @baywet could you please provide the exact steps to reproduce it?

@baywet
Copy link
Member

baywet commented Aug 8, 2015

@PashaPash thanks for your reply. I've got my project on visual studio online, used the cloud service deployment model with build 2015 (also commented on the linked issue on the other project).
When I enable the diagnostics on one or more roles I've this error message. I'm using a custom build machine (not the hosted one). It has vs2013 update 5, vs 2015 RTM, WS2012R2 (up to date), both azure sdk's 2.7, azure ps 0.9.6, ms office sdk (latest version) and SharePoint 2010, 2013 bits. I can also try on the hosted build controller if you think that could make a difference.

@PashaPash
Copy link
Contributor Author

@baywet Could you please provide exact steps to reproduce the issue (some minimum sequence of commands to make it crash)? Or at least the output of Get-AzureServiceDiagnosticsExtension for both slots right after the crash?

@baywet
Copy link
Member

baywet commented Aug 19, 2015

2015-08-18T23:57:57.9122458Z Executing the powershell script: C:\agent\tasks\AzureCloudPowerShellDeployment\1.0.13\Publish-AzureCloudDeployment.ps1

2
2015-08-18T23:57:58.3028793Z Looking for Azure PowerShell module at C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement\Azure\Azure.psd1

3
2015-08-18T23:57:58.6779022Z AzurePSCmdletsVersion= 0.9.6

4
2015-08-18T23:57:58.6779022Z Get-ServiceEndpoint -Name -Context Microsoft.TeamFoundation.DistributedTask.Agent.Worker.Common.TaskContext

5
2015-08-18T23:57:58.6779022Z subscription= Azure Subscription:
6
2015-08-18T23:57:58.6779022Z Get-X509Certificate -CredentialsXml

7
2015-08-18T23:57:58.7091533Z azureSubscriptionId=

8
2015-08-18T23:57:58.7091533Z azureSubscriptionName= Azure Subscription:
9
2015-08-18T23:57:58.7091533Z azureServiceEndpoint= https://management.core.windows.net/

10
2015-08-18T23:57:58.7247805Z Set-AzureSubscription -SubscriptionName Azure Subscription: -SubscriptionId -Certificate -CurrentStorageAccountName attribute -Environment AzureCloud

11
2015-08-18T23:57:58.7247805Z Select-AzureSubscription -SubscriptionId
12
2015-08-18T23:57:58.7560224Z ConnectedServiceName=

13
2015-08-18T23:57:58.7560224Z ServiceName= attributeworkerroles

14
2015-08-18T23:57:58.7560224Z ServiceLocation= East US

15
2015-08-18T23:57:58.7560224Z StorageAccount= attribute

16
2015-08-18T23:57:58.7560224Z CsPkg= C:\agent_work\19f2c445\staging*.cspkg

17
2015-08-18T23:57:58.7560224Z CsCfg= C:\agent_work\19f2c445\staging*.cscfg

18
2015-08-18T23:57:58.7560224Z Slot= Staging

19
2015-08-18T23:57:58.7560224Z AllowUpgrade= true

20
2015-08-18T23:57:58.7716609Z Find-Files -SearchPattern C:\agent_work\19f2c445\staging*.cscfg

21
2015-08-18T23:57:58.7716609Z serviceConfigFile= C:\agent_work\19f2c445\staging\ServiceConfiguration.CloudStaging.cscfg

22
2015-08-18T23:57:58.7716609Z Find-Files -SearchPattern C:\agent_work\19f2c445\staging*.cspkg

23
2015-08-18T23:57:58.7716609Z servicePackageFile= C:\agent_work\19f2c445\staging\AttributeOnline.Azure.cspkg

24
2015-08-18T23:57:58.7716609Z Get-AzureService -ServiceName attributeworkerroles -ErrorAction SilentlyContinue

25
2015-08-18T23:58:04.6575482Z Applying any configured diagnostics extensions.

26
2015-08-18T23:58:08.8695358Z New-AzureServiceDiagnosticsExtensionConfig -Role AttributeOnline.DocumentLibrariesWorker -StorageContext -DiagnosticsConfigurationPath C:\agent_work\19f2c445\staging\Extensions\PaaSDiagnostics.AttributeOnline.DocumentLibrariesWorker.PubConfig.xml

27
2015-08-18T23:58:09.7622560Z Get-AzureDeployment -ServiceName attributeworkerroles -Slot Staging -ErrorAction SilentlyContinue

28
2015-08-18T23:58:12.6918126Z Set-AzureDeployment -Upgrade -ServiceName attributeworkerroles -Package C:\agent_work\19f2c445\staging\AttributeOnline.Azure.cspkg -Configuration C:\agent_work\19f2c445\staging\ServiceConfiguration.CloudStaging.cscfg -Slot Staging -ExtensionConfiguration

29
2015-08-18T23:58:15.8383004Z ##[error]BadRequest: The extension ID AttributeOnlineDocumentLibrariesWorker-PaaSDiagnostics-Staging-Ext-0 is invalid.

@baywet
Copy link
Member

baywet commented Aug 19, 2015

huangpf added a commit to AzureRT/azure-powershell that referenced this pull request Jan 27, 2016
HPF PR: dev <- Azure:dev
markcowl added a commit to markcowl/azure-powershell that referenced this pull request Sep 25, 2017
Nullify default NetworkSecurityRules if absent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants