"Database is too old and upgrade is required" installing the State Service in SharePoint Subscription Edition?

Steven Hahn 35 Reputation points
2023-07-25T00:48:37.48+00:00

Running SharePoint Server Subscription Edition with the July updates. (May updates in my lab where I was able to reproduce the issue)

The state service is required for InfoPath Services to work properly.

It must be installed at the command line:

$db = New-SPStateServiceDatabase -Name 'SP_State_Service'
$sa = New-SPStateServiceApplication -Name 'State Service' -Database $db
New-SPStateServiceApplicationProxy -Name 'State Service Proxy' -ServiceApplication $sa -DefaultProxyGroup

This works fine.

But after installing - you get errors that the "Database is too old and upgrade is required" in the Review problems and Solutions.

Running Psconfig with updates:

PSConfig.exe -cmd upgrade -inplace b2b -force -cmd applicationcontent -install -cmd installfeatures

An exception of type Microsoft.SharePoint.PostSetupConfiguration.PostSetupConfigurationTaskException was thrown. Additional exception information: The upgrade command is invalid or a failure has been encountered. CanUpgrade [StateDatabase Name=SP_State_Service] failed. (EventID:an58c) Exception: The SELECT permission was denied on the object 'Versions', database 'SP_State_Service', schema 'dbo'.The SELECT permission was denied on the object 'Versions', database 'SP_State_Service', schema 'dbo'.The UPDATE permission was denied on the object 'Versions', database 'SP_State_Service', schema 'dbo'. (EventID:an58c) Cannot upgrade [StateDatabase Name=SP_State_Service]. (EventID:an59g)

We see the following in the upgrade logs:

User's image

In SQL, you see the same as

User's image

User's image

But from other articles, it looks like you may have to add db_owner. When I did, I ran the PS_Config again the logs looked different and fixed the error. The database did not need to be upgraded, and it was skipped:

User's image

Is this is known issue? I just got this on a brand new install. I even removed the service and added it back in with the same results.

Adding the dbo permissions to the SharePoint Farm Service account resolves the problem - but I see very little on the web on this issue.

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,298 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Zehui Yao_MSFT 5,846 Reputation points
    2023-07-25T05:34:05.7533333+00:00

    Hi Steven Hahn, it is a pleasure to be able to help you : )

    According to our research, this is a common issue encountered when installing and configuring SharePoint Server.

    After the SharePoint completes successfully. However, the SPSearch database is not updated. "Database is too old and needs to be upgraded."

    You can run the command below in SharePoint management Shell to check the database upgrade status:

    Psconfig -cmd upgrade -inplace b2b -wait -force
    

    For more information, you can refer to the documentation: Database is too old upgrade is required | Microsoft Learn

    And for the error message:

    An exception of type Microsoft.SharePoint.PostSetupConfiguration.PostSetupConfigurationTaskException was thrown. Additional exception information: The upgrade command is invalid or a failure has been encountered.  CanUpgrade [StateDatabase Name=SP_State_Service] failed. (EventID:an58c) Exception: The SELECT permission was denied on the object 'Versions', database 'SP_State_Service', schema 'dbo'. The SELECT permission was denied on the object 'Versions', database 'SP_State_Service', schema 'dbo'. The UPDATE permission was denied on the object 'Versions', database 'SP_State_Service', schema 'dbo'. (EventID:an58c) Cannot upgrade [StateDatabase Name=SP_State_Service]. (EventID:an59g)

    This issue may be caused by installing newfeature by running the PS_Config needs owner permission. So after adding db_owner, the error fixed.

    Hope this helps.

    Best Regards.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Steven Hahn 35 Reputation points
    2023-07-27T17:31:17.2+00:00

    Thanks for the response.

    • The problem is specifically with the State Service
    • The State Service is always installed via PowerShell

    You should be able to run the following commands and be done:

    $db = New-SPStateServiceDatabase -Name 'SP_State_Service'
    $sa = New-SPStateServiceApplication -Name 'State Service' -Database $db
    New-SPStateServiceApplicationProxy -Name 'State Service Proxy' -ServiceApplication $sa -DefaultProxyGroup
    

    Problem Description

    Once you do the above:

    • You get the error message in "Database is too old and upgrade is required".
    • If you run PS_Config to upgrade, you get:

    The SELECT permission was denied on the object 'Versions', database 'SP_State_Service', schema 'dbo'.The SELECT permission was denied on the object 'Versions', database 'SP_State_Service', schema 'dbo'.

    It appears to be easily reproducible.

    Troubleshooting

    Looking at the ULS logs, you can see it a permission problem. The Farm Service account is the one trying to do the upgrade.

    Workaround

    After installing the State Service, change the permissions for the database by giving the Farm Service account full dbo rights to the database.

    This seems to be more rights given than the other databases.

    The workaround works - but it gives more rights to the account than to other databases. I do not see a problem leaving it this way - but maybe I'm missing something and should be more worried.

    0 comments No comments