How to troubleshoot startup task failure in the Classic Cloud Service?
In some certain situations, Cloud Service role instances might be slow to start, or they might be recycling or stuck with busy state so that the role instance fails to start as expected. The role application contains two parts that might cause such kinds of role instance recycling/busy issue: Startup Tasks and Role code (Implementation of RoleEntryPoint). In this document, I’m going to share troubleshooting guidance of Startup Tasks failure mainly. You could refer to following official documents regarding the initial configuration, execution and examples of Startup Tasks in Classic Cloud Service.
https://docs.microsoft.com/en-us/azure/cloud-services/cloud-services-startup-tasks
https://docs.microsoft.com/en-us/azure/cloud-services/cloud-services-startup-tasks-common
How to identify if the issue is caused by startup task?
If startup task is applied in your application, we might need to identity if it’s caused by startup task initialization or execution firstly when we encounter role recycling/busy issue.
First step is trying to RDP into the problematic role instance. You could get the RDP file via clicking following Connect button if you enabled RDP feature before.
If not, you could enable it in easy way over Remote Desktop blade, then get back to above step.
Next, you could check processes status in the Task Manager---Details tag after logging into role instance.
Based on Windows Azure Role Architecture, WaHostBootstrapper process is responsible for startup tasks specifically.
Hence if this process starts, but you don’t see the WaIISHost(for WebRole) or WaWorkerHost(for WorkerRole) processes start then it is most likely a startup task that is failing. Please kindly notice that this is applicable to simple and foreground task types, not for background. The reason is background startup tasks are executed asynchronously, in parallel with the startup of the role.
How to troubleshoot startup task failure?
1.Check WaHostBootstrapper log
You could find the log file from this path: C:\Resources\WaHostBootstrapper.log which is listed in this official document.
Then you could search if there is any Error or Exception regarding the Startup.cmd execution, especially to verify if the exited code equals 0 otherwise the startup task complete with errors. If there isn’t log related to existed code, it also means the startup task is still running.
2.Enable customize logging mechanism
Sometimes, Startup script can’t be rerun freely in the production environment due to expected business impact. Thus, except built-in WaHostBootstrapper log, adding customize log in the command line could be more significant for troubleshooting process.
You could output key information in the command of script like …..>>"%TEMP%\StartupLog.txt".
3.Manually trigger startup task
If you could observe execution exception from above step, the direct way is running this cmd file in the present environment to reproduce the issue. You could navigate to the local directory E:\approot\bin\Startup.cmd (for WebRole) or E:\approot\Startup.cmd(for WorkerRole) and run the command line manually to verify if it can be executed successfully. This might be helpful for narrowing down the issue.
Published on:
Learn moreWe can help you with How to troubleshoot startup task failure in the Classic Cloud Service?
If you want help implementing, troubleshooting, or improving this product, contact us and we’ll point you in the right direction.
Related posts
Azure Storage - TLS 1.0 and 1.1 retirement
Overview TLS 1.0 and 1.1 retirement on Azure Storage was previously announced for Nov 1st, 2024, and it was postponed recently to 1 year later...
Efficient Management of Append and Page Blobs Using Azure Storage Actions
Overview In Azure Storage, Blob Lifecycle Management (BLM) allows you to automate the management of your data based on rules defined by...
[Azure AI Search] Internal Server Error when creating CMK encrypted objects
Scenario Customers follow the Microsoft doc to create CMK encrypted objects (data source, index etc.), but get the 500 Internal Serv...
Optimizing Azure Table Storage: Automated Data Cleanup using a PowerShell script with Azure Automate
Scenario This blog’s aim is to manage Table Storage data efficiently. Imagine you have a large Azure Table Storage that accumulates logs from ...
Optimizing Azure Table Storage: Automated Data Clean-up using a PowerShell script with Azure Automat
Scenario This blog’s aim is to manage Table Storage data efficiently. Imagine you have a large Azure Table Storage that accumulates logs from ...
Restoring Soft-Deleted Blobs with multithreading in Azure Storage Using C#
Blob soft delete is an essential feature that safeguards your data against accidental deletions or overwrites. By retaining deleted data for a...
Performing simple Azure Table Storage REST API operations using curl command.
The blog provides guidance to perform simple Table Storage REST API operations such as Create table, Delete Table, Insert entity, Delete entit...
Bulk delete all the old jobs from the batch account
Deleting a Job also deletes all Tasks that are part of that Job, and all Job statistics. This also overrides the retention period for Task dat...
Utilizing Azure Storage and Runbooks for scheduled automated backups of Azure SQL Databases
In this article, we are going to provide detailed steps to create a scheduled Azure SQL Database backup to storage account using automation. T...
[Azure Service Bus] JMS messages getting dead-lettered
The article discusses a problem where numerous messages end up in the dead letter queue (DLQ) when the JMS service bus consumer connects to th...