It Appears once, On page refresh everything works fine - This operation can be performed only on a computer that is joined to a server farm - SharePoint 2019

Siraj Ahmad 1 Reputation point
2022-12-28T15:31:34.847+00:00

I have custom Farm Solution(Dotnet). when I recycle the application pool, user get below error only for the first time.
On page refresh everything works fine(for every one).

Everything else in sharePoint is working fine on AppPool Recycle, CA/other applications which does not have a farm solution.
Only getting this error on my farm solution base Web application.

"This operation can be performed only on a computer that is joined to a server farm by users who have permissions in SQL Server to read from the configuration database. To connect this server to the server farm, use the SharePoint Products Configuration Wizard, located on the Start menu in Microsoft SharePoint 2019 Products.
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.InvalidOperationException: This operation can be performed only on a computer that is joined to a server farm by users who have permissions in SQL Server to read from the configuration database. To connect this server to the server farm, use the SharePoint Products Configuration Wizard, located on the Start menu in Microsoft SharePoint 2019 Products.

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:
[InvalidOperationException: This operation can be performed only on a computer that is joined to a server farm by users who have permissions in SQL Server to read from the configuration database. To connect this server to the server farm, use the SharePoint Products Configuration Wizard, located on the Start menu in Microsoft SharePoint 2019 Products.]
Microsoft.SharePoint.Utilities.SPUtility.AlternateServerUrlFromHttpRequestUrl(Uri url) +223
Microsoft.SharePoint.Administration.SPAlternateUrl.GetContextUri(HttpContext ctx) +440
Microsoft.SharePoint.Publishing.Design.DesignHttpModule.PostAuthorizeRequestHandler(Object sender, EventArgs e) +146
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +209
System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +213
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +91

274538-farmerror2.jpg

Please Help ..!!!!!!!

Microsoft 365 and Office | SharePoint Server | For business
Microsoft 365 and Office | SharePoint | Development
Microsoft 365 and Office | SharePoint Server | Development
Windows for business | Windows Server | Devices and deployment | Configure application groups
{count} votes

2 answers

Sort by: Most helpful
  1. Yi Lu_MSFT 17,616 Reputation points
    2022-12-29T07:01:02.007+00:00

    Hi @Siraj Ahmad
    In short, you could check that 1. from the SharePoint front end and application servers that you can ping your SQL server. 2 make sure that your Farm account has permission to the configuration database. 3. verify that your database didn't for some reason go into recovery mode. once everything is fine and you are still having issues, restart the SQL host service on the SQL server. Once the service is restarted you will need to reboot Central Admin and then your WFE and App servers.

    This issue “This operation can be performed only on a computer that is joined to a server farm” usually occurs in case of the SharePoint Server can’t connect to the SQL Server for the following reasons:

    1.The Database Server is down.
    Make sure that the Database Server is up and running.

    2.The SQL Server Services are stopped.
    Make sure the SQL Server services are started and running.

    3.The Database server is not reachable from the Application server (Firewall Issue / SQL Server Port is closed).
    Make sure that the SQL Server Port is opened (the default port: 1433) by performing a telnet the DB server IP with the SQL Server port (the default: 1433).

    4.The SQL Server license has expired.
    If you are working on a DVE/Test environment, the license expiration may be not monitored from the infrastructure team! therefore, if the SQL server license is expired it will lead to stopping the SQL services and will not working as expected!

    5.The SQL Server Service account credentials were changed.
    If the SQL server services accounts are not treated as service account,

    (a)The password for those accounts will be expired.  
    (b)The account will be locked.  
    

    6.The App Pool account for web application is locked or disabled.
    Open IIS. Check Identity for the web application App Pool. Ask your system administrator to make sure that this account is not locked or disabled in Active Directory.

    7.SharePoint Farm Account Machine Permission
    Ask your system administrator to make sure that
    (a)The farm account
    Not Locked or disabled.
    The password is never expired.
    (b)The farm account have the below security policy rights:
    Allow Logon locally.
    Logon as Service.

    8.SharePoint Farm Account SQL Server Permissions
    Make sure that the farm account has the below Server roles permissions on the SQL Server instance:

     (a)Dbcreator.  
     (b)Security Admin.  
     (c)DbOwner on the content database.  
     (d)No changes on the default permissions on SharePoint config database.  
    

    9.Check SharePoint Config Database Status
    Make sure that the SharePoint Configuration database is

     (a)Not in recovery mode  
     (b)its status is online.  
    

    10.Check SharePoint Servers within the farm
    Make sure that all SharePoint servers within the farm are joined properly and working healthy!

    In conclusion, we have explored the root causes of this SharePoint issue “This operation can be performed only on a computer that is joined to a server farm by users who have permissions in SQL Server to read from the configuration database“. So If the above solution don’t helped you to solve this issue, so you should try to run the configuration wizard again on all SharePoint servers cross the farm, to can specifically identify if there are other configuration issues on your farm.

    For more details, you could refer to:
    https://spgeeks.devoworx.com/this-operation-can-be-performed-only-on-a-computer-that-is-joined-to-a-server-farm-by-users-who-have-permissions-in-sql-server-to-read-from-the-configuration-database/

    Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.


    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. Siraj Ahmad 1 Reputation point
    2023-01-24T06:49:39.4866667+00:00

    @Yi Lu_MSFT

    I am still facing the same issue, I have found some errors in SP Logs:

    Flushing connection pool 'Data Source=Domain\Servernam;Initial Catalog=SharePoint_Config;Integrated.........................

    Refreshed SPPersistedObject with Name SharePoint_Config...............

    Entering InvalidateSiteLookupCache: initializeOnly=True

    An exception occured while trying to acquire the local farm: System.InvalidOperationException: This operation uses the SharePoint Administration service (spadminV4), which could not be contacted. If the service is stopped or disabled, start it and try the operation again. at Microsoft.SharePoint.Administration.SPServer.CreateDirectory(String path, SPAclGroupAccessLevel userGroupAccessLevel) at Microsoft.SharePoint.Administration.SPSiteFileSystemCache.InvalidateCache(Boolean initializeOnly) at Microsoft.SharePoint.Administration.SPConfigurationDatabase.InvalidateSiteLookupCache(Boolean initializeOnly) at Microsoft.SharePoint.Administration.SPConfigurationDatabase.Initialize(SqlConnectionStringBuilder connectionString, Boolean enableCaching, Boolean checkCompatibility, Boolean bindRequestGuid) at Microsoft.SharePoint.Administration.SPConfigurationDatabase.Initialize(SqlConnectionStringBuilder connectionString, Boolean enableCaching, Boolean checkCompatibility) at Microsoft.SharePoint.Administration.SPConfigurationDatabase.get_Local() at Microsoft.SharePoint.Administration.SPFarm.FindLocal(SPFarm& farm, Boolean& isJoined)


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.