Deployed WCF in Windows Azure, BUT, One or more role instances are unhealthy. 1 Instance: 1 Unhealthy: Recycling (Stabilizing role... Unhandled Exception: System.NullReferenceException ?
Hi Forum,

We have created a WCF service which is working correctly and we deployed it into a Web Role in Windows Azure, and its URL is e.g.: (http://OurService.cloudapp.net/OurService.svc). 

The problem is, When my colleague uses his machine and publishes the service using Visual Studio (Right Click > Publish), Everything works perfectly fine.

BUT, If I am using my machine and I tried to publish exactly the same service (Same source code) using Visual Studio (Right Click > Publish), The deployment gets completed successfully.

Nevertheless, After a few seconds when I check Windows Azure portal, I see that in the Cloud Services section, The WCF status is "! Running", and when I open its Dashboard it states: One or more role instances are unhealthy. 1 Instance: 1 Unhealthy: Recycling (Stabilizing role... Unhandled Exception: System.NullReferenceException [2013-09-29T19:29:30Z])

Why this is happening? I and my colleague have exactly the same source code, But we use different machines.

I checked the following things:

1) I checked and I can confirm that there are not any missing references.

2) I followed this article: (http://blogs.msdn.com/b/avkashchauhan/archive/2011/04/05/wcf-web-role-deployment-with-fixed-ip-address-port-will-cause-error-after-deployment.aspx), and yes, I am using: "Auto-assign Port".

3) I followed this article: (http://blogs.staykov.net/2009/12/windows-azure-role-stuck-in.html), and yes, I set Copy Local: True.

4) Also, I added Sandrino Di Mattia's code as explained on this thread: (http://stackoverflow.com/questions/13703908/autostart-a-wcf-on-azure-webrole).


Nothing has worked at all, and I am still encountering the same issue.


So, Could you please help me out to resolve this issue ?

I would greatly appreciate your inputs !
September 29th, 2013 4:03pm

Hi,

From my experience, I recommend you to check the Azure SDK version (click Visual Studio HELP menu>click About Microsoft Visual Studio), if the two machine has the same SDK, we can try to use Diagnostics to log the error message. Refer to http://www.windowsazure.com/en-us/develop/net/common-tasks/diagnostics/ for more information about how to use Diagnostics.

There are some familiar scenario may give you some advice http://blogs.msdn.com/b/kwill/archive/2013/08/20/troubleshooting-scenario-1-role-recycling.aspx

Hope this helps

Free Windows Admin Tool Kit Click here and download it now
September 30th, 2013 2:33am

Hi

We had the same issue where build was working when deployed from one machine and not when deployed from another.

We had two issues due to which this was happening:-

1. Yes, there was a mismatch in the code and DLL reference

2. The web role has different configuration on both the machine.

Would highly recommend to double double check the code and DLL references first and second that your web role has the same configuration as the one from where the build is working. I am sure you will find something there.

Hope this helps !!

September 30th, 2013 7:08am

Thank you so much Jambor yao!

You are right. Indeed, I was using SDK 2.1 while my colleague uses 2.0. After I switched back to 2.0 it seems it is running OK.


Free Windows Admin Tool Kit Click here and download it now
October 1st, 2013 1:23pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics