Friday, March 28, 2008

401 Error when trying to create MySite (personal site) in SharePoint 2007

It's a common enough problem that you can find untold numbers of questions posted to forums and blogs: why am I getting a 401 denied error when trying to get to/create a mysite personal site in SharePoint? The problem usually is manifest by first being presented with a username/password prompt three times, followed by a 401 error. Interestingly, in Firefox, it appears that sometimes you just get unending username/password prompts. Why this is happening: who knows? It's often possible to track down the problem, usually related to application pool permissions or some rogue setting in SharePoint. Even if you do find the problem, though, enough settings in SharePoint are reasonably inaccessible after the initial setup that finding your way to correcting it can take a very, very long, frustrating time. Our solution has been simply to create a new default shared services provider (SSP) and associate all of the web applications, including the existing mysites, to the new SSP. The Shared Services Provider in SharePoint is the glue that holds everything together. It manages, in particular, what happens when you click on the "mysite" link. So when that link no longer functions properly, one way to fix it is to set up a new SSP using a new content database and new IIS web site. In this way, we can eliminate a lot of errors without having to do a lot of painful troubleshooting. We'll go through those steps now. Note that these steps are for SharePoint 2007; they may work on 2003 as well, but I've no experience with it, so I make no promises as to its applicability. Create the New Shared Services Provider Open SharePoint Central Administration and click on the Shared Services Administration link on the left-hand side of the screen. You should see something like the screen shot below. To create a new Shared Services Provider, click on the New SSP link. You'll want to create a new web application to host this, on a new port. Also, specify a new SSP Database, ensuring that any erroneous settings don't get migrated. Make sure that you use your existing MySite web application (in this example, named "Sharepoint - Personal") for the My Site Location in setting up this new SSP. Once you've created your new SSP, you can set it as the default (using the Change Default SSP link). Once you've done that, use the Change Associations link to associate all of your existing web applications to the new SSP. Having done that, you're probably good to go. You might, just to be safe, double-check your My Site settings in the new Shared Services site. Check your My Site Settings On the left-hand menu, under Shared Services Administration, click on the title of your new SSP. This will open the SSP home page, like below. Click on the My Site Settings link and make sure that the Personal Site Location field matches what you had set up previously. Having done that, you're done! Delete any erroneously-created My Sites Unless you're not: if you discover later that the personal site location field is incorrect, you may end up with users creating new sites when they already had one. This is disconcerting, but it's easily fixed. To delete a user's My Site, simply click on the Delete Site Collection link in the Application Tab of the Central Administration page. There you can select the offending site collection from the My Site web application. This will delete the My Site without problem. However, you still need to change the My Site settings in the SSP, as above. And: having done so, issue a iisreset /noforce on the front-end web servers. Unless you do this, the user runs the risk of being directed, even still, to the now-nonexistent My Site. This gives them a 404 (not found) error. After the iisreset, they should be directed, again, to their original my site.

8 comments:

  1. how about data that saved in old personal site ?
    can i copy it to the new personal site (in case i create a new ssp and my site host)?
    i have same problem, and i have at least 200 users with their personal site.

    ReplyDelete
  2. Aris,
    You can do a couple of things:
    The easiest is to reuse your existing personal sites web application for the mysites in your new SSP. That is: when you create a new SSP, instead of creating a new mysites web application, choose your existing one, instead.

    The other option is to backup your old personal web application, and then restore it to the new one. I'd definitely try the first option, but if that doesn't work, I can walk you through the steps with the second.

    I hope that helps! -Lane

    ReplyDelete
  3. I am going through the problem. Originally MySite was on a seperate SSP and currently nobody can access their MySite. I plan to create a sub area in main portal and move the existing sites with stdadm. Say:
    http://mysite.domain.com
    and I want to move it to
    http://mainportal.domain.com/personal
    Any help and suggestion to automate this process would save me hours. Thanks

    ReplyDelete
  4. Hi, Tugay,

    Basically, it sounds like you want to put your personal sites into the main web application. Do make sure you've taken a backup of that application before doing this!

    I don't know if you've automated the backups of your individual site collections, but you'll need to back them up individually in order to restore them to the main web application. Happily, several people, like Mauro Cardarelli, have created (mostly vbs) scripts to make this job much faster. You can see his script, which we use in a modified form, here.

    Unfortunately, I don't yet know of a way to restore all of these site collections programatically, so there's still some not-inconsiderable work ahead. Of course, for a one-time thing, it might not be too bad to copy the directory listing to a text file and do a little vbs script to read those files and restore them accordingly. I haven't done it, but it's on my list of things to do.

    I would be aware of MS kb924399. You'll want to do the steps in this article, since it won't have been done for you in the web application creation.

    ReplyDelete
  5. If you do this, do you still keep your existing portal site on the same SSP intact?

    ReplyDelete
  6. Hi, Amuro,

    The answer is: sortof. :)
    Basically, we're creating a new SSP and moving associating all of the existing web applications with the new one. So, while you're creating a new SSP, you associate the existing mysite web application, portal application, etc. (without having to touch the content of any of them) with the new SSP.
    Basically, we're creating a new back-end to serve out all of our web applications, and in the process, we're often able to clear up a lot of errors without too much fuss.

    ReplyDelete
  7. Check http://www.sharepointblogs.com/jasonmedero/archive/2008/04/21/receiving-401-unathorized-when-accessing-mysites.aspx
    i have done with the solution provided. i think it's more simple.
    thanks.

    ReplyDelete
  8. You're right, Clark: if the problem is limited to the site collection, this page (which says re-creating the site collection for MySites fixed a problem with the same symptoms) will fix it. I'm glad that worked for you!

    ReplyDelete

Thanks for leaving a comment!