none
SPWeb Object Disposed Error On New Best Bet

    Question

  • Hello SharePoint Fam,

    I have been adding Best Bets with no problem for almost a year now and for some reason now I am getting error:

    Trying to use an SPWeb object that has been closed or disposed and is no longer valid.

    Each time I try to create a new Best Bet/Keyword.  I am using all ootb functions and not sure where to look to resolvethis.  I downloaded the disposechecker tool but not really sure how to use this tool.  I am only seeing this error with new Best Bet keywords and no where else.  Not sure if error is coming from keywords.aspx, masterpage or if there is application pool issue.

    Please Help somebody!!!!! Thanks N Advance :) 

    Wednesday, June 19, 2013 5:48 PM

Answers

  • Hello,

    had weird thing that just happened that is kind of good i guess.  I just figured let me try and stop and start on managed metadata service.  After starting it back up and trying a best bet it worked with no error at all?????  Anyone know what that may mean?  Is managed metadata possibly configured wrong somewhere that will cause this every now and then?  Didnt think best bet was tied to managed metadata at all.

    Thanks n advance

    Thursday, June 20, 2013 7:21 PM
  • Hi dabrams28,

    The error message often shows with developer, like when development with SPCurrent.Current.Web, or do changes of a SPWeb object after disposing.

    In the default UI action, may happens with the SharePoint publishing instruction feature, when creating enterprise site or page. Not sure why this happens when add best bets in search key words, seems some feature issue with managed metadata service application, as the key words is hosted in it.

    To further look at this issue, it would be better to open a support ticket.

    Thanks,


    Qiao Wei
    TechNet Community Support

    Friday, June 21, 2013 3:40 AM
    Moderator

All replies

  • Hey dabrams28,

    That is really strange, so you won't really be able to run disposechecker. I believe it's traditionally used for your own custom development to ensure you are properly disposing of SharePoint objects. However, since you are strictly OOB right now, it doesn't really apply.

    Have you checked the logs to review entries matching the correlation ID it's spitting out?


    Shereen Qumsieh http://sharepointdeveloperhq.com @msshushu

    Wednesday, June 19, 2013 5:59 PM
  • Very strange Shereen!!  I have went to the logs and they give me same message just with different correlation ID each time of course:

    06/19/2013 14:09:28.20 w3wp.exe (0x1738)                       0x19F4  SharePoint Foundation                 General                                8e1f                High       Failed to find the XML file at location '14\Template\Features\SharePointBoost.Common.Settings.Site\feature.xml'   242f82b4-8587-43ff-a0d8-92ac853cf418

    06/19/2013 14:09:28.20 w3wp.exe (0x1738)                       0x19F4  SharePoint Foundation                 Feature Infrastructure                        fs74        Medium               Feature definition missing for Feature 'SharePointBoost.Common.Settings.Site' (Id: '1170444c-cb9f-4409-9271-82f46a90b23a')            242f82b4-8587-43ff-a0d8-92ac853cf418

    06/19/2013 14:09:28.20 w3wp.exe (0x1738)                       0x19F4  SharePoint Foundation                 General                                8e1f                High       Failed to find the XML file at location '14\Template\Features\SharePointBoost.Common.Settings.Site\feature.xml'   242f82b4-8587-43ff-a0d8-92ac853cf418

    06/19/2013 14:09:28.20 w3wp.exe (0x1738)                       0x19F4  SharePoint Foundation                 Feature Infrastructure                        fs74        Medium               Feature definition missing for Feature 'SharePointBoost.Common.Settings.Site' (Id: '1170444c-cb9f-4409-9271-82f46a90b23a')            242f82b4-8587-43ff-a0d8-92ac853cf418

    06/19/2013 14:09:28.21 w3wp.exe (0x1738)                       0x19F4  SharePoint Foundation                 General                                       90hv      Unexpected       Detected use of SPRequest for previously closed SPWeb object.  Please close SPWeb objects when you are done with all objects obtained from them, but not before.  Stack trace:    at Microsoft.SharePoint.SPSite.InitUserToken(SPRequest request)     at Microsoft.SharePoint.SPSite.SPSiteConstructor(SPFarm farm, Guid applicationId, Guid contentDatabaseId, Guid siteId, Guid siteSubscriptionId, SPUrlZone zone, Uri requestUri, String serverRelativeUrl, Boolean hostHeaderIsSiteName, SPUserToken userToken)     at Microsoft.SharePoint.SPSite..ctor(SPFarm farm, Uri requestUri, Boolean contextSite, SPUserToken userToken)     at Microsoft.SharePoint.SPSite..ctor(String requestUrl)     at Microsoft.Office.Server.Search.Administration.Keywords.Initialize(SearchServiceApplicationProxy searchAdminProxy, Uri ...            242f82b4-8587-43ff-a0d8-92ac853cf418


    • Edited by 41globalit Wednesday, June 19, 2013 6:48 PM wrong error copied
    Wednesday, June 19, 2013 6:15 PM
  • Ok that sucks.

    What type of logging do you have enabled? Verbose? It's really weird and I'm wondering if there is anything being logged before it hits the SPRequest error.

    Also you probably already tried this, but has the app pool been recycled?


    Shereen Qumsieh http://sharepointdeveloperhq.com @msshushu

    Wednesday, June 19, 2013 6:52 PM
  • Correct, I have verbose logging enabled.  I have recycled some of the app pools but not all.  I have app server & web server not sure which one I need to recycle for this issue.  My APP Pools are below, web server on left, app server on right:




    • Edited by 41globalit Wednesday, June 19, 2013 7:51 PM new app pool image
    Wednesday, June 19, 2013 7:41 PM
  • Hello,

    had weird thing that just happened that is kind of good i guess.  I just figured let me try and stop and start on managed metadata service.  After starting it back up and trying a best bet it worked with no error at all?????  Anyone know what that may mean?  Is managed metadata possibly configured wrong somewhere that will cause this every now and then?  Didnt think best bet was tied to managed metadata at all.

    Thanks n advance

    Thursday, June 20, 2013 7:21 PM
  • That is weird. Not sure if anyone has any feedback on why that is, but great to hear it's working again!

    Shereen Qumsieh http://sharepointdeveloperhq.com @msshushu

    Thursday, June 20, 2013 10:28 PM
  • Hi dabrams28,

    The error message often shows with developer, like when development with SPCurrent.Current.Web, or do changes of a SPWeb object after disposing.

    In the default UI action, may happens with the SharePoint publishing instruction feature, when creating enterprise site or page. Not sure why this happens when add best bets in search key words, seems some feature issue with managed metadata service application, as the key words is hosted in it.

    To further look at this issue, it would be better to open a support ticket.

    Thanks,


    Qiao Wei
    TechNet Community Support

    Friday, June 21, 2013 3:40 AM
    Moderator
  • I restarted the Managed Metadata service and added the keyword but after that, on again creating a new best bet the error appeared. I restarted the service againg but the error still appears.

    Any help?


    SharePoint Developer and Administrator

    Thursday, October 03, 2013 8:39 AM
  • Hello Paramdeep,

    Restarting the managed metadata service is what did the trick for me, not sure what other steps you might want to take.   Have you tried rebooting the server that this service resides on and see if that does anything or restarting iis/ca?  Are you getting any errors in the event log?

    Friday, October 04, 2013 12:59 PM
  • Well since I was on a Production environment therefore could not perform the iis reset during working hours, but I did the same activity on pre-live and iis reset worked for me. After that it never appeared, I guess stopping the worker process is the final solution if restarting managed metadata service does not work.

    SharePoint Developer and Administrator

    Saturday, October 05, 2013 9:49 PM
  • I am getting this same issue after we installed SP2 and I was able to reproduce it (after spending hours of pulling my hair out).

    For me, the issue occurs ONLY when I try to add a keyword that is already a synonym.  Instead of an error stating 'Keyword cannot be used b/c it is already a synonym', it shows same error:

    Trying to use an SPWeb object that has been closed or disposed and is no longer valid.
    Troubleshoot issues with Microsoft SharePoint Foundation.
    Correlation ID: f748c0af-cb68-4b60-a080-2c3affa77198
    Date and Time: 2/19/2014 1:23:35 PM

    So, I also reproduced on our DEV environment by following these steps:

    1. Add Keyword 'Apple' with Synonym 'IPad' and save
    2. Add Keyword 'IPad' with Synonym 'Tablet' and save
    3. Error occurs.

    Can someone with SharePoint 2010 SP2 try above to see if they get same result?  Sounds like a .NET or SharePoint error (from Microsoft)

    More detail was displayed in our DEV environment:

    Trying to use an SPWeb object that has been closed or disposed and is no longer valid.
    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: Microsoft.SharePoint.SPException: Trying to use an SPWeb object that has been closed or disposed and is no longer valid.
    Source Error:
    [No relevant source lines]

    Source File: c:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\d277ff4b\73ad00a7\App_Web_keyword.aspx.2a428413.jxsi4w20.0.cs    Line: 0

    Stack Trace:
    [SPException: Trying to use an SPWeb object that has been closed or disposed and is no longer valid.]
       Microsoft.Office.Server.Search.Internal.UI.SearchAdminPageBase.ErrorHandler(Object sender, EventArgs e) +275
       System.Web.UI.TemplateControl.OnError(EventArgs e) +11064446
       System.Web.UI.Page.HandleError(Exception e) +109
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +11070219
       System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +11069770
       System.Web.UI.Page.ProcessRequest() +91
       System.Web.UI.Page.ProcessRequest(HttpContext context) +240
       ASP._layouts_keyword_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\d277ff4b\73ad00a7\App_Web_keyword.aspx.2a428413.jxsi4w20.0.cs:0
       System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +599
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +171


    Herschel

    Friday, February 21, 2014 4:05 PM