Network Management

Custom SQL reports fail after the upgrade to 2023.2 (Error executing SQL: not able to access the database 'SolarWindsOrionLog', 'FlowStorage', or a custom database)

In SolarWinds Platform 2023.2, SQL reports were adjusted to use a dedicated user (ReportingClient) and dedicated role (Reporting). The new user is not permitted to change data in the database, read sensitive data, or access other databases on the server, such as Flow Storage, Log Analyzer Database, or any other database. As a result, if your reports required querying a table in the Flow Storage, Log Analyzer Database, or any other custom database, the reports might stop working. See Resolution for a workaround. Note: This workaround does not work for System Databases, such as master, model, or msdb.

First published date

6/26/2023 11:01 AM

Last published date

2/21/2025 7:35 PM

Overview

In SolarWinds Platform 2023.2, SQL reports started using a new dedicated user with lower privileges. If your SQL reports require accessing the Flow Storage, Log Analyzer Database, or any other custom database, see Resolution to find out how to address these issues.

Note: This workaround does not work for System Databases, such as master, model, or msdb. 


In the report, you will see a similar error:

Report resource failed to properly initialize. 

Error setting up report cell during rendering 'Custom Table.'
Error executing SQL: The server principal "xxxxx" is not able to access the database 'SolarWindsOrionLog' under the current security context.'. <br>Query: <br>select * from SolarWindsxxxx
 

If your report requires accessing the SolarWindsOrion database, see Custom SQL reports fail after the upgrade to 2023.2 (Error executing SQL: database 'SolarWindsOrion').
 

Product section

Orion Platform

Cause

Starting with 2023.2, the default report privileges might not be enough for SQL queries that require accessing the Flow Storage, the Log Analyzer Database, or a custom database.

Resolution

This workaround requires that you enable the Trustworthy setting for the SolarWinds Platform database.
SolarWinds recommends that you do not enable the Trustworthy setting because it extends the capabilities of users.
For details, see TRUSTWORTHY database property of the SQL Server (© 2023 Microsoft, available at https://learn.microsoft.com/en-us/sql/relational-databases/security/trustworthy-database-property?view=sql-server-ver16, obtained on June 19, 2023.)

Notes:

  • The following steps require elevated user rights (server-level administrator). The code expects that the SolarWinds Platform database name is the default SolarWindsOrion.
  • This workaround does not work for System Databases, such as master, model, or msdb. 
To enable querying data from a custom database, such as the Flow Storage, Log Analyzer Database, or any other custom database, complete these steps:
  1. Find the SID value assigned to the "ReportingClient" user of the SolarWinds Platform database.

    select name, sid from SolarwindsOrion.sys.database_principals 
    where name = 'ReportingClient'
  2. Create a matching ReportingClient user with the same SID on the custom database.

    USE <MyCustomDatabaseName>; 
    GO 
    IF DATABASE_PRINCIPAL_ID('ReportingClient') IS NULL CREATE USER ReportingClient WITHOUT LOGIN WITH SID = <SID_value_from_the_previous_query>; 
    EXEC sp_addrolemember @membername= 'ReportingClient', @rolename = 'db_datareader'

    where:

    • <MyCustomDatabaseName> - custom DB name
    • <SID_value_from_the_previous_query> - SID value from step 1
  3. Set the SolarWinds Platform Database as trustworthy:

    ALTER DATABASE SolarWindsOrion SET TRUSTWORTHY ON;