Link to home
Start Free TrialLog in
Avatar of Jono Martin
Jono MartinFlag for United States of America

asked on

SharePoint 2010 "Object reference not set to an instance of an object."

I am getting the following error when trying to access our only SharePoint site:

Server Error in '/' Application.
--------------------------------------------------------------------------------

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
   Microsoft.Office.Server.Administration.UserProfileApplicationProxy.get_ApplicationProperties() +134
   Microsoft.Office.Server.Administration.UserProfileApplicationProxy.get_PartitionIDs() +44
   Microsoft.Office.Server.Administration.UserProfileApplicationProxy.IsAvailable(SPServiceContext serviceContext) +329
   Microsoft.Office.Server.WebControls.MyLinksRibbon.get_PortalAvailable() +44
   Microsoft.Office.Server.WebControls.MyLinksRibbon.EnsureMySiteUrls() +60
   Microsoft.Office.Server.WebControls.MyLinksRibbon.get_PortalMySiteUrlAvailable() +15
   Microsoft.Office.Server.WebControls.MyLinksRibbon.OnLoad(EventArgs e) +91
   System.Web.UI.Control.LoadRecursive() +65
   System.Web.UI.Control.LoadRecursive() +190
   System.Web.UI.Control.LoadRecursive() +190
   System.Web.UI.Control.LoadRecursive() +190
   System.Web.UI.Control.LoadRecursive() +190
   System.Web.UI.Control.LoadRecursive() +190
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2427

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.5448; ASP.NET Version:2.0.50727.5456

We are using SharePoint 2010 (basically out of the box) on Server 2008 R2.

I can get to the SharePoint Central Admin site ok.  I have done an IISRESET and I've restarted the site.  Any ideas of what to check next?

Thanks,
Jono
Avatar of Justin Smith
Justin Smith
Flag of United States of America image

Sometimes there can be an issue with a web part or something on the page that throws the error, rather than an issue with the entire site or app.
Avatar of Jono Martin

ASKER

ACH1LLES - Thanks for the quick reply.  I can get to the URL you asked about.  I can also get to other sites by entering the specific URL, except the Home page.  In all of these examples, the navigation bar gives me an error, but other things seem to work OK.  Also, I can navigate the database through Windows Explorer.

Can you give me something to look for regarding the home page and the navigation bar?  All was working well until this morning when it started throwing this error out.

One more thing that may be useful: When connecting from the outside the network—using a different URL—the authentication dialog pops up before it gives me the error (from inside the network, it uses the domain credentials).  This, along with the Windows Explorer success means that the database is OK, right?

Thanks again for your help.
What template does this site use?  Is publishing turned on?
I hate to sound like I have no clue about these things, but I'm not very familiar with SharePoint.

I spoke to the person who set it up more than 1½ years ago.  He doesn't know a lot about it either, but he said he started with a team template and made modifications along the way.  Regarding publishing, he's pretty sure he turned that on at some point, but we're not 100% on that.

Can you tell me how to find that information?
Ok.

I'm assuming this is SharePoint Server 2010?

If you go into Central Admin, Application management, Manage Service Applications.....can you click on the User PRofile Service to access the admin page?

By the way, if you ever need remote assistance, I"m available.  My email address is in my profile.
When I go there, I get to
Central Administration > Manage Profile Service: User Profile Service Application

On that page I have this line in red:
"This User Profile Application's connection is currently not available. The Application Pool or User Profile Service may not have been started. Please contact your administrator."

This is followed by a bunch of links in the following 4 categories:
People, Synchronization, Organizations, My Site Settings
ASKER CERTIFIED SOLUTION
Avatar of Justin Smith
Justin Smith
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I went to Services on Server and I saw that the User Profile Service was Started, but the User Profile Sync Service was Stopped.  I click Start a while ago and it's been on Starting ever since.  I did an IISRESET on the server and then refreshed the Services on Server page; still says Starting.
Is the farm admin account a local admin on the box?
No, it's a domain admin account.
So it's not in the local admin group?
It's a member of the Domain Admins group with is a member of the local admins group.
Ok.  I would review this write up:  http://www.harbar.net/articles/sp2010ups2.aspx

Bottomline, the Sync service seems to be the source of the issue.
OK, I now have the User Profile Synchronization Service started, but the "Object Reference not set" error remains.

What else can I check?

In the server application logs, I see SharePoint Foundation (ID 8306) error repeatedly saying "An exception occurred when trying to issue security token."

I also saw Forefront Identity Manager (ID 3) stating that the "HostId is not registered", and ILM Web Service Config (ID 234) Warning saying that the "ILM Certificate could not be created."

Do these errors say anything to you about this issue?
So you can now access the UPS admin page?  Can you click User Properties?

DId all this happen out of the blue?  Or did you recently install updates?  Have you rebooted?
I still get the red line stating "This User Profile Application's connection is currently not available. The Application Pool or User Profile Service may not have been started. Please contact your administrator."

I rechecked the User Profile Service and the User Profile Sync Service and they both say Started.

This happened right after updating the SSL cert, but the site is not setup for SSL; it's running on port 80.  We've included this site (or the external URL for it) so that we can go to SSL in the future.

I have not rebooted the server; I restarted IIS and the site in IIS several times by now.

Do you think the SSL cert is affecting the site even though it's not using SSL?
My time is up here.  Though I may be able to check on updates, I'll not be available to do any testing or troubleshooting again until Monday morning (ET).

Thanks for your continued assistance.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
dmoghe - The Forefront Identity Manager Service and the Forefront Identity Manager Sync Service were both set to Disabled.  I set them to Manual and started them to no avail.

When you say to remove the UPA association, do you mean the User Profile Service Application?  I'm not sure how to do that as the association checkboxes are grayed out.  In order to do that, do I need to change from Default to Custom first?

Having had the weekend to think about this, it seems like more than a coincidence that this happened right after updating the SSL cert, even though SP is on http, not https.

Can someone give me something to check or try relating to that?  Is there an easy way to "turn off" the SSL cert as a test?

We have been without SP now since Friday morning.  Thanks again to anyone for assistance.

Jono
dmoghe - I figured out that I'd clicked on the wrong thing in Service Application Associations.  Once I clicked on "default" rather than the web application name, I got the checkboxes.  I unchecked User Profile Service Application and then SP worked again.

My question now is: What is the User Profile Service Application and what am I now losing by unchecking it?

Thanks,
Jono
You lose user profile information access from that web application and any web application that is subscribed to the Default group.  When you click on a users name on the site, you won't go to their profile page.  You also lose MySite capability.
I saw on MS site what that service is.  We need to have what User Profile Service Application offers.  How do I get that back without losing the site again?
Also, the Forefront ID Manager Service and the Forefront ID Manager Sync Service were Disabled before I set them to Manual and started them.  Should they be started?  What should be the status and startup type for these 2 services?
You should NOT be messing with these two services in services.msc.  You should only interact with them through SharePoint.

You need to put them back to Disabled and running as Local System.  Then, through Central Admin, you start the User Profile Sync Service.  This should change their start up to Auto, and change the account to the farm account.  

However, when I told you to do this earlier, you said that the services started but when you went to the Uuser Profile admin page you got red text that said something wasn't available.  Is this still corrrect?
That was correct at the time, but now we're back to it being stuck on Starting.  I'm trying to read through that document you sent me (http://www.harbar.net/articles/sp2010ups2.aspx), but I'm having a hard time with a couple of things.  Where can I see what the Farm account is?  According to the document, the UP Sync service must run using the Farm account.  But it was running prior to the SSL cert update.

How can I find out what account the UP Sync service is using?  In Services.msc on the server, I see the UP service—it's using the Local System account—but I don't see the UP Sync Service there.  On the Services on Server in Central Admin, it doesn't show what account is being used by each service.
Typically its the account that is running the SharePoint Timer Service on your servers.  Go look in services.msc to see.

When you start the UPS, you are prompted to enter a password.  It should be the account running the timer service that you are prompted for.

This is the same account that will eventually get set to run the two ForeFront services, once the Sync service starts from Central Admin.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
My comment from above:  "through Central Admin, you start the User Profile Sync Service.  This should change their start up to Auto, and change the account to the farm account.  "

Normally I wouldn't advise playing around with the SharePoint Web Services site.  If the Sync service is started, you don't have any red text on the admin page, and the two ForeFront services are started and running as the domain account.....I guess you're good to go.
Thanks ACH1LLES.  All of those things are true.  It must have been that when I updated the SSL cert, it added (or I added without realizing it) another https binding on the SP Web Services site in IIS.

Thanks again for all your help; I have a happy userbase now.

Points coming next.

Jono
The main issue was the multiple https bindings on the SP Web Services site in IIS, but I wouldn't have gotten there without the other selected solutions.