WebRole fail to start: System.Runtime.Serialization.Seria lizationException

Hi everyone and sorry for my bad english...

I'm trying from several days to deploy my azure cloud service.  The solution contains 2 Webrole and 1 WorkRole.

1 WebRole and the WorkRole deploy, starts and works fine, while the other webrole fails to run every time i've tried.

My Cloud Service Dashboard -> Instances show:

- WebRole 1 : Running
- WorkRole : Running
- WebRole 2: Restarting (Role has encountered an error and has stopped. Unhandled Exception: System.Runtime.Serialization.SerializationException

From there, Webrole 2 keeps trying restart forever (alternating is status between "Busy" and Restarting with that exception).

Both Webroles use the same References (no exception), and all Reference of WebRole 1 match the version of WebRole 2.

Problems started after i upgraded my azure sdk to 2.5. Then i created a new solution with VS2013.

In local environment, everything works fine. But i cant deploy in staging or production environment.

I have no more ideas how to solve this and the exception is very few explicative. Any help is very appreciated


January 29th, 2015 7:26pm

Though there can be number of reasons behind this error, but mostly I have seen errors coming on role start up are due to the reference mismatch or missing references, you might want to make sure those once again and check their CopyLocal property too. (Storage related assemblies and their versions).

Are you using diagnostics related code on your role start up? Also make sure that the storage connection strings in the cscfg file of your application is pointing to the correct azure storage and not using local development storage.

Free Windows Admin Tool Kit Click here and download it now
January 30th, 2015 8:17am

During my attempts i have set all project references to "copy local: true", and got same exception again and again.

I'm not using any diagnostic code, all connection strings point the correct azure storage (not the dev one).


January 30th, 2015 12:17pm

So assume that the difference between the 2 web roles is in the code, not the configuration. If you take the code from web role 1 and put into web role 2, then it should run. If it doesn't, then you know there is still difference in the two configurations, then you can fix that (either duplicate web role 1 to be web role 2 or copy the configuration from 1 to 2). If it does run, you know something is wrong in your web role 2 code, especially in the startup portion, then you can fix that.
Free Windows Admin Tool Kit Click here and download it now
January 30th, 2015 8:21pm

@Bhushan and Frank, thanks for your support

After many tries and a deeper code analysis, i found where the error is, but i still can't understand why it's here.

in the "bad" WebRole EntryPoint, there are some "initializing methods", which build my table storage and insert some default entities.

Specifically, in this call:

table = clientTableStorage.GetTableReference(NameTable.ToString());

table.CreateIfNotExists();

something goes wrong, and the exception is thrown.

if i comment out 

//table.CreateIfNotExists();

everything goes fine, my webrole deploys and works like a charm.

More details about the code, just for clarity:

private CloudStorageAccount accountStorage;

private CloudTableClient clientTableStorage;

private CloudTable table;

public Mother(Microsoft.WindowsAzure.Storage.CloudStorageAccount Account)
        {
            accountStorage = Account;
            clientTableStorage = accountStorage.CreateCloudTableClient();
        }

What i can't understand is the fact that this code is in production from June 2013, and i never got problems with any (many) update before this.

So i must assume that something related to "CreateIfNotExists()" method is changed with 2.5 (or older) sdk release?

The table storage  which i'm pointing is in production from 2013 too. So, of course, it was created with an old Azure Storage version (I see 2.0.0.0), while now we are in 4.3.0.0

Maybe there is some old/new version incompatibility?

Thanks,

Flavio



  • Edited by Kenny0985 Friday, January 30, 2015 9:41 PM
January 31st, 2015 12:26am

@Bhushan and Frank, thanks for your support

After many tries and a deeper code analysis, i found where the error is, but i still can't understand why it's here.

in the "bad" WebRole EntryPoint, there are some "initializing methods", which build my table storage and insert some default entities.

Specifically, in this call:

table = clientTableStorage.GetTableReference(NameTable.ToString());

table.CreateIfNotExists();

something goes wrong, and the exception is thrown.

if i comment out 

//table.CreateIfNotExists();

everything goes fine, my webrole deploys and works like a charm.

More details about the code, just for clarity:

private CloudStorageAccount accountStorage;

private CloudTableClient clientTableStorage;

private CloudTable table;

public Mother(Microsoft.WindowsAzure.Storage.CloudStorageAccount Account)
        {
            accountStorage = Account;
            clientTableStorage = accountStorage.CreateCloudTableClient();
        }

What i can't understand is the fact that this code is in production from June 2013, and i never got problems with any (many) update before this.

So i must assume that something related to "CreateIfNotExists()" method is changed with 2.5 (or older) sdk release?

The table storage  which i'm pointing is in production from 2013 too. So, of course, it was created with an old Azure Storage version (I see 2.0.0.0), while now we are in 4.3.0.0

Maybe there is some old/new version incompatibility?

Thanks,

Flavio



  • Edited by Kenny0985 Friday, January 30, 2015 9:41 PM
Free Windows Admin Tool Kit Click here and download it now
January 31st, 2015 12:26am

Yeah probably you are right, may be some compatibility issues with storage related assemblies. You can try downgrading the storage assemblies to previous version and see if your deployment works.
January 31st, 2015 11:47pm

Hi again.

After more test, I found a sort of workaround...

The problem seems to stay in the version of Microsoft.Data.OData reference.

If i uninstall the last OData and install the old 5.6.2 (and Mediaservice 3.0.0.7 as consequence), everything works fine.

This sounds like a strange 'bug' to me but, for now, i can handle this way.

Thanks everyone for your support. 

Free Windows Admin Tool Kit Click here and download it now
February 5th, 2015 6:10pm

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

Other recent topics Other recent topics