Loading...

How to troubleshoot startup task failure in the Classic Cloud Service?

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.

 

Jay_Gong_0-1651037185117.png

 

If not, you could enable it in easy way over Remote Desktop blade, then get back to above step.

 

Jay_Gong_1-1651037185128.png

 

Next, you could check processes status in the Task Manager---Details tag after logging into role instance.

 

Jay_Gong_2-1651037185132.png

 

Jay_Gong_3-1651037185133.png

 

Based on Windows Azure Role Architecture, WaHostBootstrapper process is responsible for startup tasks specifically.

 

Jay_Gong_4-1651037185164.png

 

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.

 

Jay_Gong_5-1651037185166.png

 

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.

 

Jay_Gong_6-1651037185172.png

 

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.

 

Jay_Gong_1-1651037412865.png

 

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.

 

Jay_Gong_8-1651037185183.png

 

Jay_Gong_9-1651037185185.png

 

Published on:

Learn more
Need help with this product?

We 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.

Azure PaaS Blog articles
Azure PaaS Blog articles

Azure PaaS Blog articles

Share post:

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...

1 year ago

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...

1 year ago

[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...

1 year ago

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 ...

1 year ago

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 ...

1 year ago

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...

1 year ago

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...

2 years ago

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...

2 years ago

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...

2 years ago

[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...

2 years ago

Newsletter

Get the latest Dynamics 365 and Power Platform content in your inbox

A curated digest of community blogs, product news, videos, and podcasts — delivered without the noise.

Weekly updates Unsubscribe anytime Fresh community picks
We use your email only for the newsletter and you can unsubscribe at any time.
By subscribing, you agree to the privacy policy.