Wednesday, August 18, 2010

An error has occured in Excel Web Services

So, Excel Web Services, if you really choose to use that feature and web part (I would not recommend it, there are so many other better solutions to display sheets!) then you might run into some issues. And it is really slow in performance. Well, it was up and running, and lots of users wanted it. Fine, no problems, added the trusted locations on the server and so on. Then one day it stopped and displayed this:

"An error has occured":

Don't you just love those instructive and informative error messages in SharePoint???

So, dug into Event Viewer and started scanning. Yup, there were errors but none of them related to this. Thought back of recent installations/changes to the environment and so on, and remembered that the web.config had been altered due to a third party web part installation. And that web part was never used, so I opened my web.config and went through the changes, and the only thing I could relate to this error was the proxy settings. So I changed the proxy setttings back from:

To this:

And yes, there was the solution (the customer does not use a proxy server, and if that had been the case then this error probably would never occure).

Wednesday, June 23, 2010

Script for SharePoint installation

This weeks task was to setup a SP2010 medium server farm. It took half a day, and using this powershell script to install the index server was AWESOME! You must edit the files before you run them, to add your own db names, servers etc, but once that is done it's a really fast setup! And, it also gives your default SP databases nice names, not GUIDs! The only databases it doesnt setup names for, are Application Registry, BDC and Search dbs:

Link to script here, at Codeplex.

Tuesday, May 25, 2010

User profile synchronization error

The crawl log in Search Administration returned the following error:
sps3://xxx could not be crawled

What you must do is to set permissions to the search account that you use for crawling the User Profiles.

Select User Profile Services (do not click the link, but highlight the application)

Up in the ribbon, click a button called "Administrators"

Enter the account that you use for search

Add the permission "Retrieve people data for search crawlers"

My first SP2010 installation, critical issues

This week I have installed my first SharePoint 2010 server and it has been great fun and very interesting! It is a test environment so it's a small server farm setup. After having a connection issue with the SQL server (everything is closed and denied) it was a fast and easy installation. Well that was the smallest part...

Fired up Central Administration, and went through it step by step. Trying to memorize where to find everything =) When you have worked for years in MOSS then it is a bit messy... When most settings were ready, the red ribbon turned up and warned about the farm having "Critical issues". Clicked on the messages and there were some errors:

1) The server farm account should not be used for other services
Ah yes, of course, an old classic. Open "Manage service accounts" and change the account to the one you use for your services in general. Not the farm admin account or an account who is a member of the local admin group.

2) Accounts used by application pools or service identities are in the local machine Administrators group. ¨
Click on "Manage service accounts" and change all services that uses your farm account to a specific service account instead. That account should be a least privilege account. Like before..

3) The unattended service account application id is not specified or has an invalid value.
This means that you must generate a new key and configure the Secure Store Service.

4) Missing server side dependencies
Did not really understand WHAT was wrong... so what do you do? Google of course! And yes, I was not alone... Found this guy's blog with a solution that I found was hilarious! I thought he had forgotten to write down a step in this solution, but no - follow these steps and the error message is gone! =)
Click General Application Settings
Under Search, click Farm-Wide Search Administration
Under Search Service Application click Search Service Application
Run iisreset -noforce (don't forget to run cmd as Administrator or else you get Access denied)
Thanks to

5) Verify that the Activity Feed Timer Job is enabled.
Well, just DO IT! Inside the timer job definitions, enable it.

6) Built in accounts are used as application pools or service identities
Again, change to correct account!

7) Validate the MySite host and individual MySites are on a dedicated web application and separate URL domain.
After a web application for MySite was setup, and some managed paths entered, this message disappeared.

Thursday, April 1, 2010

The semaphore timeout period has expired

I got this error message on my SharePoint farm backup (using the STSADM command
STSADM.EXE -o backup -directory \\srv001\sqlbackups -backupmethod full):

Object SharePoint_Config failed in event OnBackup. For more information, see the error log located in the backup directory. SqlException: Write on "\\srv003\SP_Backup\spbr0001\0000001D.bak" failed: 121(The semaphore timeout period has expired.) BACKUP DATABASE is terminating abnormally.

My first thought was that it conflicted with another backup job, so I moved the start time for the backup several times to see if that helped. Obviously it lost connection to the SQL server. But to move the start time did not help. I googled it but did not find anything helpful and after having analysed the Event Viewer errors and the backup log error, I saw that the error message was displayed almost immediately after the backup had started. And then I realised that maybe it had to do with the time limit for the backup job instead of a timeout against the SQL server. So, I increased the time limit in Scheduled tasks (which runs my bat file) with a couple of hours and then the backup went through without any errors.

Just one of those error messages that are hard to determine the right solution for....

Friday, March 19, 2010

How to restore a SharePoint site using SQL database backup

This week I had to do a restore of a site collection using only SQL database backup. The customers hosting partner had not setup a SharePoint farm backup and had no test environment available that we could restore the database to, so they restored the database back to the SQL server into the production environment.
When I did an attach of the contentdb, SharePoint config would not let that database into the farm since it had the same GUID as the original database (of course, since it was a restore). We tried to run some querys on the SQL to alter the GUID, but without success. Performed these steps instead, which includes detach the original db, attach the restored db to the same web application, export the site that was deleted, detach the restored db again, attach the original db and import the subsite (which was the reason for the restore).

Iisreset /stop
Detach the current content db WSS_Intranet from the SQL Server (this is the original database)
Iisreset /start
Attach the restored content db WSS_IntranetRestored
Open the site you want to restore and copy the URL
Export the site Tools via stsadm –o export –url https://intranet/se/tools -filename d:\temp_backup\restore –includeusersecurity –versions 4 overwrite (where the syntax restore is a PREFIX for the backup files and NOT a filename you create)

Iisreset /stop
Detach the restored content db

Iisreset /start
Open Central Administration, enter Content databases, remove the restored db
Content databases, add the original content db
Attach the old content db


Import stsadm -o import -url https://intranet/se/tools -filename "d:\temp_backup\restore.cmp" -includeusersecurity -updateversions 2


Thursday, March 18, 2010

SharePoint farm backup

I think I have blogged about this before, but I cannot enough emphasize the importance of running SharePoints own backup together with your SQL database backup. Of course, some third party backup products might be able to restore in the same way as you can restore a site collection backup inside Central Admin, but it IS really easy in CA to do this. It's not that easy if you must restore a SQL database and add the content db to a new web application. What I want to restore is a single subsite inside of a sitecollection.
When using SharePoints restore option, you could easily restore a whole site collection to a new web app (either on a new server or the same) and access it by using http://server:portnumber, export the site (through stsadm or SPD) and then delete the restored web app again. Fast and easy.
But... I ran into a customer that was only using SQL db backup and some third party product, and they were only able to restore the SQL database so I had to create a new web application, detach the db that was installed default, and then add the restored db via STSADM and addcontentdb. I got a lot of errors, and it turned out that when I had attached the restored content db, and looked in "Content databases" it showed 0 sites! So, the db was attached but contained nothing. Will do a SQL hack to change the GUID to something else... and so on. A lot more work!!
So today I setup the farm backup with a .bat file and put it in Scheduled Tasks and made sure it ran correctly. Got this error:

"Object WSS_Content_MySite failed in event OnBackup. For more information, see the error log located in the backup directory. SqlException: Cannot open backup device '\\serverxxx01\backup\spbr0000\0000001A.bak'. Operating system error 5(error not found). BACKUP DATABASE is terminating abnormally."

If you get this error when trying to run backup in SharePoint Central Administration (or using the STSADM command for full backup) then you must do the following:

1) Logon to the SQL server and determine which account that runs the MSSQLSERVICE and add that account to your backup device (that is, the SHARE where you put your backup files) and give it "Edit" permissions.

Thursday, March 11, 2010

VPN client for Windows 7

I have installed Windows 7 and Office 2010 now, which is a big improvement from Vista! Though there are some applications that do not work with Win 7, like Cisco VPN. Yes, I am sure that someone has found a version and have done all the settings/regedit hacks that you must do, but really... So I found this VPN client, called Shrew Soft Inc! I needed to be able to import a pcf file, which works great with Shrew soft.