Network Management

Configuration Wizard error: Error while executing script - The argument 2 of the "JSON_MODIFY" must be a string literal. after upgrading to SolarWinds Platform 2024.2.1 and below

This article will explain how to resolve the error when you encounter the error "Error while executing script - The argument 2 of the "JSON_MODIFY" must be a string literal." in the Configuration Wizard after you upgrade from SolarWinds Platform 2024.2.1 and below

First published date

3/30/2024 1:40 AM

Last published date

2/19/2025 10:03 PM

Overview

This is what the error looks like:
CW error.png

Before proceeding with the workaround in this article, open C:\ProgramData\Solarwinds\Logs\Orion\ConfigurationWizard.log and look for an error that contains similar verbiage to the following error message:

2024-03-28 14:20:28,306 [10] ERROR DBConfigProcessor - Error while executing script - The argument 2 of the "JSON_MODIFY" must be a string literal..
 Error details: System.Data.SqlClient.SqlException (0x80131904): The argument 2 of the "JSON_MODIFY" must be a string literal.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteScalar()
   at SolarWinds.ConfigurationWizard.Plugin.Common.DBConfigProcessor.ExecuteSqlBatch(IDbConnection connection, String sqlQuery, ConfigurationLogDelegate configLog)
ClientConnectionId:50fee653-04f9-4153-b85c-32d30591c477
Error Number:13610,State:2,Class:16
 Failing Sql command:

----
-- Migrate\51_Update_HA_FacilitiesInstances.sql
----
IF (dbo.GetCoreDbVersion() < 20220200)
BEGIN
-- RabbitMQ cluster HA facility timeouts during check when system under load and causes unnecessary HA failover
-- https://jira.solarwinds.com/browse/CORE-18429
    DECLARE @configVersion AS INT = 1;
    SELECT @configVersion = MAX (JSON_VALUE([Config], '$.ConfigRevision'))
    FROM [dbo].[HA_FacilitiesInstances]
    WHERE RefID LIKE 'Orion.HA.RabbitMqClusterFacility.PoolMember.%';
    UPDATE [dbo].[HA_FacilitiesInstances]
    SET [Config] = JSON_MODIFY
    ([Config], '$._monitorTimeout', '00:05:00')
    WHERE RefID LIKE 'Orion.HA.RabbitMqClusterFacility.PoolMember.%';
    UPDATE [dbo].[HA_FacilitiesInstances]
    SET [Config] = JSON_MODIFY
    ([Config], '$.ConfigRevision', @configVersion + 1)
    WHERE RefID LIKE 'Orion.HA.RabbitMqClusterFacility.PoolMember.%';
END

2024-03-28 14:20:28,314 [10] ERROR TaskAdapter - Error running task Orion.ConfigureDatabase SolarWinds Platform Database
SolarWinds.ConfigurationWizard.Common.ConfigurationException: Error while executing script- The argument 2 of the "JSON_MODIFY" must be a string literal.
   at SolarWinds.ConfigurationWizard.Plugin.Common.DBConfigProcessor.ExecuteSqlBatch(IDbConnection connection, String sqlQuery, ConfigurationLogDelegate configLog)
   at SolarWinds.ConfigurationWizard.Plugin.Common.DBConfigProcessor.Process(IDbConnection connection, ConfigurationProgressDelegate progress, String scriptFile, ConfigurationLogDelegate logger)
   at SolarWinds.ConfigurationWizard.Plugin.Orion.ConfigureDatabase.RunSync(IConfigurationWizardTaskProgressReporter progressReporter, CancellationToken cancellationToken)
   at SolarWinds.ConfigurationWizard.Common.TaskEngine.ConfigurationWizardTaskBaseSynchronous.RunAsync(IConfigurationWizardTaskProgressReporter progressReporter, CancellationToken cancellationToken)
   at SolarWinds.ConfigurationWizard.Host.TaskEngine.TaskAdapter.<RunAsync>d__47.MoveNext()
2024-03-28 14:20:28,316 [10] TRACE TaskAdapter - [Orion.ConfigureDatabase | SolarWinds Platform Database] Waiting for lock to set Failed state.
2024-03-28 14:20:28,318 [10] TRACE TaskAdapter - [Orion.ConfigureDatabase | SolarWinds Platform Database] Locked to set Failed state.
2024-03-28 14:20:28,319 [10] DEBUG TaskAdapter - Orion.ConfigureDatabase [100.0%]:
2024-03-28 14:20:28,321 [10] INFO  TaskAdapter - Finished task Orion.ConfigureDatabase SolarWinds Platform Database [00:03:19.9708034].
2024-03-28 14:20:28,322 [10] ERROR ExecutionEngine - Task Orion.ConfigureDatabase failed. Configuration Wizard has been canceled. Aborting...

Product section

Network Performance Monitor

Cause

  • Database can be set with forced parameterization which may cause that problem.
  • The script is trying to pass variables in an unsupported manner, so the SQL script fail.

Resolution

To resolve this problem, please upgrade to SolarWinds Platform 2024.4 and above.  If an upgrade is not possible, please perform the steps below to workaround the issue.

Important: SolarWinds recommends creating a back up of your Orion database. See Back up the SolarWinds Orion database using SQL Server Management Studio for details.

Note: You cannot run the ALTER TABLE query in the SolarWinds Database manager as the SET parameterization is not recognized there. Please run it in the SQL Management Studio. Ask for assistance with their DBA to run the below queries.

First, check if the database is set to forced parameterization, which may cause that problem. To do that, check whether it is turned on. There would be 1 as a result of the below query in SSMS, whereas the checkbox was checked in the Database Manager.

Run a query to check the is_parameterization_forced is enabled.

-- 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.
 
SELECT name, is_parameterization_forced FROM sys.databases
WHERE name = 'DATABASE_NAME'


Run the ALTER TABLE query to the SSMS as we encounter an error in the Database manager.
If it is turned on, turn it off using the below query and when running the configuration wizard again, the error should be gone now.

-- 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.
 
ALTER DATABASE DATABASE_NAME SET PARAMETERIZATION SIMPLE


Run the Configuration Wizard, and click next until it is finished.