Showing posts with label troubleshooting. Show all posts
Showing posts with label troubleshooting. Show all posts

Friday, August 5, 2011

"An unexpected error has occurred" on all the SharePoint Server 2010 sites.

Issue:
All SharePoint sites throw the following error:
"An unexpected error has occurred."

Errors:
In ULS logs, something similar can be found

An exception occurred when trying to issue security token: The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.. 

Exception occured while connecting to WCF endpoint: System.ServiceModel.FaultException: The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs. 
at Microsoft.IdentityModel.Protocols.WSTrust.WSTrustChannel.ReadResponse(Message response) 
at Microsoft.IdentityModel.Protocols.WSTrust.WSTrustChannel.Issue(RequestSecurityToken rst, RequestSecurityTokenResponse& rstr) 
at Microsoft.IdentityModel.Protocols.WSTrust.WSTrustChannel.Issue(RequestSecurityToken rst) 
at Microsoft.SharePoint.SPSecurityContext.SecurityTokenForContext(Uri context, Boolean bearerToken, SecurityToken onBehalfOf, SecurityToken actAs, SecurityToken delegateTo) 
at Microsoft.SharePoint.SPSecurityContext.<>c__DisplayClass7.b__6() 
at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode) 
at Microsoft.SharePoint.SPSecurityContext.GetProcessSecurityTokenForServiceContext() 
at Microsoft.SharePoint.SPChannelFactoryOperations.CreateChannelAsProcess[TChannel](ChannelFactory`1 factory, EndpointAddress address, Uri via) 
at Microsoft.SharePoint.SPChannelFactoryOperations.CreateChannelAsProcess[TChannel](ChannelFactory`1 factory, EndpointAddress address) 
at Microsoft.Office.Server.UserProfiles.MossClientBase`1.get_Channel() 
at Microsoft.Office.Server.UserProfiles.MossClientBase`1.ExecuteOnChannel(String operationName, CodeBlock codeBlock) 
at Microsoft.Office.Server.UserProfiles.ProfilePropertyServiceClient.ExecuteOnChannel(String operationName, CodeBlock codeBlock)

UserProfileApplicationProxy.InitializePropertyCache: Microsoft.Office.Server.UserProfiles.UserProfileException: The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs. ---> System.ServiceModel.FaultException: The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs. 
at Microsoft.IdentityModel.Protocols.WSTrust.WSTrustChannel.ReadResponse(Message response) 
at Microsoft.IdentityModel.Protocols.WSTrust.WSTrustChannel.Issue(RequestSecurityToken rst, RequestSecurityTokenResponse& rstr) 
at Microsoft.IdentityModel.Protocols.WSTrust.WSTrustChannel.Issue(RequestSecurityToken rst) 
at Microsoft.SharePoint.SPSecurityContext.SecurityTokenForContext(Uri context, Boolean bearerToken, SecurityToken onBehalfOf, SecurityToken actAs, SecurityToken delegateTo) 
at Microsoft.SharePoint.SPSecurityContext.<>c__DisplayClass7.b__6() 
at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode) 
at Microsoft.SharePoint.SPSecurityContext.GetProcessSecurityTokenForServiceContext() 
at Microsoft.SharePoint.SPChannelFactoryOperations.CreateChannelAsProcess[TChannel](ChannelFactory`1 factory, EndpointAddress address, Uri via) 
at Microsoft.SharePoint.SPChannelFactoryOperations.CreateChannelAsProcess[TChannel](ChannelFactory`1 factory, EndpointAddress address) 
at Microsoft.Office.Server.UserProfiles.MossClientBase`1.get_Channel() 
at Microsoft.Office.Server.UserProfiles.MossClientBase`1.ExecuteOnChannel(String operationName, CodeBlock codeBlock) 
at Microsoft.Office.Server.UserProfiles.ProfilePropertyServiceClient.ExecuteOnChannel(String operationName, CodeBlock codeBlock) -
-- End of inner exception stack trace --- 
at Microsoft.Office.Server.UserProfiles.ProfilePropertyServiceClient.ExecuteOnChannel(String operationName, CodeBlock codeBlock) 
at Microsoft.Office.Server.UserProfiles.ProfilePropertyServiceClient.GetProfileProperties() 
at Microsoft.Office.Server.Administration.UserProfileApplicationProxy.RefreshProperties(Guid applicationID) 
at Microsoft.Office.Server.Utilities.SPAsyncCache`2.GetValueNow(K key) 
at Microsoft.Office.Server.Utilities.SPAsyncCache`2.GetValue(K key, Boolean asynchronous) 
at Microsoft.Office.Server.Administration.UserProfileApplicationProxy.InitializePropertyCache()

System.NullReferenceException: Object reference not set to an instance of an object. 
at Microsoft.Office.Server.Administration.UserProfileApplicationProxy.get_ApplicationProperties() 
at Microsoft.Office.Server.Administration.UserProfileApplicationProxy.get_PartitionIDs() 
at Microsoft.Office.Server.Administration.UserProfileApplicationProxy.IsAvailable(SPServiceContext serviceContext) 
at Microsoft.Office.Server.WebControls.MyLinksRibbon.get_PortalAvailable() 
at Microsoft.Office.Server.WebControls.MyLinksRibbon.EnsureMySiteUrls() 
at Microsoft.Office.Server.WebControls.MyLinksRibbon.get_PortalMySiteUrlAvailable() 
at Microsoft.Office.Server.WebControls.MyLinksRibbon.OnLoad(EventArgs e) 
at System.Web.UI.Control.LoadRecursive() 
at System.Web.UI.Control.LoadRecursive() 
at System.Web.UI.Control.LoadRecursive() 
at System.Web.UI.Control.LoadRecursive() 
at System.Web.UI.Control.LoadRecursive() 
at System.Web.UI.Control.LoadRecursive() 
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Cause:
This will occur on single server deployments which uses build in SQL database. If you have done a farm installation, the resolution/cause may not apply.

Forefront Identity Manager Synchronization service corrupt not working. This in turn affects User profile sync service and security token service application.

If your applications are associated with User profile service, you will get the error.

Resolution:
As per the Technet article, User profile synchronization service does not work with single server deployment with build in databases.
Check the article for further details:
http://technet.microsoft.com/en-us/library/cc263202.aspx

To resolve the issue, delete the User profile synchronization service instance from Central Admin.

Friday, June 4, 2010

"Value does not fall within the expected range" when adding a calculated column to the library/list.


Symptoms:
You create a document library or a list.
Go to site settings and add a calculated column (named CAL1, or any other name) and then save it. This works fine as this is the first calculated column.
You add another calculated column which calculated the value based on the value from CAL1 (from previous step).
In such a scenario, we get an error "Value does not fall within the expected range". But at the same time, the column gets added to the site and functions as expected.

Error(s):
"Value does not fall within the expected range"

Cause:
By-Design.

If you're trying to use it with a Calculated column, then you're trying to force a value into a column for which SharePoint itself is calculating the value.

i.e. CAL2 value is being calculated from CAL1 value which itself is unknown. Anything that is unknown, .NET will treat it as something out of range. Thus, we are getting the error.

Resolution:
With the above explanation, we do not have a resolution for the issue.
SharePoint should ideally show a warning message stating that we are calculating the value based on a column whose value is unknown. Instead of a friendly error message, we are getting a technical error from .NET/SharePoint which causes confusion that something is failing.

Tuesday, April 27, 2010

Not able to access document library through Explorer View (A device attached to the system is not functioning.)

Issue:
You have a document library with more than 1000 items and you are not able to view the library in Explorer view. The problem occurs becayse by default WebDAV is configured to pull 1000 items and show it in Explorer view. This can be on SharePoint or any other site. Explorer view will fail with the following error message if the library/window contains more than 1000 items.

Error:
\\location is not accessible. You might not have permission to use this network resource. Contact the administrator of this server to find out if you have access permissions. A device attached to the system is not functioning.



Resolution:
You need to increase the WebDAV limit by following the below mentioned knowledge base article:

You cannot access a WebDAV Web folder from a Windows XP-based client computer (kb912152)

Friday, April 16, 2010

What SharePoint Administrators should know about .NET Framework? (Part 2)

Find Part 1 of this series here:
Part 1 - http://sharepoint-talk.blogspot.com/2010/04/what-sharepoint-administrators-should.html

(..... continued)
4) ASP.NET
.NET as a framework provides us with ASP.NET, a technology that is used for development of web based pages/sites. Now many of us get confused with .NET framework and ASP.NET. Some treat them as one single component/technology. But that is far away from reality. ASP.NET is a server side technology that again uses .NET framework. .NET framework code base can be used to create desktop or web based application. ASP.NET is the technology (built upon) .NET framework that helps us create web based applications using Visual Studio.
Now that we can differentiate between ASP.NET and .NET framework, we need to relate ASP.NET with SharePoint. But before relating it to SharePoint, we need to understand the relation of ASP.NET and IIS. ASP.NET is registered with IIS. So when a page request (for .aspx files) come to IIS, IIS knows that this request needs to be handled by ASP.NET. IIS authenticates the request first (this is when you get the username and password prompt and that is actually generated by IIS). Once the user is authenticated, IIS then passes the request onto the ASP.NET filter (aspnet_isapi.dll). The request is usually for a .aspx page. ASP.NET then reaches out for the page and processes the request with the help of .NET framework code base and CLR.
ASP.NET can be registered/Unregistered with IIS. When it is registered, we can check that out from IIS Manager -> Web Server Extensions. In this window, we will see the ASP.NET and it's version.
If ASP.NET is not registered properly, you now know that the web pages will not be rendered. IIS does not know where to pass the request and how to process it.

5) Web Services
A Web Service is actually a component sitting on the server. A call can be made to the web service from local or remote server. Mostly a web service is developed so that remote clients (which cannot be installed or are run on remote machines) and application need to use the functionality.
e.g. Office Clients use web services for getting meta-data (list.asmx), get workflow status, etc. So a Office application makes call(s) to the web service(s) located on the server. On the server, the web service is responsible for executing the code and return the result set back to the application from where the call was generated. The data transfer is usually done in XML (Extensible Markup Language).
If you want to check out the data that is being transferred between the client and the web service, take a network monitor trace and analyze the response that we get from the server. Also take a look at the .asmx (web service) that is being called. This way we can learn more about the web services and where they are used.

6) Windows Workflow Foundation
Workflows are used heavily in SharePoint. And Workflows need no introduction who have been working with SharePoint and administering it. But how do the workflow work and what is Windows Workflow Foundation.
Workflows that are executed on the Server is again something that .NET does. Also, Windows Workflow Foundation can be installed on Client Operating Systems like XP, Vista, Seven, etc. When a client open a document in Office and tries to make changes to the Workflow, the local Windows Workflow Engine starts to work. It can then communicate back to the server. Also, when SharePoint renders pages that are related to workflows, WWF runs on the server and executes to show up the results.
e.g. In a publishing site, if content approval is enabled for items in the "Pages" library, a workflow is started on the items (pages) that are created and eventually when the page is published the workflow is finished. This type of workflow is executed on the server. Well, frankly speaking, most of the workflows that are present in SharePoint are run on the server. There are timer jobs for Workflows that are run at specific intervals. These timer jobs communicate with the WWF/.NET for executing the activities present in the workflow.
We can look at WWF as a technology that standardizes workflow related activities across different machines. This technology provides various logic for the users/admins to create workflows that can be deployed and executed on SharePoint Servers. A workflow thus can be termed as a set of activities which run as per the business logic applied.
When a workflow fails, exceptions are usually trapped in the ULS logs (NOTE: We need to ensure that we are enabling logging for the workflow events from Central Admin site). You will find that the exception is raised from a class/assembly file, which is part of the .NET framework (System.Workflow class). Thus, we can find out which component within that Workflow class is failing and figure out what can be the possible issue.

What SharePoint Administrators should know about .NET Framework? (Part 1)

SharePoint is based on .NET technology and having knowledge about some of the .NET features and SharePoint Object Model will help administrators fine tune their troubleshooting and server maintenance capabilities. Previously, if we needed a Content Management System/Online Portal, developers need to develop custom applications from scratch. Now, this required creation of classes and pages from scratch. With .NET advancement, Microsoft included the basic set of functionality within the .NET framework which can be re-used and customized for array of common tasks that developers do while building web application. Let me give an example for the same.

If we need to build a calendar from scratch, we need to do a lot of coding, with .NET in picture and Visual Studio for our help; we already have an inbuilt calendar control which can be used on web pages. This greatly reduced the effort on developing such common tasks. Now, at the core, the idea still remains the same. We have a set of classes in .NET framework that renders the output on the page.
Thus, there is lot more functionality added to .NET framework with version 2.0 and 3.5. With such advances, .NET is greatly being adopted by many software professionals.

Now, that we have a “little” bit of understanding about the .NET framework, let us concentrate on what a SharePoint Admin needs to know about the .NET Framework.

1) Common Language Runtime.
As I have mentioned above, there are classes which are installed when we install the .NET framework. Now, to render the output of the code, files need to be processed. Common Language Runtime is a engine in .NET framework which understands the native Microsoft Intermediate Language (MSIL) and gets us the output. We need to understand that SharePoint is not a product alone and the core functionality comes from .NET framework, its classes and other Microsoft Technologies (NOTE: There are other technologies like IIS, SQL also used to help SharePoint Render the output)


When a web part/page is not rendered and we see an error message. It is good idea to turn on .NET tracing that will let us know what went wrong with SharePoint/.NET or any other component involved in the setup.
If you need detailed information on CLR, please refer to:
http://en.wikipedia.org/wiki/Common_Language_Runtime
http://msdn.microsoft.com/en-us/library/ddk909ch.aspx

2) .NET authorization (Security Mechanism) used in SharePoint.
Authorization is different from authentication. Authentication is something handled by IIS. Authorization means which user has access to which content once they are authenticated by IIS. Thus, a user might be able to access the site, but he may not see the "Site Actions" link (because the user has read/limited access). This security is feature in SharePoint is taken from .NET. Also there has been some extensions done to the .NET code base, but the base classes used stay within the .NET framework. Check out New Security Features of .NET 2.0.
Authentication and Authorization.So, when a user gets access denied, we can check if everything is set up properly in SharePoint users and groups. There are situations, where we get only an "Access Denied" or "Unknown Error" error message and that is quite frustrating. We can take help from .NET here. Check for any .NET related errors in the event viewer and at the same time enable .NET tracing. This will again help in finding the root cause and resolve the issue.

3) Garbage Collection
Garbage collection is done by the CLR. Garbage Collection, is usually a termed used to refer a process of cleaning up system memory (once it is not in the scope for any use). CLR does the garbage collection automatically and there is little control a developer has on this. (Although there are ways to tell the CLR when to do the garbage collection, but that's from a developer stand-point). The concept of Garbage Collection can help administrators find out any issues with memory leaks, high performance usage on the server, etc. If the system is taking time we can look out for any issues with the .NET garbage collector process. This is usually done by doing a dump analysis (DebugDiag Tool). Although a dump analysis might not be easy for a SharePoint Admin, but if we find any .NET related errors, we can engage a .NET specialist to do the dump analysis for us. This will tell us if there is any Object that is not getting freed from the memory and what object is that. It can also help us narrow down any issues with custom code.
Garbage Collection (.NET)

You might find these articles useful