0

Whenever we get the error "Role Instances are taking longer than expected". The only possible options to do are .

  • Shutdown the emulators and try again.
  • Restart the machine and see if that helps.
  • Uninstall the Azure Tools for that version.

Some times uninstalling the same takes a long time,some times even days. It appears that some process or service is blocking the same. Has anyone faced this before ? If yes does anyone know which process would be blocking the same?

Viswas Menon
  • 310
  • 3
  • 11
  • I've seen this behavior when I have startup tasks. Especially valid when you enable `Cache` for some of the roles. For local dev/test scenarios I highly recommend commenting out all startup tasks. – astaykov Jun 28 '13 at 05:54
  • We upgraded our OS to windows 8 and also are using the latest version of Azure , post of 2.0 we have not seen this issue. – Viswas Menon Jun 02 '15 at 06:42

3 Answers3

2

When an instance starts it will run the OnStart method on the worker/web role (depending on your service type). The more stuff you have in there, the more time it will take to start up the role. Common caveats are the Cache as mentioned and blob/table storage (if you do read/write/create when you start the role).

Try minimizing the OnStart's workload and moving any storage stuff in async tasks.

dqm
  • 1,190
  • 3
  • 12
  • 19
  • thanks, I tried commenting out all the startup tasks specified in the csdef file and deploying the project. This did not help and still getting the dreaded "Role instances are taking longer than expected" error. – Viswas Menon Jul 09 '13 at 04:07
  • This issue no longer seems to be there in Azure 2.2, I have upgraded the OS to win 8.1 , Also visual studio has been upgraded to VS2013 – Viswas Menon Apr 09 '14 at 06:02
  • 1
    The above said solution had worked at time, When we comment out all the start up tasks, The azure role does startup in the emulator, Hence marking the same as an answer – Viswas Menon Jun 10 '14 at 04:19
1

I have had similar problems as well in the past

IISConfigurator could not map the web roles in IIS. In my case it was due to corrupted file system ACLs on the code directory. See logs under C:\Users\YOUR_USER_NAME\AppData\Local\dftmp\IISConfiguratorLogs\

Another cause might be that something else has tied up the Port Numbers that Azure is trying to bind your web role on. Or that the ports that the local storage needs for tables/blobs and queues (10000-10002) have been taken by another app. Open a command prompt and run netstat -anb

Eoin Campbell
  • 43,500
  • 17
  • 101
  • 157
  • Thanks, tried this option but that didnot resolve the issue on my machine, The IIS logs did not give any useful information. The Storage emulator started properly. – Viswas Menon Jul 09 '13 at 04:01
-1

Try running the Visual Studio using "Run as Administrator" option.

dinesh782
  • 15
  • 3
  • 1
    Azure projects , Can only be run in administrator mode. – Viswas Menon Jun 03 '15 at 12:03
  • In Windows 7/8 Visual Studio by default does not start in Administrator mode, developers needs to use the "Run As Administrator" option. To run the Visual Studio as Administrator without right click, select/check the "Run As Administrator" option for the Visual Studio shortcut in "Advanced Properties". – dinesh782 Jun 22 '15 at 06:37