Operation is not valid due to the current state of the object

Mike Pulis 1 Reputation point
2021-10-04T14:26:21.193+00:00

Im getting the following error in SharePoint 2013

Exception System.InvalidOperationException: Operation is not valid due to the current state of the object. at Microsoft.SharePoint.SPUserToken.GetClaimsUserLoginName() at Microsoft.SharePoint.SPSite.CopyUserToken(SPUserToken userToken) 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, Boolean appWebRequest, String appHostHeaderRedirectDomain, String appSiteDomainPrefix, String subscriptionName, String appSiteDomainId, Uri primaryUri)

I also see this error:
w3wp.exe (0x3FF4) 0x1E3C SharePoint Foundation Web Parts emt4 High Error initializing Safe control - Assembly:Microsoft.Office.Access.Services.Application, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c TypeName: Microsoft.Office.Access.Services.Data.ApplicationCookie Error: Could not load type 'Microsoft.Office.Access.Services.Data.ApplicationCookie' from assembly 'Microsoft.Office.Access.Services.Application, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'.

I have tried IISRESET, adding <add key="aspnet:MaxHttpCollectionKeys" value="5001" /> to web.config but nothing is working

Central Admin comes up with no issues reported

Any help would be grateful

SharePoint Server Management
SharePoint Server Management
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Management: The act or process of organizing, handling, directing or controlling something.
2,878 questions
{count} votes

4 answers

Sort by: Most helpful
  1. Mike Pulis 1 Reputation point
    2021-10-05T12:56:07.17+00:00

    We switched back to the old SQL Server and the SharePoint Site came right up. so we noticed we had SQL Server Enterprise and Trying to restore a database to SQL Server Standard.

    The DBA went thru the Database and uncompressed each table one by one and then made a backup of that and it restored with no issues.

    SharePoint 2013 started right up and no more errors

    0 comments No comments

  2. Mike Pulis 1 Reputation point
    2021-10-06T17:44:26.313+00:00

    now we are getting this error after running overnight we are just trying the url/pages/default.aspx

    w3wp.exe (0x296C) 0x2DB8 SharePoint Foundation General 8nca Medium Application error when access /Pages/default.aspx, Error=Operation is not valid due to the current state of the object. at Microsoft.SharePoint.SPUserToken.GetClaimsUserLoginName() at Microsoft.SharePoint.SPSite.CopyUserToken(SPUserToken userToken) 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, Boolean appWebRequest, String appHostHeaderRedirectDomain, String appSiteDomainPrefix, String subscriptionName, String appSiteDomainId, Uri primaryUri) at Microsoft.SharePoint.SPSite..ctor(SPFarm farm, Uri requestUri, Boolean contextSite, Boolean swapSchemeForPathBasedSites, SPUser... e28df69f-3865-0043-0963-fb81a572b661

    0 comments No comments

  3. Mike Pulis 1 Reputation point
    2021-10-06T18:13:49.177+00:00

    if im using SharePoint Server Enterprise can i connect to SQL Server Standard?

    0 comments No comments

  4. Mike Pulis 1 Reputation point
    2021-10-18T16:37:18.49+00:00

    we upgraded to SQL enterprise and it worked for a few days but now im back to the following error

    w3wp.exe (0x3084) 0x22E0 SharePoint Foundation General ajlz0 High Getting Error Message for Exception System.InvalidOperationException: Operation is not valid due to the current state of the object. at Microsoft.SharePoint.SPUserToken.GetClaimsUserLoginName() at Microsoft.SharePoint.SPSite.CopyUserToken(SPUserToken userToken) 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, Boolean appWebRequest, String appHostHeaderRedirectDomain, String appSiteDomainPrefix, String subscriptionName, String appSiteDomainId, Uri primaryUri) at Microsoft.SharePoint.SPSite..ctor(SPFarm farm, Uri requestUri, Boolean contextSite, Boolean swapSchemeForPathBas..

    All I am doing is trying to log into the main page of the app

    I tried restarting SQL server service, iisreset, restart SharePoint Timer Service.. and even

    psconfig.exe -cmd upgrade -inplace b2b -force -wait -cmd applicationcontent -install -cmd installfeatures -cmd secureresources -cmd services -install -cmd helpcollections -installall

    Not sure why its not working again

    @Yi Lu_MSFT