Monday, November 8, 2010

Error creating a Project Site Template

SymtpomsWhen creating a site template for a Project Server 2010 Site Template, you receive a correlation error with out any useful error message. Looking further into the SharePoint ULS logs the following error message is found.

Error  Messages
SharePoint throws a site error and display a correlation ID

Error
An unexpected error has occurred.
Troubleshoot issues with Microsoft SharePoint Foundation.
Correlation ID: f8145bf3-b9f3-441a-987b-75c13cca85c8
Date and Time: 8/11/2010 6:50:50 PM


The following error can also be found in the SharePoint ULS Logs.

SPSolutionExporter: System.UnauthorizedAccessException: Access to the path 'C:\Temp\SPSolutionExporter-d15ec730-0b24-4767-a7c9-c032238a2253\20101103_SantosProjectSiteTemplateListInstances\Files\Lists\Risks\Schema.xml' is denied.   
 at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)   
 at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)   
 at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)   
 at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)   
 at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize)   
 at System.IO.StreamWriter..ctor(String path)   
 at Microsoft.SharePoint.SPSolutionExporter.<>c__DisplayClass1b.<PerformContentFixupOnFile>b__19()   
 at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode)   
 at Microsoft.SharePoint.SPSolutionExporter.PerformContentFixupOnFile(String fileFullPath)   
 at Microsoft.SharePoint.SPSolutionExporter.<>c__DisplayClass16.<PerformGuidFixupOnDirectory>b__15()   
 at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode)   
 at Microsoft.SharePoint.SPSolutionExporter.<>c__DisplayClass16.<PerformGuidFixupOnDirectory>b__15()   
 at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode)   
 at Microsoft.SharePoint.SPSolutionExporter.<>c__DisplayClass16.<PerformGuidFixupOnDirectory>b__15()   
 at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode)   
 at Microsoft.SharePoint.SPSolutionExporter.<>c__DisplayClass16.<PerformGuidFixupOnDirectory>b__15()   
 at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode)   
 at Microsoft.SharePoint.SPSolutionExporter.<>c__DisplayClass16.<PerformGuidFixupOnDirectory>b__15()   
 at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode)   
 at Microsoft.SharePoint.SPSolutionExporter.ExportWebAsSolution()

Solution
This error is actually a security access issue. The account trying to access the C:\Temp path is actually an IIS application pool account. Not sure exactly which one but my logical guess would be the SharePoint one. Open IIS and check what application pool account SharePoint is running under. Then navigate to Right click the 'C:\Temp ' folder, select properties and click on the security tab. Click edit and add the IIS application pool account. I gave the account full access but you can test if still works with more restricted permissions. Once you apply these changes you should be able to create the site template without causing an error.

Tuesday, August 24, 2010

Project Server 2010 - Visual Upgrade

When you upgrade a Project Server 2007 instance to 2010 the project workspaces actually come across with the exact same look and feel as they were in the 2007 enviornment. As part of this upgrade, you can choose to perform a visual upgrade on any individual web (project site). This option can be found under Site Actions>Site Settings menu. Then click on the 'Title, description and icon' link. Down the bottom right corner, there are three options. Now this is off the top of my head but if i get time to double check the exact wording, I'll update this post later.
  1. Leave - Keeps the site look and feel in the previous 2007 format.
  2. Preview visual upgrade - Lets you view the site if it were upgraded but does not commit the setting.
  3. Commit visual upgrade - Doing this removes these three options permenately but apparently you can revers this action via PowerShell if you need. A bit of bing magic should find the exact syntax you require.
Now this is handy to know but what if you had just upgraded a Project Server environment containing over 500 sites. Would I have to upgrade each project site individually? The answer, thankfully, is no. You can find a visual upgrade setting at the site collection level (Site Actions>Site Settings>Visual Upgrade of the base site collection site). By setting the upgrade here, it will cascade the visual upgrade to all sub web of the site collection. Very handy to know for those big upgrades.

Project Server 2007 to 2010 Upgrade

Something to share today. When migrating a content Project 2007 content database, I discovered the SharePoint content database which contains all the project sites would not upgrade if you already have an existing instance in the same destination SharePoint farm.

The scenario was I upgrded the content database in its own web application. Worked perfectly. Then for another test I created a brand new web application, restored another copy of the 2007 content database into SQL. Then ran the stsadm -o addcontentdb command to upgrade the content database. After it completes (with errors, but this is normal) I notice the site collection did not upgrade. Further investigation showed it did not even register according to the SharePoint GUI in Central Administration. This would continue to fail until I actually removed the previous web application

Now this is pure speculation but i suspect the issue is because the SharePoint sites come accross with their existing unique identifiers (GUIDs) and SharePoint may sense these IDs are already in use and therfore discards them in the second instance upgrade. Now, you may think, WOW, that's amazing Piet! but let's face it why on earth would you want to do this in a real world scenario anyway? Well I did and thought it may be handy to know for someone else experimenting with Project Server upgrades.