question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failure when running swap slot task due to task using unexpected parameter during execution

See original GitHub issue

Type: BUG

Enter Task Name: Swap slots

Environment

  • Server - Azure Pipelines
  • Agent - Private (2016 Data center, agent version: 2.155.1)

Issue Description

We have began to encounter the following issue with release pipelines using the “Swap slots” task. This has only started happening today, with all previous releases working as expected without any pipelines updates.

The “Swap slots” task is failing with the following message:

2019-09-24T09:02:11.3402222Z ##[section]Starting: App : Swap Slot
2019-09-24T09:02:11.3581484Z ==============================================================================
2019-09-24T09:02:11.3581617Z Task         : Azure App Service manage
2019-09-24T09:02:11.3581712Z Description  : Start, stop, restart, slot swap, slot delete, install site extensions or enable continuous monitoring for an Azure App Service
2019-09-24T09:02:11.3581840Z Version      : 0.2.59
2019-09-24T09:02:11.3581907Z Author       : Microsoft Corporation
2019-09-24T09:02:11.3582013Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/deploy/azure-app-service-manage
2019-09-24T09:02:11.3582102Z ==============================================================================
2019-09-24T09:02:12.0901116Z ##[error]Error: Failed to fetch App Service 'sample-app-$(arm.siteSlotName)' details. Error: The Resource 'Microsoft.Web/sites/sample-app/slots/$(arm.siteSlotName)' under resource group 'sample-app-rg' was not found. (CODE: 404)
2019-09-24T09:02:12.0939769Z ##[section]Finishing: App : Swap Slot

The error includes a variable $(arm.siteSlotName) that is not defined anywhere in the visible UI, however when exporting the pipeline and searching I have discovered the following:

{
    "environment": {},
    "taskId": "f045e430-8704-11e6-968f-e717e6411619",
    "version": "0.*",
    "name": "App : Swap Slot",
    "refName": "",
    "enabled": true,
    "alwaysRun": false,
    "continueOnError": false,
    "timeoutInMinutes": 0,
    "definitionType": "task",
    "overrideInputs": {},
    "condition": "succeeded()",
    "inputs": {
        "ConnectedServiceName": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "Action": "Swap Slots",
        "WebAppName": "$(arm.app_siteName)",
        "SpecifySlot": "true",
        "ResourceGroupName": "$(rg.name)",
        "SourceSlot": "$(arm.app_siteSlotName)",
        "SwapWithProduction": "true",
        "TargetSlot": "",
        "PreserveVnet": "false",
        "Slot": "$(arm.siteSlotName)",
        "ExtensionsList": "",
        "OutputVariable": "",
        "AppInsightsResourceGroupName": "",
        "ApplicationInsightsResourceName": "",
        "ApplicationInsightsWebTestName": ""
    }
}

Within this snippet the task action is Swap Slots, with the parameter SourceSlot shown in the UI and completed correctly. However, the Slot parameter is also listed and completed with a different variable. This is the case because we frequently copy and clone tasks within a pipeline and alter the action and update the parameters. I would appear that a recent update is causing the “Swap slots” task to fail due to this extra parameter not related to its own action:

image

If I change only the action for this task the following is displayed:

image

In order to workaround/fix this issue we have had to manual alter each task, switch the action, delete the value in Slot and re-save the pipeline.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Philocommented, Dec 4, 2019

Thank you @eaarora-ms

0reactions
eaarora-mscommented, Nov 28, 2019

The issue is fixed and will be rolled out in a couple of weeks. I hope this is not a blocker for you since you can remove and add the task again to get rid of the old slot name value.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error when I swap slots using Azure Release Pipeline
I deployed to my staging slot using the "Azure Web App" task, and (for both of these tasks) I specified an Azure Subscription...
Read more >
Set up staging environments - Azure App Service
When you're ready to complete the pending swap, select Complete Swap in Swap action and select Complete Swap. To cancel a pending swap,...
Read more >
Most common deployment slot swap failures and how to fix them
Failures during these steps are the most common reasons for the overall failure of the swap operation.
Read more >
AWS Support – Knowledge Center
Learn about some of the most frequent questions and requests that we receive from AWS Customers including best practices, guidance, and troubleshooting ...
Read more >
Changelog — Python 3.11.1 documentation
StreamReaderProtocol to keep a strong reference to the created task, ... gh-90081: Run Python code in tracer/profiler function at full speed.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found