Network Management
Configuration Wizard failed with Subquery returned more than 1 value
The Configuration Wizard has failed: Exception while configuring plugin Orion Core Services component Orion Database. Subquery returned more than 1 value or Error while executing script- Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
First published date
Last published date
Overview
Updating packaging system for database FAILED
Database configuration failed:
• Exception while configuring plugin Orion Core Services component Orion Database. Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
Services configuration failed:
• Error while configuring component Orion.RunDatabasePackaging
OR
- Error while executing script- Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
Product section
Cause
The error occurs because it is expecting only one value and is returning 2 or more instead.
Resolution
NOTE: Please be aware of the following for all scripts below:
-- Scripts are not supported under any SolarWinds support program or service.
-- Scripts are provided AS IS without warranty of any kind. SolarWinds further
-- disclaims all warranties including, without limitation, any implied warranties
-- of merchantability or of fitness for a particular purpose. The risk arising
-- out of the use or performance of the scripts and documentation stays with you.
-- In no event shall SolarWinds or anyone else involved in the creation,
-- production, or delivery of the scripts be liable for any damages whatsoever
-- (including, without limitation, damages for loss of business profits, business
-- interruption, loss of business information, or other pecuniary loss) arising
-- out of the use of or inability to use the scripts or documentation.
Resolution 1
- Check the ConfigurationWizard.log, which can be found in the C:\ProgramData\SolarWinds\Logs\Orion folder
- Before the error message, there will most likely be a list of SQL statements that look something like the screenshot below.
- You will need to open SQL Server Management Studio (SSMS) connecting to the SQL server where the Orion database is located, and access it with credentials that are able to make changes to the database.
- Once in SSMS, you will need to run each of the SQL statements found in the Configuration Wizard, before the specific error, until you see the same error as a result of the query being submitted.
- Once you have identified the SQL statement that provides the same error, run the Select statement where it references the ID is to find the duplicate values.
- Then delete the second ID. For example, if the statement above caused the error and the duplicate entry had the ID as 8188 then the delete command would go something like this:
DELETE FROM [dbo].[APM_ComponentTemplate] WHERE ID = '8188"
- Then re-run the Configuration Wizard.
Resolution 2
Or you might have a query like the example below:
IF (dbo.GetInterfacesPackageDbVersion() < 9) BEGIN DECLARE @viewGroupId NVARCHAR(255) SET @viewGroupId = (SELECT ViewGroup FROM Views WHERE ViewKey = 'Interface Details') UPDATE Views SET ViewGroup = 15234, ViewGroupName = 'Interface Details' WHERE ViewType = 'InterfaceDetails' AND ViewGroup = @viewGroupId UPDATE Views SET ViewTitle = N'Summary', ViewGroup = 15234, ViewIcon = 'Overview.png', ViewGroupPosition = 1, ViewGroupName = 'Interface Details' WHERE ViewKey = 'Interface Details' END
Upon verifying, the subquery SELECT ViewGroup FROM Views WHERE ViewKey = 'Interface Details' returned two results
SELECT * FROM Views WHERE ViewKey = 'Interface Details' update views set ViewKey = 'Interface_Details' where viewid = 14
Kindly see the sample screenshot below of the results.
- Renamed one of the ViewKey from 'Interface Details' to 'Interface_Details' for the ViewID that does not show ViewGroupID: 15234. From the screenshot above, it would be ViewID: 228 and View ID: 237.
- So that the subquery returned only one value
- Re-run the Configuration Wizard
Resolution 3:
Check the below tables and remove the remnant of the old server.
- Engines
- OrionServers
- Websites
Refer to the Migration script on Task 2 - Step No. 8 in the article, Migrate SolarWinds Orion products to a new server with a new IP or hostname.
Resolution 4:
For customer who had an SRM module with expired / Eval license and upgading from 2020.2.5 to 2022.4.1, you may also run into similar error during Config wizard
Failing SQL Query is
DECLARE @menuItemId int IF EXISTS(SELECT 1 FROM dbo.MenuItems WHERE Link LIKE '/Orion/SRM/ProfilerIframe.aspx%') BEGIN SET @menuItemId = (SELECT MenuItemID FROM dbo.MenuItems WHERE Title = 'Storage Main Console') DELETE FROM dbo.MenuItems WHERE MenuItemID = @menuItemId DELETE FROM dbo.MenuBars WHERE MenuItemID = @menuItemId SET @menuItemId = (SELECT MenuItemID FROM dbo.MenuItems WHERE Title = 'Storage Events') DELETE FROM dbo.MenuItems WHERE MenuItemID = @menuItemId DELETE FROM dbo.MenuBars WHERE MenuItemID = @menuItemId END IF [dbo].[GetCoreDbVersion]() <= 20220300 BEGIN UPDATE MenuItems SET GUID = 'd8faa12d-39cb-4026-a43a-27d236ba140c', FEATURE = 'SRM' WHERE Link LIKE '/Orion/SRM/Summary.aspx' UPDATE MenuItems SET GUID = 'fd8bc90f-103a-489c-8d3c-3a0027d976de', FEATURE = 'SRM' WHERE Link LIKE '/Orion/SRM/PerformanceDashboardView.aspx' UPDATE MenuItems SET GUID = '8815668a-9254-4d08-9c83-6053577fec7c', FEATURE = 'SRM' WHERE Link LIKE '/Orion/SRM/CapacityDashboardView.aspx' END
To overcome this
DELETE FROM dbo.MenuItems WHERE Link LIKE '/Orion/SRM/ProfilerIframe.aspx%'
Re-run configuration wizard.
Alternatively you may upgrade to 2023.2 as this bug fix is included in that release.