Home
About
Search
Welcome to M-Files Empower – our new support experience. We'd love to hear what you think!Give feedback
Home/Support and troubleshooting/Troubleshooting/Error resolution

Nightly maintenance in M-Files has "VIEW SERVER STATE permission" error

Last updated on 28 June 2021

Admin
M-Files Admin

Overview

After nightly maintenance has been run, the following error about missing "VIEW SERVER STATE" permissions is shown in Windows Event logs:

NightlyMaintenance.cpp, xxx, The user does not have permission to perform this action. (ERROR: 297, SQLSTATE: 42000) (0x80040E14)
NightlyMaintenance.cpp, xxx, The user does not have permission to perform this action. (ERROR: 297, SQLSTATE: 42000) (0x80040E14)
MCommand.h, xxx, The user does not have permission to perform this action. (ERROR: 297, SQLSTATE: 42000) (0x80040E14)
MCommand.h, xxx, The user does not have permission to perform this action. (ERROR: 297, SQLSTATE: 42000) (0x80040E14)
MCommand.h, xxx, The user does not have permission to perform this action. (ERROR: 297, SQLSTATE: 42000) (0x80040E14)
MCommand.h, xxx, VIEW SERVER STATE permission was denied on object 'server', database 'master'. (ERROR: 300, SQLSTATE: 42000) (0x89790002)

Solution

As part of the nightly maintenance, the M-Files will detect SQL queries that has lasted for long time. To run this maintenance task the login used for Administrator credentials requires "View server state" permissions, otherwise this error will be shown. This can be avoided with one of the following approaches:
  1. Grant the login the needed permissions:
 
GRANT VIEW SERVER STATE TO [USER]
 
  1. Disable this maintenance step, by adding the following configuration through M-Files Admin tool:
Advanced Vault Settings -> Configuration -> Database -> Nightly Maintenance:
                {
                   "nightlyMaintenanceSQLQueryRuntimeLimitHours": 0
                 }
  1. Starting from M-Files May '21 update this maintenance step will be automatically skipped if the necessary rights are missing and no additional configurations are needed.

Still need help?

On this page