Showing posts with label error. Show all posts
Showing posts with label error. Show all posts

Saturday 24 March 2012

Turning on the Windows 2008 R2 Desktop Experience

Problem: A standalone developer VM generally means that the developer needs to use the browser on the Windows 2008 Server to check features are working in SharePoint.  On such problem with working on the Windows 2008 desktop you can't open a document library in Windows Explorer.
Error Message: "Your client does not support opening this list with Windows Explorer.".
Your client does not support opening this list with Windows Explorer
Initial Hypothesis:
Turn on the Windows Desktop Experience feature.
Windows feature - turn on 'Desktop Experience'
Resolution:
Run the following 2 PS cmds as administrator:
PS> Import-Module Servermanager

PS> Add-WindowsFeature Desktop-Experience -restart


Note: I only apply this to me development machines.

The Desktop Experience also fixes using Office on the Dev VM.
Useful PS cmds in this area:
# Import-Module Servermanager

# Get-WindowsFeature
# See what Windows features is installed
# Add-WindowsFeature Desktop-Experience -restart
# Remove-WindowsFeature Desktop-Experience -restart

Sunday 4 March 2012

Office document in SP2010 won't open - Explorer fails, SDP fails.

Problem: Can't open Office documents (Word, Excel or PowerPoint).  Additionally can't connect to SharePoint using SPD2010 or Publish forms using InfoPath 2010.  Another effect has been that Windows Explorer won't display document library's.
Initial Hypothesis:  A colleague of mine Grzegorz Skorupa in Poznan figured out the issue using Fiddler.  Our site was running over SSL so he had to decrypt the response's and requests using Fiddler.  Fiddler was also used to intercept the requests from the Office client program.  From this he could see MS Word issuing more than simply GET and POST verbs.  Recently our SharePoint test environment had been hardened which include only allowing GET & POST verbs.  This also only occurs if you are using STSsession cookies.  This was previously discussed http://blog.sharepointsite.co.uk/2010/11/change-to-session-cookies-for-claims.html

You can check your farms cookies session setting using the following PowerShell cmd:
PS> Get-SPSecurityTokenServiceConfig

As it has been explained to me, because the session cookies are being used, the cookies are no longer written to disk, so the Office application needs to authenticate (as it can't use the cookie created by the SharePoint browser session). The Office client uses WebDAV request, has to authenticate and it passes requests that are not GET or POST based to retrieve the file.

Resolution:  Check IIS and the instances of IIS are allowing all verbs in request filtering or use the default sessioncookies setting (false).
$sts = Get-SPSecurityTokenServiceConfig
$sts.UseSessionCookies = $false
$sts.Update()
iisreset

You can watch the http request types (request verbs) using Fiddler as highlighted below.

Monday 11 July 2011

VS2010 Strongly Name key issue

Problem: Visual Studio 2010 using TFS2010 on multiple developer machines keeps erroring on all developers VM's after they get the latest code "cannot import the following key file" and mentions the sn key.

Resolution: On the projects properties > Signing > Click the drop down for "Choose a strong name key file:" Click the option, click "Cancel" button.  You are prompted with a dialog "enter password to enter file", add the keys password and select OK.  VS will stop erroring after you have done this once.

More Info: http://stackoverflow.com/questions/2815366/cannot-import-the-following-keyfile-blah-pfx-the-keyfile-may-be-password-protec

Wednesday 22 June 2011

SQL Name Pipes Error

Problem: When setting up a development machine, I install SQL before SharePoint.  When I try access SQL Server 2008 R2 using "SQL Server Management Sudio", I get the error "provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server".

Initial Hypothesis: Named pipes are not enabled by default since SQL Server 2000, need to enable Named Pipes usinng "SQL Server Configuration Manager".

Resolution:
All Programs >> Microsoft SQL Server 2008 R2 >> Configuration Tools >> SQL Server Configuration Manager >> Enable both “TCP/IP” and “Named Pipes”.


More Info:
http://blogs.msdn.com/b/sql_protocols/archive/2007/03/31/named-pipes-provider-error-40-could-not-open-a-connection-to-sql-server.aspx

Monday 9 May 2011

iCustomMapping LinkFieldValue errors in Sandbox solutions

Problem:  I was trying to use the iCustomMapping interface to add additional columns of type LinkFieldValue to a sandox solution I am getting the error:
{"Type 'Microsoft.SharePoint.Publishing.Fields.LinkFieldValue' in Assembly 'Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' is not marked as serializable."}

Initial Hypothesis: I could not see why I as getting the error but a Google search found me a post that gave me the answer.

Resolution:  Change the code from
SPListItem item = (SPListItem)listItem;
this.ContentLinkField = item["LT1"];
To:
SPListItem item = (SPListItem)listItem;
string value = item.GetFormattedValue("LT1");
this.ContentLinkField = new LinkFieldValue(value);

More info:
http://www.alexbruett.net/?p=255 

Tuesday 3 May 2011

Corrupt site column cannot be deleted

Problem: I have deployed a site column (field) and Content Type declaratively, the site column is not valid and I get the following error when looking at my site columns using SharePoint 2010's UI: "Field type xxx is not installed properly. Go to the list settings page to delete this field."
Initial Hypothesis:  The cause of the issue is simply that I create a site column of type "Bool", Type bool does not exist, boolean is the correct type, as show below:
Resolution: Delete the Site Column, can't do this I tried SharePoint's UI (as shown in the problem image), SharePoint Designer, Solution Explorer with CKSDev extensions.  All tools error as the Site Column object cannot in instantiated.
So now it was time to try Powershell which will fail as it can't instantiate the Site column object either. 
PS> $web = Get-SPweb http://demo1/sites/sponline
PS> $fields = $web.Fields
PS> foreach($field in $fields) {  write-host $field.Id }
This proves the site column exists but it is corrupted.  I tried deleting it using PS.
Obviously the site column won't be removed. 

Summary:  At this point I am in a knot.  The site column is causing errors and it can't be removed, so the option is to delete the site collection or to do the bad stuff and fix the error directly in the database.

                         =================

Problem:  A corrupt site column needs to be deleted using T-SQL.

Initial Hypothesis: Find the corrupt/offending field, as you can't use SharePoint's API to remove the field, it will need to be done directly in the content database using T-SQL.

Resolution:
  1. Find the site column causing the issue using Powershell.
  2. I opened the field.text file and found:   I did a search for "bool" in the text document, there are a lot of results but all the other found "boolean".  So simply search for the type that is shown in your error message.
  3. Find the content database that is storing the offending Site Column using Central Admin.
4.> Open "Microsoft SQL Server Management Studio" and perform a query to find the offending record

T-SQL:  SELECT * FROM [Demo_PortalDB].[dbo].[ContentTypes] WHERE Definition LIKE ('%332B55548E6C%')
5.> Delete the offending record

T-SQL: DELETE FROM [Demo_PortalDB].[dbo].[ContentTypes] WHERE Definition LIKE ('%332B55548E6C%')

Summary:  Editing SharePoint database directly is not supported by Microsoft and should not be done under any circumstances.  I can't find another way to fix this issue - so if anyone has a suggestions I'd love to know it.

Error Message Examples:
Field type Bool is not installed properly. Go to the list settings page to delete this field.
Field type Financials Gross Value Certified is not installed properly. Go to the list settings page to delete this field.
Field type UKTelephone is not installed properly. Go to the list settings page to delete this field.

Saturday 26 March 2011

Cannot delete related SP2010 lists

Problem: You cannot delete either of 2 lists if they are related through a lookup column.  I tried deleting the list instances using Powershell and the SP2010 UI.  The List definition and corresponding content types are being deployed and retracted successfully.  PS error message when deleting either list instance is:
Exception calling "Delete" with "0" argument(s): "This list cannot be deleted because one or more lists are related to it. A relationship between two lists occurs when one of the lists contains a lookup column enforcing a relationship behavior on the other list."
 
Initial Hypothesis:  As I am deploying my lists using content types and there is a lookup column, it is important that they are created in the appropriate order.  As I am chaning my features elements manifest file building out my lists it appears to be that I have got my lists instances tangled so they can't be deleted. 

Resolution: I deployed my solution so that the CT and list definitions were present, I deleted the lookup column using the list setting in the UI.  I could then delete the list instances. 

Friday 25 March 2011

SPMetal - Specified cast is not valid

Problem:  I am using LINQ to SharePoint to retrieve data.  A specific SPMetal list request generates the error "Specified cast is not valid".  Additional error information shown in the UI:
Web Part Error: Unhandled exception was thrown by the sandboxed code wrapper's Execute method in the partial trust app domain: An unexpected error has occurred.
From the stack trace:
"at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at Microsoft.SharePoint.UserCode.SPUserCodeWorkerProcess.ExecuteDelegate.EndInvoke(IAsyncResult result)"
Hypothesis: The error message is a standard error thrown in a SharePoint sandbox solution. The underlying issue is that the proxy is working on lists using SPMetal however only 1 list is causing the problem.  I remembered that I had altered the list using Powershell.   Obviously the entity proxy class generated is based on the old list.  Generate the proxy with the latest lists.
Resoultion: Run SPMetal again to correct the proxy code as the proxy classes do not match the backend SharePoint lists. 

Wednesday 9 March 2011

Problem with DIP using Lookup Columns

Problem: The Document Information Panel (DIP) in MS Office Word 2010 won’t do lookups to a list within MOSS.  This is a known bug. 
What is affected:  I have tested this on SP2010 and the issue has been resolved.  This only affects MOSS when using the Document Information Panel (DIP) for Word 2010, Word 2007 and Word 2003.

Initial Hypothesis: The issue is caused by MOSS User Interface (UI) when the lookup column is created. The UI links the document library content type to a custom SharePoint 2007 list using a GUID. The issue is that the GUID should be surrounded by {}. SharePoint UI knows how to handle these missing curly brackets however, all the MS Office applications (Word 2010 in our case) need the correct hook-up.  The hook up is wrong, hookup the document libary using a differnt approach.

Resolution:  Login to a WFE that has SharePoint Manager 2007 (codeplex project) installed. Navigate to the SavillsSolar Site Collection and amend the lookup property by surrounding the GUID with curly brackets. The url below details the change and additional information. 
Alternative Resolution: Create the custom list in the root of the site collection, the custom content type for the document library should have a lookup added.  This fixes the problem but requires content type to be create 1st.  Lookup list site column to be created 2nd.  3rd use the custom document contnet type in the library.  Lastly, the custom list has to be in the base/root of the site collection.
Alternative Resolution: Move to SP2010 not to practical but another reason to promote the move to your business.
Summary:  This is a rehash of Bernado Nguyen-Hoan's Blog post on the same topic that allowed me to quickly fix the issue on an old MOSS farm.  The new bit is that the lookup columns from SP2010 using the DIP have been fixed and the best appoach is to have your custom list (lookup list) directly under the site collection.

Source:
http://bernado-nguyen-hoan.blogspot.com/2010/01/problem-with-document-information-panel.html

Thursday 3 March 2011

Access SharePoint document libraries from Office

Problem: You can't save a word document to a SharePoint 2010 document library directly from word.  This applies to all products in the office suite and saving to SP2010 & MOSS from Windows Server 2008.  I was getting the error "You can't open this location using this program." when pointing the document to a SharePoint library.

Note: This only applies if your OS is Windows 2008 Server.

Initial Hypothesis: This only affects Windows 2008 Server users.  So it's really just developers looking at saving to SharePoint from the Windows 2008 Server environment, you would also need Office installed.  The issue is with the restricted access the Windows 2008 server allows by default.

Resolution:
Open Server Manager > Features > Add the "Desktop Experience" feature.  Andrew Woodward has a post on the issue for more information.
http://www.21apps.com/sharepoint/windows-server-2008-developing-sharepoint-cant-connect-from-office-clients/

AD account password out of sync with the managed service account within SharePoint

Problem: I am trying to start services on a server, when I start the Search Foundation service I get the following error: "The password for the account ...\..., as currently stored in SharePoint, is not the same as the current password for the account within Active Directory.  To fix this with Powershell, run Set-SPManagedAccount -UseExistingPassword."
Initial Hypothesis: The password for the account I am using to run the service using has been changed in AD, this does not match the password stored in the SharePoint.

Resolution: Reset the AD Password



Ensure SharePoint is using the correct pswd i.e. chnage the store managed account password as shown below using the Set-SPManagedAccount cmd.




Friday 4 February 2011

MOSS export list SSL issue

Problem: I can't export a list to a excel spreadsheet file from a SharePoint 2007/WSS3.0 site is using SSL.  SP2010 exports https lists correctly. 
Initial Hypothesis: File is being exported however, when opening the *.iqy file, the error "Excel cannot connect to the SharePoint list." pops up. 
Resolution: This is a bug with 2 workarounds,
  • Option1: From excel connect to the list. or
  • Option 2: Save the *.iqy file, open it using notepad, chnage the url to use https instead of http (it occurs twice in the iqy file.

Issue in Document libraries in MOSS using Word 2010

Problem:  The business upgrades there Office desktop version to Office 2010.  If a user needs to add new documents into a document library running on MOSS.  Word 2010 opens and then throws the error "This file could not be found.".
Initial Hypothesis: Office(Word) 2007 and Office(Word) 2003 can create the new documents.  Office(Word) 2010 can edit a document added by a previous version or an uploaded document correctly.  The issue appears to be between Word 2010 and document libraries in MOSS when adding a new document under SSL.

I can open the full url to the word template correctly using IE and Word 2010, so the issue must be with the url that is crafted for Word 2010.

I was looking at the templates associate with each content type in my document library, the path is always relative however, as I am adding the the template it stores a relative value.

Resolution: The url that is requested using the new document derives from the content type's default document template.  My site uses SSL, and it looks like the path that SharePoint generate is incorrect (I need to confirm this using fiddler, but as I'm on my clients site using a locked down workstation and no access to the servers I can't see the url being generated).  Anyway, my fix is to save the full https path in the "Enter the URL of an existing document template".

Thursday 2 December 2010

Error occurred in deployment step Activate Features Failed to activate feature .. at scope

Problem: When deploying a soluction in VS 2010 I get the following error.

"VS Error: Error occurred in deployment step 'Activate Features': Failed to activate feature 'XX' (ID: xxxa2e8a-78d7-451c-aa85-3d28555e5555) at scope 'http://demo.dev'."
ULS contained the following error "Feature Activation: Threw an exception, attempting to roll back. Feature 'XX' (ID: 'xxxa2e8a-78d7-451c-aa85-3d28555e5555'). Exception: System.InvalidOperationException: Failed to activate feature 'XX' (ID:xxxa2e8a-78d7-451c-aa85-3d28555e5555) at scope 'http://demo.dev'. at Microsoft.SharePoint.SPFeature.HandleActivateError(SPFeature featError, Int32 iRetVal, Boolean fForce)"

Initial Hypothesis: Performing an IISreset did not resolve my issue, the suggestion to manual start the feature will activate the feature however it does not solve my deployment issue from VS. The feature is scoped at 'Site' level so activating the feature can be done at the site collection level.

Resolution: Removed the feature and solution using Powershell Rebooted Visual Studio development environment Open solution in Visual Studio 2010 and redeployed.  The cause is still not know however, rebooting and uninstalling the solution has fixed the issue.
More Info:
http://social.technet.microsoft.com/Forums/en-US/sharepointadmin/thread/ee35db1a-b83f-477e-ba6b-f59ac8522e34/

The parent content type specified by content type identifier ... does not exist

Problem: When I deploy a solution that automatically activates a feature I receive the following error "Error occurred in deployment step 'Activate Features': The parent content type specified by content type identifier 0x0120D520 does not exist.".
Initial Hypothesis: The feature being deployed relies on another feature being activated, in this case it is the 'Document Sets' site collection feature that is missing.
Resolution: Site Settings > Site Collection features > Document Sets (Activate)
More Info:
http://msdn.microsoft.com/en-us/library/aa543822.aspx

Cannot insert duplicate key row in object

Problem: Error occurred in deployment step 'Add Solution': Cannot insert duplicate key row in object 'dbo.Solutions' with unique index 'Solutions_BySiteAndSolutionId'.

Initial Hypothesis: Sandbox solution wsp deployment is causing the error. I delete and created a new site collection with an identical url.

Resolution: Using Visual Studio 2010 in the solution browser, select the project that is not deploying. In the properties window change the 'Site URL' property that tells Visual Studio the site to deploy your project code to. Change the 'Site Url' to something else save the change and then change the 'Site Url' property back to its original value.  Redeploy the project and it deploys correctly.  Thanks to Brian Farnhill.
Read More:
http://blog.brianfarnhill.com/2010/11/16/error-cannot-insert-duplicate-key-row-in-object-dbo-solutions/

Saturday 27 November 2010

Error adding webpart containing validation control

Problem: When adding a custom built webpart with asp validator controls to a page, the user will encounter the following error when attempting to save the changes "Error: This page contains content or formatting that is not valid.".
Initial Hypothesis:
This error only happens when the webpart control has validators and prevents the user being able to add the webpart to the page.

Resolution: Disable the validator controls when editing the page.
Add the following public method in the server control code ...
public void EnableValidators(bool enableVal)
{
this.validatorName.Enabled = enableVal;
}
In the Webpart's CreateChildControls() procedure only add the user control/validation when not in edit mode
if (SPContext.Current.FormContext.FormMode == SPControlMode.Edit || SPContext.Current.FormContext.FormMode == SPControlMode.New)
{
//validator.enabled = false
((UserControl1)_ctl).EnableValidators(false);
}
else
{
//validator.enabled = false
((UserControl1)_ctl).EnableValidators(true);
}
}
Add the EnableValidators method to the user control code behind:
 
The validators will then be disabled when adding the web part​ to the page / editing the page, but still work in presentation mode.

Thanks to Paul W

Monday 15 November 2010

Changing service account passwords - The Service is unavailable

Problem: Browsers return the following error "Service Unavailable  Http Error 503.  The Service is unavailable." on all SharePoint websites including central admin.
Initial Hypothesis: I changed my password yesterday causing the app polls to fail when logging in.  The domain account used on my development machine required a password change.  Starting the machine causes all the IIS web sites to display the error message "Service Unavailable".  I run various services and application polls using my domain account.  The services can no longer log on.  Application pool cannot be started after the reboot/iisreset.
Resolution:  Change the log on details for the application pools used by IIS that run using the domain account that's password was reset.  Also start the Windows services that run using the windows domain account.

Ensure the SharePoint services running

Friday 12 November 2010

Central Admin is not working correctly - You may be trying to access this site from a secured browser on the server

Problem: Using Central Administration (CA) on SharePoint 2010 you can't use the menu and you see the following information "You may be trying to access this site from a secured browser on the server. Please enable scripts and reload this page."

Initial Hypthesis: FireFix work so it is a I.E. 8 issue.

Resolution: As suggested on the MSDN formun turn of the IE

More Info:
http://social.msdn.microsoft.com/Forums/en/sharepoint2010general/thread/4cf3a740-dddf-4c08-bc36-03efc731eff8
http://social.technet.microsoft.com/Forums/en/winservergen/thread/e87585de-d365-48c8-b08f-1050d68724ed

Tuesday 9 November 2010

Could not load the Web.config configuration file when debugging in SharePoint

Problem: I can't debug my SharePoint projects using Visual Studio 2010 (VS).  I get the error "Could not load the Web.config configuration file.  Check the file for any malformed XML elements, and try again.  The following error occurred: Cannot connect to the SharePoint site.  If you moved this project to a new computer or if the Url of the SharePoint site has chnaged since you created the project, update the Site Url property of the project." in VS when I try debug.



Initial Hypothesis: I recenctly renamed all my VS projects in my VS solution.  The error tells me to check the "Site Url" on each of my projects.  I missed the project that was set as my start up project.

Resolution: Set the "Site Url" property in VS on the projects.