Problem description
SQL T-Log backup fails with exit code Phoenix 318.
Cause
This issue can occur if the account under which Phoenix Agent client service is running does not have sysadmin permissions over the database.This issue can occur if the account under which Phoenix Agent client service is running does not have sysadmin permissions over the database.
Traceback
Follow the instructions in the Logs article and obtain the job logs.
Extract the logs and go through the
Phoenix<YYYYMMDD>_<timestamp>.log
file to determine if the following traceback is present in the logs.[2020-03-04 15:39:51,621] [ERROR] <_MainThread(MainThread)> SqlStream::open_vdi_handle() vdilib error occured: ('08004', u'[08004] [Microsoft][ODBC SQL Server Driver][SQL Server]The server principal "NT AUTHORITY\\SYSTEM" is not able to access the database "ngfddata" under the current security context. (916) (SQLExecDirectW)')
[2020-03-04 15:39:51,621] [ERROR] <_MainThread(MainThread)> Error <class 'pyodbc.OperationalError'>:('08004', u'[08004] [Microsoft][ODBC SQL Server Driver][SQL Server]The server principal "NT AUTHORITY\\SYSTEM" is not able to access the database "DBNAME" under the current security context. (916) (SQLExecDirectW)'). Traceback -Traceback (most recent call last):
File "agents\sqlserver\VssHelper.pyc", line 52, in open_vdi_handle
File "agents\sqlserver\VdiHelper.pyc", line 99, in open
File "agents\sqlserver\sql_vss_2.pyc", line 288, in get_database_type
File "agents\sqlserver\sql_vss_2.pyc", line 333, in __execute_sql_query_list
OperationalError: ('08004', u'[08004] [Microsoft][ODBC SQL Server Driver][SQL Server]The server principal "NT AUTHORITY\\SYSTEM" is not able to access the database "DBNAME" under the current security context. (916) (SQLExecDirectW)')
Resolution
Grant the sysadmin permission to the account under which Phoenix Agent Client service is running.
How to grant the sysadmin permission
Login to the SQL Server Management Studio and connect to the SQL database.
In the SQL Server Management Studio, in the Object Explorer, navigate to Security > Server Roles > sysadmin
Right click sysadmin and select Properties.
In the Server Role Properties - sysadmin dialog box, determine if the credential which is added in the Phoenix credential store and assigned to the virtual machine is listed under the Members of this role section. If it is not listed, proceed to step 5.
In the SQL Server Management Studio, in the Object Explorer, navigate to Security > Logins. Locate the credential which is assigned to the virtual machine from the Phoenix credential store. Right-click this credential, and select Properties.
In the Login Properties dialog box, in the left pane, click Server Roles.
In the right pane, select sysadmin and click OK.