ImageVault fails to find Anonymous user - episerver

We are using Episerver and ImageVault and it has worked fine for a long time. Until recently when showing albums to public users stopped working for no apparent reason.
No code changes in our project or change to the surrounding server environment.
An exception is thrown when the IVFileList control databinds. The exception that is thrown is "the trust relationship between the primary domain and the trusted domain failed".
I have debugged the code and come to the conclusion that the reason for the exception is actually because episerver tries to find a user called "Anonymous" with the WindowsMemberShipProvider. I have included a simplified stack trace below (excluded several calls for readability). I starts of with the DataBind call which leads to a call to episervers multiplexprovider to find the user "Anonymous" this in turn leads to a call to the method TranslateToSids that throws the exception.
System.Security.Principal.NTAccount.TranslateToSids(...)
EPiServer.Security.MultiplexingMembershipProvider.FindMembershipUser("Anonymous")
ImageStoreNET.Developer.WebControls.IVFileListData.DataBind()
I found a workaround for this problem by creating an local account in the webserver and named it "Anonymous". And now it all works again! The TranslateToSids method no longer throws the exception and the album pictures are visible.
Does anyone have a theory why this account suddenly is needed? We never had one before as we can recall. Although the workaround works, it feels like a ugly solution to create a local account. It should be a more correct way of solving this. Any suggestions?

Related

Not implemented exception in presentationframework.dll

We have an application that uses the Windows Presentation Framework.
One of our users gets a crash on load. The user sent the problem signature to me, and when I looked it up I realised the error was not in our code but rather in the presentationframework.dll.
I used ildasm.exe to find out what method was failing and it was this one:
.method /*06000880*/ public hidebysig newslot abstract virtual
instance void AddPlace(class MS.Internal.AppModel.IShellItem/*020000A9*/ psi,
valuetype [WindowsBase/*23000006*/]MS.Internal.Interop.FDAP/*010000AF*/ fdcp) cil managed
{
}
It throws a NotImplementedException.
The user has the same version of the presentationframework.dll as I have, v4.0.30319 but I have never stumbled upon this error, nor have I heard of any other user that has encountered this. The exact version in the problem signature is 4.0.30319.36366.
Unfortunately I have no direct access to the users computer, so I cannot investigate further. Does anyone know what might have caused this, or can anyone point me in some direction? I feel kind of lost.

Linq-To-Sql and MARS woes - A severe error occurred on the current command. The results, if any, should be discarded

We have built a website based on the design of the Kigg project on CodePlex:
http://kigg.codeplex.com/releases/view/28200
Basically, the code uses the repository pattern, with a repository implementation based on Linq-To-Sql. Full source code can be found at the link above.
The site has been running for some time now and just about a year ago we started to get errors like:
There is already an open DataReader associated with this Command which must be closed first.
ExecuteNonQuery requires an open and available Connection. The connection's current state is closed.
These are the closest error examples I can find based on my memory. These errors started to occur when the site traffic started to pick up. After banging my head against the wall, I figured out assumed that the problem is inherit within Linq-To-Sql and how we are using the same connection to call multiple commands in a single web request.
Evenually, I discovered MARS (Multiple Active Result Sets) and added that to the data context's connection string and like magic, all of my errors went away.
Now, fast forward about 1 year and the site traffic has increased tremendously. Every week or so, I will get an error in SQL Server that reads:
A severe error occurred on the current command. The results, if any, should be discarded
Immediately after this error, I receive hundreds to thousands of InvalidCastException errors in the error logs. Basically, this error shows up for each and every call to the Linq-To-Sql data context. Only after I restart the web server do these errors clear up.
I read a post on the Micosoft Support site that descrived my problem (minus the InvalidCastException errors) and stating the solution is that if I'm going to use MARS that I should also use Asncronous Processing=True. I tried this, but it did not solve my problem either.
Not really sure where to go from here. Hopefully someone here has seen and solved this problem before.
I have the same issue. Once the errors start, I have to restart the IIS Application Pool to fix.
I have not been able to reproduce the bug in dev despite trying many different scenarios involving multi-threading, leaving connections open, etc etc.
One possible lead I do have is that amongst the errors in the server Event Log is an OutOfMemoryException for the Application Pool. Perhaps this is the underlying cause of the spurious SQL Datareader errors (a memory leak elsewhere). Although again I haven't been able to reproduce this in dev.
Obviously if you are using a 64 bit OS then this is probably not the cause in your case.
So after much refactoring and re-architecting, we figured out that problem all along is MARS (Multiple Active Result Sets) itself. Not sure why or what happens exactly but MARS somehow gets result sets mixed up and doesn't recover until the web app is restarted.
We removed MARS and the errors stopped.
If I remember correctly, we added MARS to solve the problem where a connection/command was already closed using LinqToSql and we tried to access an object graph that hadn't been loaded. Without MARS, we'd get an error. But when we added MARS, it seemed to not care about it. This is really a great example of us not really understanding what the heck we were doing and we learned some valuable (and expensive) lessons from this.
Hope this helps others who have experienced this.
Thanks to all how have contributed their comments and answers.
I understand you figured out the solution..
Following is not a direct solution to the problem; but it is good for others to take a look at
What does "A severe error occurred on the current command. The results, if any, should be discarded." SQL Azure error mean?
http://social.msdn.microsoft.com/Forums/en-US/bbe589f8-e0eb-402e-b374-dbc74a089afc/severe-error-in-current-command-during-datareaderread

How to detect and wrap "debugging resource strings are unavailable" w/o installing developer runtime?

I'm working on a Silverlight app that has an UnhandledException handler in the App class, which shows a message box containing the exception message. This is often fine for custom exceptions. However, it's not so good for built-in exceptions (e.g. NullReferenceException), because users don't have the developer runtime installed and therefore get a rather ugly "Debugging resource strings are unavailable" message.
My first thought (which I quickly dismissed) was to check the exception message for "debugging resource strings". I imagine if someone's running the app in, say, French, they'd get something like "les chaînes de ressources de débogage", so that wouldn't work.
Perhaps there's a way for a Silverlight app to detect whether it's running in the end-user runtime vs. the developer runtime? I've looked in the Application and Environment and Deployment classes, and haven't found anything.
I suppose this wouldn't be an issue if the application always threw custom exceptions anytime some sort of message needed to be shown to the user. Then I could easily hide the non-custom ones with a friendlier generic message. Is that the best/only option?
Just from an application design point of view, what user will know what to do with any kind of techy error message? "The value 'null' was found where an instance of an object was required." huh??
A simple "Something bad happened, if it continues, please contact support" should suffice. Just ensure that you log whatever bad happened somewhere, so that when you get the phone call/email, you can retrieve the issue in whatever techy details you require to solve the problem.

Sudden error accessing custom settings in SalesForce

We use custom settings in a SalesForce app. We access it like so:
MySettings__c settings = MySettings__c.getOrgDefaults();
This was working fine, but today the app completely crashed. By that I mean the page doesn't load at all, I just get a white screen telling me an internal error occurred. We traced it down to this line of code - when it is commented out the page loads as well as it can without those settings (but at least it loads).
Running that single line of code in the System Log (using the Execute functionality) also causes a report of Internal System Error. The only thing the system log reports is "FATAL_ERROR Internal Salesforce.com Error." The Apex code modal reports "Internal System Error: 1018505045-332 (-920440070)"
The setting has values for the organization - we've also tried deleting the settings and recreating them to no affect. So far SalesForce has been no help beyond telling us to ask on their website.
This is very frustrating as it was working fine on Friday and today it was broken before anyone touched anything.
What you have there is a platform error. Whenever you get those you should report them to SFDC support and they will be able to see further internal logging to sort it out.
Nothing anyone out here can do to help I am afraid.
Paul
try setting the apiVersion of the affected code back to version 21.0. We had the same issue and making this change has provided an effective workaround.
This was a bug in Salesforce's infrastructure, which has been reported resolved. If you're still seeing this error with API version 22.0, you should create a case with salesforce support.

Silverlight, WCF and NotFound, oh my

I know this is a hot topic on StackOverflow, but do bear with me.
We have a Silverlight 3 application talking to a WCF service. Every now and then, calls to the WCF service return a NotFound exception.
I've read pretty much every post on SO and Google on this subject but I can't figure out what's going wrong. Here are some of my findings:
The exception happens on random calls and at random moments. Sometimes a method will work for 50 times and suddently it bugs out. I have a feeling it's related to a timeout, since it's most reproducable if I let the application idle for a while before invoking a call, but this is not always the case - sometimes the one of the first calls in the application fails.
We use the SilverlightFaultBehavior to convert the HTTP error code to 200 and we have plenty of instances where throwing an exception on the serverside actually bubbles up to the client side, so I can confirm this should be working as expected.
Fiddler shows nothing special at the moment the exception occurs. I don't even see the call in question. This worries me, but it might mean that the exception is a result of a call that happened minutes ago and timed out?
Service Trace Viewer shows nothing.
I attach Visual Studio to to Silverlight project and to the WCF services project, set debugging to break on all exceptions (thrown or handled) and it doesn't break (except in Silverlight to tell me about the NotFound problem). This causes me to think that maybe the NotFound is not in response to an exception on the WCF service side?
I really have no idea where to go from here. Any help at all, any pointers or ideas of things to try are welcome.
Here are some thoughts for the points you mentioned:
1) The exception happens on random calls and at random moments - Make sure the data being sent as a return value of method is valid. I had a case when sending an object with some empty properties caused a failure in serialization. I found this out using IIS logs/ Service Trace Logs.
2) So, did you find anything useful?
3) I don't think fiddler can help with this kind of an error.
4) Are you sure about this? Did you set up Trace Logs correctly?
5) You won't find any exceptions that can help you here. The actual exception (when you see 'Not Found' error) is raised while wrapping the message/data from server side or unwrapping message/data on client side.
So, to summarize make sure the data is in correct format (may seem to be correct for you but not WCF, just play with it for a while with different values) and verify the Trace Logging again.
What is a binding of the service? Where is it hosted: IIS or VS Deployment server?
I have seen this problem recently, something was wrong with IIS. It couldn't even open *.svc files.
So here is a plan of activities:
Try to open svc file using http address like http://localhost/MyApp/MyService.svc
If it opens, write a console application and test the service.
If it works, write a silverlight simple application.
I hope this will help.
I fixed this by adding
minFreeMemoryPercentageToActivateService="1"
to Web.config. By default it is
minFreeMemoryPercentageToActivateService="5"
which sometime causes this error.

Resources