Azure Pipelines: "##[warning]Can't find loc string for key: KuduStackTraceURL"
This warning is easy to take for the reason a deployment failed, because it sits right next to the failure. It only means that a task wanted to print a message and could not find the text of that message. Something else failed, and its ##[error] line is the one to read.
What it looks like
##[warning]Can't find loc string for key: KuduStackTraceURL ##[error]Error: Failed to deploy web package to App Service.
- The key changes with the task:
KuduStackTraceURLin App Service and Azure Functions deployments,CorrelationIdForARMin Azure Resource Manager steps,TerraformPlanFailed,Info_GotAndMaskAuthin the npm task, and others. - The Stack Overflow questions about it in Azure DevOps have been opened about 41,000 times together, the most viewed (KuduStackTraceURL) about 18,000.
When the pipeline is a pull request's build validation, the pull request waits on it: Azure DevOps Pull Requests, a plugin for JetBrains IDEs, lists the pull request's branch policies with their state in IntelliJ IDEA, Rider or PyCharm, and with Pro runs a failed build policy again once the cause is fixed. Its Pipelines tab (version 1.0.86 and later) lists the runs of the repositories you have open and opens a failed task's log in the editor, free to read.
Where it comes from
Tasks write their messages by key, with the texts in the task's resource file. In the loc function of Microsoft's azure-pipelines-task-lib, a key that is not among the loaded texts produces exactly this warning, and the function then uses the key itself as the text, with the values after it. So:
- The warning does not fail the step. A step that fails with it has an error of its own.
- The message you would have read is still in the log, as the bare key followed by its values. The key's name usually says what it was about:
KuduStackTraceURL, a link to the stack trace in Kudu, the App Service deployment service;CorrelationIdForARM, the ID of the Azure Resource Manager request. - It is a mismatch inside the task (often a shared library that the task's resource file does not cover), not something in your YAML. A form starting "Resource file haven't been set" means the task never loaded its texts at all.
What to do, by key
| Key | Usually next to | Look at |
|---|---|---|
| KuduStackTraceURL | A failed App Service or Functions deployment. | The ##[error] line and the deployment's log in Kudu. Common causes are on Failed to deploy web package to App Service and Package deployment using ZIP Deploy failed. In one answer, restarting the function app and running the pipeline again was enough; in another, an access token had changed. |
| CorrelationIdForARM | App Service and ARM template steps, many times per step, seen from December 2019. | In issue 11996 the fix was reported as merged and being deployed. If a release with it fails, the failure is in its ##[error] line, often the deployment itself. |
| TerraformPlanFailed | terraform plan returned an error. | Terraform's own output above it: a missing variable, a provider or backend error. |
| Info_GotAndMaskAuth | Npm@1, for example npm audit, with the build not affected. | Nothing to fix in your project. An answer runs the command in a script: step instead to get rid of it. |
In another question the warning came with a failing FileTransform@1: its folderPath pointed to a .zip that a later step created. The accepted answer moved the transform after the publish step, or pointed it at the folder with the file.
When the error line is not enough
- Run the pipeline again with verbose logs (
system.debugset totrue), which shows the requests the task makes. - If the warnings themselves are what you want gone, report the key and the task's version on the azure-pipelines-tasks issues, where the CorrelationIdForARM one was fixed.
Azure DevOps pull requests in IntelliJ IDEA, Rider and PyCharm
Azure DevOps Pull Requests, a plugin by Lesstep for JetBrains IDEs 2024.1 or later and Android Studio, reads the organization, project and repository from your git remote and lists the pull requests that wait for your review in an IDE tool window, on Azure DevOps Services and on Azure DevOps Server. It shows the branch policies of a pull request with their state, so a required build that has not passed is next to its pull request, and with Pro you run a failed or expired build policy again from there. The review inbox is free; voting, commenting, completing and creating are Pro, with a 30-day trial.
Get it on JetBrains Marketplace
Azure DevOps and Azure Pipelines are trademarks of Microsoft Corporation; IntelliJ IDEA, Rider and PyCharm are trademarks of JetBrains s.r.o. This page is not affiliated with or endorsed by Microsoft or JetBrains.
More: Failed to deploy web package to App Service · Package deployment using ZIP Deploy failed · Bash exited with code 1 · 日本語