Category Archives: Troubleshooting

Problems with the SP2010 Rest services ListData.svc

On a current project I’m working on we found a strange behavior problem with the Rest services of SharePoint.

When you create a normal list (custom list or whatever list you want) you can open the list by using the ListData service like this:

http://portal.development.com/_vti_bin/ListData.svc/TestList/

When you navigate to this page you will see a RSS like representation of the the list what actually is a XML response of the service:

DataService

The problem occurs when we add a type of column to the list. Lets add a column of the type calculated field and call it test calculation. As data type we will take sing line of text and add a calculation to calculate the length of the title like Len([Title]).

If we navigate to the ListData service we will see that the page is still the same like the above screenshot. When we look at the XML we will see that the Test calculation field is available in the XML.

<entry m:etag="W/&quot;1&quot;">
    <id>http://portal.development.com/_vti_bin/ListData.svc/TestList(1)</id>
    <title type="text">Test</title>
    <updated>2011-01-11T07:58:56+01:00</updated>
    <author>
      <name />
    </author>
    <link rel="edit" title="TestListItem" href="TestList(1)" />
    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/CreatedBy" type="application/atom+xml;type=entry" title="CreatedBy" href="TestList(1)/CreatedBy" />
    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ModifiedBy" type="application/atom+xml;type=entry" title="ModifiedBy" href="TestList(1)/ModifiedBy" />
    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Attachments" type="application/atom+xml;type=feed" title="Attachments" href="TestList(1)/Attachments" />
    <category term="Microsoft.SharePoint.DataService.TestListItem" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
    <content type="application/xml">
      <m:properties>
        <d:ContentTypeID>0x010005A0A71B03FA954DB854B647353C250C</d:ContentTypeID>
        <d:Title>Test</d:Title>
        <d:TestCalculation>4.00000000000000</d:TestCalculation>
        <d:Id m:type="Edm.Int32">1</d:Id>
        <d:ContentType>Item</d:ContentType>
        <d:Modified m:type="Edm.DateTime">2011-01-11T07:58:56</d:Modified>
        <d:Created m:type="Edm.DateTime">2011-01-11T07:58:56</d:Created>
        <d:CreatedById m:type="Edm.Int32">1</d:CreatedById>
        <d:ModifiedById m:type="Edm.Int32">1</d:ModifiedById>
        <d:Owshiddenversion m:type="Edm.Int32">1</d:Owshiddenversion>
        <d:Version>1.0</d:Version>
        <d:Path>/Lists/TestList</d:Path>
      </m:properties>
    </content>
  </entry>

Now we change the formula of the calculation field to =LEN([TITLE]) = 5 and change the type to Yes/No. In the representation of the list we see that everything is working like it supposed to:

list

Now lets open the ListData Service and you will notice what I meant with the problem within the ListData service. You will get a Internal Server error like below:

InternalServerError

Even if we change the formula to a very simple formula like =Yes the ListData service will still fail. I hope Microsoft will solve this problem in the first Service Package and till then we will just have to work around the problem.

Exception: [COMException (0×81072101): <nativehr>0×81072101</nativehr><nativestack> </nativestack> Cannot complete this action.

When I was working on a project I had to create a list instance of one of our own list definitions. I created a feature with the following element.xml.

<xml version="1.0" encoding="utf-8">
<elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <listinstance title="Public Navigation"
                  description="Public Navigation List"
                  url="Lists/NavigationPublic"
                  templatetype="15555">
    </listinstance>
</elements>

When I activate this feature I got the following exception: [COMException (0×81072101): 0x81072101Cannot complete this action.

Native Error

When I looked into the log files of SharePoint I found the following entries:

 09/20/2010 16:11:43.49 w3wp.exe (0x1ED8) 0x1AB4 SharePoint Foundation Fields 88yt High GetUserListSchema(): Failed to get the list schema XML for feature ’41202ea8-d927-475f-b710-48fe3af7e403′, template ’15555′: hr=0×81072101. eee79fed-2362-41c1-aaa2-29b93ddee0ca

09/20/2010 16:11:43.49 w3wp.exe (0x1ED8) 0x1AB4 SharePoint Foundation General 8l2r High Failed to find the list schema for FeatureId ’41202ea8-d927-475f-b710-48fe3af7e403′, list template ID 15555. Cannot create list in web “http://sharepoint/sites/Test” at URL “Lists/NavigationTop”. eee79fed-2362-41c1-aaa2-29b93ddee0ca 09/20/2010 16:11:43.49 w3wp.exe (0x1ED8) 0x1AB4 SharePoint Foundation General 8kh7 High 0x81072101Cannot complete this action. Please try again. eee79fed-2362-41c1-aaa2-29b93ddee0ca

This looked to me like the feature could not find the schema.xml that was defined for the list definition. I then went looking through the list instance definition and found out that I can insert a feature ID attribute. Point this feature ID attribute to the feature that installs the schema.xml and everything will go just fine.

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <ListInstance Title="Public Navigation"
                TemplateType="15555"
                FeatureId="aba8f789-1478-4ac7-ad36-95fceb12a23c"
                Url="Lists/NavigationPublic"
                Description="Public Navigation List" />
</Elements>

SharePoint 2010 Custom Errors

About a year ago I wrote a article on deactivating the custom errors off SharePoint 2007. That had to be done in the following manner:

Step 1:

Change

<SafeMode MaxControls="200" CallStack="false" >

to

<SafeMode MaxControls="200" CallStack="true" >

Step 2:

<customerrors mode="Off" />

If you do this on a SharePoint 2010 installation you will still get the following error:

 Server Error in ‘/’ Application.


Runtime Error Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed.

Details: To enable the details of this specific error message to be viewable on the local server machine, please create a tag within a “web.config” configuration file located in the root directory of the current web application. This tag should then have its “mode” attribute set to “RemoteOnly”. To enable the details to be viewable on remote machines, please set “mode” to “Off”.

This errors states that you did not make the change. This is because there is another web.config file that is being loaded. This file can be found in the following location:

 C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\web.config

If you change this file you will be able to see the .net errors. If you would like to see custom errors on Central Administration you will also have to change the web.config file in the admin folder off the 14 hive:

 C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\ADMIN\web.config

Happy Coding.


Failure in loading assembly

In the application event log I found several errors that were pointing to assemblies that I wasn’t using anymore. The error looks like the message below: Error: Failure in loading assembly: Assembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=Token.

The application was trying to load an assembly that I wasn’t in the GAC or in the BIN folder. This causes the error so I searched trough the complete solution for references to the specified assembly but couldn’t find any. After searching I opened the web.config file of the web application and the one from central administration and saw that there were safecontrols registered to assemblies that I wasn’t using anymore.

<SafeControl Assembly="Assembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=Token" Namespace="Namespace" TypeName="*" Safe="True" />

By deleting these safecontrol the problem was solved.

Team Foundation Server Installation Error: 28938

For the last couple of days my colleague and I have been installing Team Foundation Server 2008 on Windows Server 2008 with a separate SQL 2008 and SharePoint 2007 server.

The errors pops up like nothing I have ever seen before. One of the most annoying errors we came across was this one:

“Error:28938.TFSServerStatusValidator: The tool could not call the Team Foundation Server Registration Web Service. The call failed with the following status: 401 HTTP Unauthorized. Verify that Internet Information Services (IIS), Windows SharePoint Services, and ASP.Net are configured correctly and that IIS allows ASP.Net 2.0 Web service extensions.”

After days of research (even using Network Monitoring) to figure out what was going wrong we stumbled on something really small. When we installed IIS on the server it did not automatically install the Windows Authentication Role service as part of IIS. Because it did not install this service you cannot login. After the installation of it the Team Foundation Server Installation went like a charm.

If you have already installed IIS you have to do the following to install the Windows Authentication Feature:

  • Press start on the server were you would like to install the feature.
  • Administrative tools – Server manager
  • On the left side of the screen select roles and scroll down to Web Server IIS
  • Select add Role Services
  • In the setup screen select windows authentication and press next.
  • On the confirmation screen select install.

Access denied while crawling sites

Today I received the strangest error when I was configuring my SharePoint Virtual PC to crawl my websites. The crawler inserted a error for each web application containing the following text: Access Denied.

Since this was a new environment and I certainly know that the accounts where set correctly I was a bit amassed about the fact it would give this error. Checking the default content access account rights in the “Policy for Web Application” in Central Administration I saw that is was set correctly to “Full Read”.

I consulted one of my colleges but he also did not have an answer for this. The strange thing about all of this was that was a web application that was crawled. The difference between the application that was crawled and the other applications was that for the other applications I created a host name. The application that was crawled was using “Computername:Port number”.
After looking in de log files off SharePoint I found the following entry:

Couldn’t retrieve server http://dev.motion10-dev.local policy, hr = 80041205 – File:d:\office\source\search\search\gather\protocols\sts3\sts3util.cxx Line:543

Searching on this error with Google let me to a support page from Microsoft. The page states that when you are using Windows server 2003 SP1 or Windows XP SP2 authentication fails because Windows XP SP2 and Windows Server 2003 SP1 include a loopback check security feature that is designed to help prevent reflection attacks on your computer. Therefore, authentication fails if the FQDN or the custom host header that you use does not match the local computer name.
Poorly Microsoft states that this only occurs when you are using Windows Server 2003 SP1 or Windows XP SP2. As I found out it also occurs when you are working with Windows Server 2008!

You can solve this problem by following one of the two solutions displayed below. I followed the second solution because I had this problem on a development machine. In a production environment I would have followed the first solution just like Microsoft recommends:

Solution 1:
1. Click Start, click Run, type regedit, and then click OK.
2. In Registry Editor, locate and then click the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0
3. Right-click MSV1_0, point to New, and then click Multi-String Value.
4. Type BackConnectionHostNames, and then press ENTER.
5. Right-click BackConnectionHostNames, and then click Modify.
6. In the Value data box, type the host name or the host names for the sites that are on the local computer, and then click OK. You do not have to use a separation character just separate then by pressing enter.
7. Quit Registry Editor, and then restart the IISAdmin service.

Solution 2:
1. Click Start, click Run, type regedit, and then click OK.
2. In Registry Editor, locate and then click the following registry key:
3. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
4. Right-click Lsa, point to New, and then click DWORD Value.
5. Type DisableLoopbackCheck, and then press ENTER.
6. Right-click DisableLoopbackCheck, and then click Modify.
7. In the Value data box, type 1, and then click OK.
8. Quit Registry Editor, and then restart your computer.

You can read the complete Microsoft Support Page here: http://support.microsoft.com/kb/896861

Problem with importing User profiles (0x800706D9)

For one of our clients we have got an internet facing SharePoint site. For this website SharePoint user profiles need to be available. When we configured the user profile import we came across a very strange error:

There are no more endpoints available from the endpoint mapper. (Exception from HRESULT: 0×800706D9)

After some searching we figured out that there was something wrong with the firewall settings between de AD server and the SharePoint Farm. If you have the same problem take a look at the following kb articles from Microsoft:

Disabling SharePoint errors (An unexpected error has occurred)

One of the most annoying things I came across when I was developing for SharePoint 2007 is the error: “An unexpected error has occurred”. You can get rid of this by disabling the custom errors.

You can do this in two steps:

Step 1: Change

<SafeMode MaxControls="200" CallStack="false" >

to

<SafeMode MaxControls="200" CallStack="true" >

Step 2:

<customerrors mode="Off" />

If you change these settings in the web.config file you will get the ASP.Net error page with the call stack. You can change this in de web.config file of you web application or you can just edit the default web.config file on you development machine.

You can find your default web.config file in:

C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\CONFIG