| Author |
Share Topic Topic Search Topic Options
|
GeorgeB
Groupie
Joined: 03-May-2010
Posts: 66
|
Post Options
Quote Reply
Topic: Padding error on Azure Posted: 07-Jan-2011 at 4:55am |
Hi
I'm testing my Silverlight app running against SQL Azure using DF 6.0.7 hosted in Windows Azure.
For some reason I'm getting a message saying "Padding is invalid and cannot be removed".
I'm not using any encryption (that I know of) and there is nothing in my web.config that shouldn't be there - connection strings, EdmKeys and that's about it. allowAnonymousLogin="false" and loginManagerRequired='true" as I'm using my own ILoginManager.
I'm currently running two instances in the Staging enviroment.
I've just changed it to run a single instance and I don't get the error message.
Is there something I can do to fix this?
Kr
George
|
 |
kimj
IdeaBlade
Joined: 09-May-2007
Posts: 1391
|
Post Options
Quote Reply
Posted: 07-Jan-2011 at 9:33am |
Set the "session encryption key" in the web.config to a non-blank value. When load balancing is used, as with multiple Azure instances, this key must be the same on both instances in order for requests to be load-balanced. The inscrutable error is coming when encrypting/decrypting the SessionBundle passed with each request.
<serverSettings allowAnonymousLogin="true" loginManagerRequired="false" sessionEncryptionKey="" supportedClientApplicationType="UseLicense" testMode="false" useAspNetSecurityServices="false" userSessionTimeout="30" />
The "key" is really more like a password, and is used to generate an AES hash key.
|
 |
GeorgeB
Groupie
Joined: 03-May-2010
Posts: 66
|
Post Options
Quote Reply
Posted: 07-Jan-2011 at 9:49am |
Hi Kim
Thanks for that. I'll give it a go.
Kr
George
|
 |
GeorgeB
Groupie
Joined: 03-May-2010
Posts: 66
|
Post Options
Quote Reply
Posted: 10-Jan-2011 at 6:52am |
Hi Kim
I took the opportunity to move to another datacenter and I have reconfigured everything from scratch.
However I'm still getting the padding errors even with the changes you suggested.
When I go back to a single instance, everything runs perfectly.
Is there anything I can do?
Kr
George
|
 |
kimj
IdeaBlade
Joined: 09-May-2007
Posts: 1391
|
Post Options
Quote Reply
Posted: 10-Jan-2011 at 8:32am |
I want to check that you didn't copy the <serverSettings> from my post above as is. Those values are the defaults. The only change you should need is to set the sessionEncryptionKey to a non-blank value; when not set or blank DevForce assigns a value for each running instance based on the machine address. So, make sure you've got all your previous serverSettings values, and then set the sessionEncryptionKey.
Other than this setting, I don't know what would cause the error. Are you using ASP.NET security or the aspnetdb directly?
|
 |
GeorgeB
Groupie
Joined: 03-May-2010
Posts: 66
|
Post Options
Quote Reply
Posted: 10-Jan-2011 at 9:29am |
Hi Kim
I've taken out anything that isn't needed. Takes 20 minutes to upload to staging so I'll have to wait to test.
I'm not using ASP.NET security or the aspnetdb. All my own stuff.
Okay wait - I'm rereading your original message (slower this time). You say make it none blank? So I can put in anything I want and it should work?
I made it blank as that is what I assumed from your message. My mistake then. The default is blank?
It's getting late so I'll have a go at this in the morning again.
Kr
George
Edited by GeorgeB - 10-Jan-2011 at 9:59am
|
 |
kimj
IdeaBlade
Joined: 09-May-2007
Posts: 1391
|
Post Options
Quote Reply
Posted: 10-Jan-2011 at 1:26pm |
Yep, sorry for the confusion. The default is blank, but you want to specify something. I don't have any guidance on what that "something" should be, but think of it as a password so it should be non-trivial.
I should add that support for load balancing is only provided with certain licenses. If your debug log contains a message about not finding a license for "session-agnostic load balancing" it means we're ignoring your server key. If you find this happening, contact your account rep about getting an eval license.
|
 |
GeorgeB
Groupie
Joined: 03-May-2010
Posts: 66
|
Post Options
Quote Reply
Posted: 13-Jan-2011 at 6:39am |
Hi Kim
Okay so I have upgrade my license. I used the "Product Key Updater" from the Programs menu to enter the new license key.
I deployed to Azure and I still get the Padding error.
Am I missing a step?
Kr
George
|
 |
kimj
IdeaBlade
Joined: 09-May-2007
Posts: 1391
|
Post Options
Quote Reply
Posted: 13-Jan-2011 at 10:35am |
|
The Product Key Updater only updates the registry with your new product key. You'll also need to open your VS solution and save your EDMX in order to regenerate the model code. Then re-build and re-deploy to Azure, and hopefully all will be good.
|
 |
GeorgeB
Groupie
Joined: 03-May-2010
Posts: 66
|
Post Options
Quote Reply
Posted: 13-Jan-2011 at 10:04pm |
Thanks Kim.
I think I was too excited about having it work I didn't even think about regenerating the model.
How many times have I seen the license inside the generated designer? Hopefully this will help someone else on the forums.
Sorry I should slowed down to a blur. Thanks for the assistance.
Kr
George
|
 |