Role instances are taking longer than expected to start - Is there a new solution to this problem?
Asked Answered
T

13

24

I've rebooted my computer 50-100 times this week. I find I can start / deploy locally usually 3-4 times before getting this message:

"Windows Azure Tools for Microsoft Visual Studio

Role instances are taking longer than expected to start. Do you want to continue waiting?"

The solution to get me going again is rebooting.

I know it's not a new problem. I recall that MS agreed it was a problem but does anyone have a solution that does not involve going back to the Hosted Web Core. Seems like this problem is something a lot of people get and it's been around without a resolution (that I know of) for 4-5 months or more.

Now I'll get back to doing another reboot !!!!!

Transceiver answered 13/8, 2011 at 14:49 Comment(4)
I've never heard of (or experienced) this... do you have any more info that you got from Microsoft about this? (Maybe a thread with support or something?) If so, I can try to track down the bug and see what's happening.Pipsissewa
Do you need to use Full IIS for Dev? I've got multiple configurations - I use HWC for Dev and Full IIS for Test/Production and find life rather easier.Malita
@smarx - I will have a look to see what I can find. I did see it mentioned in a few places on the web and even saw a comment from MS saying it was a known issue. It's a big problem for me. As I type this I can see the VS icon flashing yellow. I know what that means :-(Transceiver
This request operation sent to net.pipe://localhost/iisconfigurator did not receive a reply within the configured timeout (00:01:00). The time allotted to this operation may have been a portion of a longer timeout. This may be because the service is still processing the operation or because the service was unable to send a reply message. Please consider increasing the operation timeout (by casting the channel/proxy to IContextChannel and setting the OperationTimeout property) and ensure that the service is able to connect to the client.Transceiver
H
15

I had this same problem, but could eventually get it to start after dismissing 2 or 3 of the

"Role instances are taking longer than expected to start"

message boxes.

I then found that the problem seemed to be that the Diagnostics were enabled and the storage account was set to something invalid in the Role configuration (.cscfg).
Solved it by going into the UI and disabling diagnostics, I found it would run ok.

To get the UI, right click on the created Role inside the Roles folder in the Solution Explorer.

enter image description here

Then I re-enabled Diagnostics and it auto-populated "UseDevelopmentStorage=true", and this seems to work fine.

Halt answered 1/9, 2011 at 12:5 Comment(0)
O
15

From what I understand, there are a few different things that can cause this issue.

For me, I encountered this error after I created a Windows Identity Foundation Startup Task for my Azure deployment and then tried to run my application using the Azure Emulator.

Basically, all I needed to do was change the taskType of the Startup Task from simple to background

ServiceDefinition.csdef

<Startup>
  <Task commandLine="Startup\IdentityGac.cmd" executionContext="elevated" taskType="background"></Task>
</Startup>

Based on your question, I'm not sure if this applies to your project, but I figured it would at least be worth mentioning.

You can read my full blog post here.

Onstage answered 23/4, 2012 at 18:30 Comment(1)
This answer pointed me in the right direction. In my case, I can't make the task "background" because it must be executed before my web role starts. Instead I added "exit /B 0" at the end of my .cmd file. Azure will not proceed with the startup if any "simple" task exits with a non-zero errorlevel.Unscrupulous
R
9

A new cause for this problem was introduced in Feb 2016.

Using Windows 8.1, Visual Studio 2012 Update 5 and Azure Emulator 2.3

Installing this windows update: KB3126593 will leave you in a situation where the emulator will never start and you'll see this in the Emulator UI.

enter image description here

Uninstalling the update fixes the emulator.

Control Panel > All Control Panel Items > Programs and Features > Installed Updates

Security Update for Microsoft Windows (KB3126593), right-click, uninstall.

(Upgrading to Windows 10 also solves the problem.)

Riccio answered 12/2, 2016 at 18:10 Comment(3)
Thanks! I wonder, how did you find out that it was related to Windows Update?Crossstitch
4 out of 5 of my colleagues had the issue, the one who had no issue had disabled automatic updates. We had a fun afternoon uninstalling updates until we found the problemRiccio
I was having the same trouble, and uninstalling this update fixed the issue for me. Thank you so much!Charlatanry
B
4

I was also facing the same issue. From looking into the Emulator UI I found that it was trying to read some date from storage area and was failing.
So what I did, I went to location %appdata%\local and deleted all data from folders
1. DevelopmentStorage
2. dftmp

After that restarting the service, every thing started working

Broadway answered 22/10, 2013 at 9:45 Comment(1)
This one worked for me (for several hours so far, anyway) but just had to delete \AppData\Local\dftmpLeathery
D
2

For me, the problem was related to caching. The problem started with a warning that said something like, "unable to install cache....exe," but I only saw the error once. After that, the emulator stalled every time. After reading this blog I tried disabling and then re-enabling caching, which fixed the problem.

After I some further investigation I found that the critical issue was this entry in ServiceConfiguration.Local.cscfg:

      <Setting name="Microsoft.WindowsAzure.Plugins.Caching.ConfigStoreConnectionString" value="UseDevelopmentStorage=true" />

Previously this connection string had been pointing to a cloud storage connection.

Deadline answered 14/6, 2013 at 19:28 Comment(0)
E
1

In my experience this can happen if one of your roles does not stop when OnStop() is called. Look for WaWorkerHost.exe (I think). You might also try killing IisConfigurator.exe (or something like that). You know you've got the right process when your task manager list gets dramatically shorter :-)

Eba answered 23/4, 2012 at 23:9 Comment(0)
S
1

I encountered the same issue and found the following steps resolved it (I stumbled across this solution when applying the answer from @RobPotter above).

First, opene the ServiceDefinition.csdef file and added this entry:

<Import moduleName="Diagnostics" />

To the: ServiceDefinition / WebRole / Imports node.

Second, add the following diagnostics configuration setting to the necessary .cscfg files:

<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" />

under: ServiceConfiguration / Role / ConfigurationSettings for the web role.

FYI. My Service Definition value for schemaVersion is "2012-10.1.8". The issue may have arisen when I migrated my solution from SDK 1.7 to 1.8

Sherris answered 8/2, 2013 at 14:59 Comment(0)
N
0

I can't solve the problem after followed all the solutions above. Finally, I decided not to let it stop my coding any more, just changed the StartUp Project from the 'Cloud Project' to the 'WebRole Project', and F5, ... OK website runs properly on my IIS Express.

So, I think, if it can publish to Azure, and can debug website local, so just let it work in this way, until Microsoft make it easier to use.

(my AzureSDK is 2.0)

Nailhead answered 23/5, 2013 at 5:38 Comment(0)
P
0

Similar to answers above. I was running a startup script and it was running appcmd.exe, however, due to a mistake, the section I was trying to unlock caused an error, which made the roles fail to start.

I had used:

%windir%\System32\inetsrv\appcmd.exe unlock config /section:system.webServer/security

but this is an error and should have been

%windir%\System32\inetsrv\appcmd.exe unlock config /section:system.webServer/security/access

Putrescine answered 24/7, 2013 at 14:27 Comment(0)
G
0

For me, this only happened when I had the checkbox for "Enable Caching" selected. And for me, the problem was that I was running my project off of a UNC Share (actually its running in a VM on my macbook). When I'd start the debugger after checking the "Enable Caching" box on the worker role, it would just hang. Come to find out, about every 2 seconds it was creating a 160MB dump file in C:\Windows\System32\%LOCALAPPDATA%\CrashDumps. After debugging one of those, I could see the first error was when it tried to start cmd.exe on the caching stuff in my worker role and it said CMD cannot be run on a network share, so it would default to windows/system32 or something.

That's when I found this handy dandy 7 year old MS KB article: http://support.microsoft.com/kb/156276 When I added DisableUNCCheck REG_DWORD and set the value to 0 x 1 (Hex) under the registry path HKEY_CURRENT_USER\Software\Microsoft\Command Processor everything started up just like a champ. Hopefully this helps someone else.

Gramercy answered 23/9, 2013 at 20:11 Comment(0)
O
0

I have faced the same issue and spent lots of hours including checking all of the rest answers of this post. I just delete my application under the roles and again add webrole project in current solution. And working fine for me.

Obmutescence answered 21/4, 2015 at 14:45 Comment(0)
S
0

I had similar issue. I was executing an .cmd file to register a dependent DLL during the start of the debug session. The .CSDEF file looks like:

<ServiceDefinition name="WorkerRole.Azure" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2014-06.2.4">
    <WorkerRole name="SampleWorkerRole" vmsize="Small">
         <Startup>
               <Task commandLine="register.cmd" executionContext="elevated" taskType="simple" />
         </Startup>
     </WorkerRole>
</ServiceDefinition>

After starting the Visual Studio using "Run as Administrator" option, this issue did not occur. i was able to debug the application as usual.

Stasny answered 19/5, 2015 at 12:39 Comment(1)
I had same issue, "Run as Administrator" solved, In my .cmd, it try to copy a dll to "system32" folder.Churchwarden
L
0

My environment is: Windows Service 2012 R2 + VS 2013 Update 3 + Azure Tools 2.2

Uninstall Windows update KB3126593 works for me!!!

Lolitaloll answered 17/2, 2016 at 19:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.