Orleans: AzureClient initialization timed out

Created on 2 Dec 2016  路  7Comments  路  Source: dotnet/orleans

Hi. I started learning Orleans through a personal project. In my project, i have a Azure Cloud Service project with a WebApi as the Orleans client (Web role), very similar to the TicTacToe sample. Just like the TicTacToe sample, the AzureClient initialization is done in the Application_Start method of the HttpApplication class, in the file Global.asax.cs, but i'm getting a timed out error. Just to test if the problem was only in my project, i opened the AzureWebSample, commented the AzureClient initialization that is done in the Page_Load method of the Page class, moved to the Application_Start method of the HttpApplication class too, and i'm getting the error same as my project:

image

Code of the Application_Start method:

// Code that runs on application startup
if (RoleEnvironment.IsAvailable)
{
      // running in Azure
      AzureClient.Initialize(AzureClient.DefaultConfiguration());
}
else
{
      // not running in Azure
      GrainClient.Initialize(ClientConfiguration.LocalhostSilo());
}

Question: What i'm missing? I'm still figuring it out what is wrong with the code.

Thanks in advance.

bug

Most helpful comment

I was able to repro it and it and it turns out that the WebSite and the WorkerRole project is conflicthing because of this setting in the OrleansAzureSample.ccproj file:

<UseIISExpressByDefault>False</UseIISExpressByDefault>

If you remove this line F5 debugging will work as it works for TicTacToe sample.

My thinking is that it is used by VS to see what process it should attach to, but since this is false it is somehow waiting for the new website to be launched by IIS, but since the Web project is configured to use IIS Express by default this "match" will never happen.

Since it only affects the debugging of the Application_Start method this is not came up.

I'm fixing this in the sample code to make sure others will not hit it.

Thanks for revealing the problem.

All 7 comments

Hello! Any thoughts? Someone could give me a guidance over this issue?

Thanks in advance.

Hello!

Is this happening when trying to locally debug the project using cloud simulator? or when debugging the service in Azure?

This error shows me that you've issue with debugging and not the app itself, beside that it is an Orleans project I don't know how it is connected to Orleans, but I'm trying to help you ;-)

  • Is the app working, just debugging does not work?
  • What version of Azure tools for VS you've installed? (suggesting to update to the latest).
  • I assume you're using VS2015 with Update 3, is that right?

This is the latest docs on how to debug a cloud service locally and in the cloud can be found here: https://docs.microsoft.com/en-us/azure/vs-azure-tools-debug-cloud-services-virtual-machines

Please try/verify the steps mentioned in the docs then get back to us with the results.

Hi @attilah, thanks for the reply.

Is this happening when trying to locally debug the project using cloud simulator?

Yes.

Is the app working, just debugging does not work?

Yes, it's working. The project is the AzureWebSample from the samples repository. This is happening when i move the code of the AzureClient initialization from the Page_Load method to the Application_Start method, just like the TicTacToe sample, but the TicTacToe sample is debugging just fine, normally. That's why i don't understand this issue.

What version of Azure tools for VS you've installed? (suggesting to update to the latest).

Is the latest version up to now (Azure App Service Tools v2.9.6).

I assume you're using VS2015 with Update 3, is that right?

I'm using the VS Comunnity 2017 RC.

Please try/verify the steps mentioned in the docs then get back to us with the results.

I checked the steps to debug the cloud service on my local computer. The Compute and Storage Emulators are running, should work normally.

Could you try to reproduce the issue, modifying the AzureWebSample like i did?

image

image

Thanks in advance.

Sure, will do that!

I was able to repro it and it and it turns out that the WebSite and the WorkerRole project is conflicthing because of this setting in the OrleansAzureSample.ccproj file:

<UseIISExpressByDefault>False</UseIISExpressByDefault>

If you remove this line F5 debugging will work as it works for TicTacToe sample.

My thinking is that it is used by VS to see what process it should attach to, but since this is false it is somehow waiting for the new website to be launched by IIS, but since the Web project is configured to use IIS Express by default this "match" will never happen.

Since it only affects the debugging of the Application_Start method this is not came up.

I'm fixing this in the sample code to make sure others will not hit it.

Thanks for revealing the problem.

Fixed in #2495

Wow, shame on me... I compared both samples WebRole and WorkerRole csproj's and forgot the ccproj... Thanks @attilah for figuring it out.

Best regards.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gabikliot picture gabikliot  路  4Comments

Vlad-Stryapko picture Vlad-Stryapko  路  3Comments

jdom picture jdom  路  3Comments

scharada picture scharada  路  3Comments

Liversage picture Liversage  路  4Comments