VIEW SERVER STATE permission was denied error in the Confluence Logs

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

The following error starts to appear in the Confluence logs after fresh installing Confluence 8.1.0 with SQL Server or updating the CCMA app to the latest version: 

atlassian-confluence.log
ERROR [Caesium-1-4] [agent.newexport.store.JdbcConfluenceStore] fetchInteger Query failed at: Query(sql=SELECT CPU_COUNT FROM sys.dm_os_sys_info, tableName=null, exportName=null, userkeyColums=[], preserveIdentifierCase=false)
org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [SELECT CPU_COUNT FROM sys.dm_os_sys_info]; SQL state [S0001]; error code [300]; VIEW SERVER STATE permission was denied on object 'server', database 'master'.; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: VIEW SERVER STATE permission was denied on object 'server', database 'master'.

Environment

  • Confluence 6.15.1 and above.
  • SQL Server versions 2016,2017, and 2019.
  • CCMA 3.4.1 and above.

Diagnosis

After updating the CCMA app to the latest version the error message will happen 

Cause

This error message is caused by some changes to the CCMA plugin from version 3.4.1 onwards. 

After version 3.4.0 the CCMA plugin will no longer run the scheduled CPU query and it will be based on system properties.

Solution

In order to solve this issue the user will need to set grant the necessary permissions to fix the error message above following the steps below: 

  1. Stop Confluence
  2. Login to your database using your system administrator account.
  3. Execute the following queries (replace the [db_username] with your database user):

    USE MASTER
    GO
    GRANT VIEW SERVER STATE TO [db_username]
  4. Start Confluence.




Last modified on Mar 23, 2023

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.