Skip to content

SqlDatabase: Error: JSON: expected value at line 1 column 1 #2403

@ognif

Description

@ognif

Problem description

SqlServerDsc/SqlDatabase return a nothing to say error: expected value at line 1 column 1
I tried with different properties, with and without "Credentials".
After revert to SqlServerDsc-17.3.0 it works without any issue.

Verbose logs

{"timestamp":"2026-01-09T12:46:18.950095Z","level":"TRACE","fields":{"message":"Current working directory: C:\\\\Program Files\\\\DSC"},"target":"dsc_lib::dscresources::command_resource","line_number":772}
{"timestamp":"2026-01-09T12:46:18.958694Z","level":"TRACE","fields":{"message":"Writing to command STDIN: {\"resources\":[{\"name\":\"SqlServerDsc/SqlDatabase\",\"type\":\"SqlServerDsc/SqlDatabase\",\"properties\":{\"ServerName\":\"V-MSSQL176.xxx\",\"InstanceName\":\"MSSQLSERVER\",\"Name\":\"model\",\"RecoveryModel\":\"Simple\",\"Ensure\":\"Present\",\"Credential\":{\"userName\":\"xxx\",\"password\":\"xxx\"}}}],\"metadata\":{\"Microsoft.DSC\":{\"context\":\"configuration\"}}}"},"target":"dsc_lib::dscresources::command_resource","line_number":666}
{"timestamp":"2026-01-09T12:46:19.483147Z","level":"DEBUG","fields":{"message":"PID 7336: PSVersion=7.5.3"},"target":"dsc_lib::dscresources::command_resource","line_number":986}
{"timestamp":"2026-01-09T12:46:19.483924Z","level":"DEBUG","fields":{"message":"PID 7336: PSPath=C:\\Program Files\\PowerShell\\7"},"target":"dsc_lib::dscresources::command_resource","line_number":986}
{"timestamp":"2026-01-09T12:46:19.484624Z","level":"DEBUG","fields":{"message":"PID 7336: PSModulePath=C:\\Users\\S954622\\Documents\\PowerShell\\Modules;C:\\Program Files\\PowerShell\\Modules;c:\\program files\\powershell\\7\\Modules;C:\\Program Files\\WindowsPowerShell\\Modules;C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\Modules;C:\\Program Files (x86)\\Microsoft SQL Server\\160\\Tools\\PowerShell\\Modules\\"},"target":"dsc_lib::dscresources::command_resource","line_number":986}
{"timestamp":"2026-01-09T12:46:19.575990Z","level":"DEBUG","fields":{"message":"Process 'pwsh' id 7336 exited with code 0"},"target":"dsc_lib::dscresources::command_resource","line_number":710}
{"timestamp":"2026-01-09T12:46:19.577057Z","level":"DEBUG","fields":{"message":"Parsing input as stdin"},"target":"dsc_lib::dscresources::command_resource","line_number":842}
{"timestamp":"2026-01-09T12:46:19.577105Z","level":"INFO","fields":{"message":"Getting current state for set by invoking get on 'Microsoft.DSC/PowerShell' using 'pwsh'"},"target":"dsc_lib::dscresources::command_resource","line_number":150}
{"timestamp":"2026-01-09T12:46:19.578180Z","level":"TRACE","fields":{"message":"Invoking command 'pwsh' with args Some([\"-NoLogo\", \"-NonInteractive\", \"-NoProfile\", \"-ExecutionPolicy\", \"Bypass\", \"-Command\", \"$Input | ./psDscAdapter/powershell.resource.ps1 Get\"])"},"target":"dsc_lib::dscresources::command_resource","line_number":770}
{"timestamp":"2026-01-09T12:46:19.578302Z","level":"TRACE","fields":{"message":"Current working directory: C:\\\\Program Files\\\\DSC"},"target":"dsc_lib::dscresources::command_resource","line_number":772}
{"timestamp":"2026-01-09T12:46:19.587060Z","level":"TRACE","fields":{"message":"Writing to command STDIN: {\"resources\":[{\"name\":\"SqlServerDsc/SqlDatabase\",\"type\":\"SqlServerDsc/SqlDatabase\",\"properties\":{\"ServerName\":\"V-MSSQL176.xxx\",\"InstanceName\":\"MSSQLSERVER\",\"Name\":\"model\",\"RecoveryModel\":\"Simple\",\"Ensure\":\"Present\",\"Credential\":{\"userName\":\"xxx\",\"password\":\"xxx\"}}}],\"metadata\":{\"Microsoft.DSC\":{\"context\":\"configuration\"}}}"},"target":"dsc_lib::dscresources::command_resource","line_number":666}
{"timestamp":"2026-01-09T12:46:20.102526Z","level":"DEBUG","fields":{"message":"PID 224: PSVersion=7.5.3"},"target":"dsc_lib::dscresources::command_resource","line_number":986}
{"timestamp":"2026-01-09T12:46:20.103210Z","level":"DEBUG","fields":{"message":"PID 224: PSPath=C:\\Program Files\\PowerShell\\7"},"target":"dsc_lib::dscresources::command_resource","line_number":986}
{"timestamp":"2026-01-09T12:46:20.103873Z","level":"DEBUG","fields":{"message":"PID 224: PSModulePath=C:\\Users\\S954622\\Documents\\PowerShell\\Modules;C:\\Program Files\\PowerShell\\Modules;c:\\program files\\powershell\\7\\Modules;C:\\Program Files\\WindowsPowerShell\\Modules;C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\Modules;C:\\Program Files (x86)\\Microsoft SQL Server\\160\\Tools\\PowerShell\\Modules\\"},"target":"dsc_lib::dscresources::command_resource","line_number":986}
{"timestamp":"2026-01-09T12:46:20.106442Z","level":"DEBUG","fields":{"message":"PID 224: jsonInput={\"resources\":[{\"name\":\"SqlServerDsc/SqlDatabase\",\"type\":\"SqlServerDsc/SqlDatabase\",\"properties\":{\"ServerName\":\"V-MSSQL176.xxx\",\"InstanceName\":\"MSSQLSERVER\",\"Name\":\"model\",\"RecoveryModel\":\"Simple\",\"Ensure\":\"Present\",\"Credential\":{\"userName\":\"xxx\",\"password\":\"xxx\"}}}],\"metadata\":{\"Microsoft.DSC\":{\"context\":\"configuration\"}}}"},"target":"dsc_lib::dscresources::command_resource","line_number":986}
{"timestamp":"2026-01-09T12:46:20.251091Z","level":"DEBUG","fields":{"message":"PID 224: Reading from Get-DscResource cache file C:\\Users\\S954622\\AppData\\Local\\dsc\\PSAdapterCache.json"},"target":"dsc_lib::dscresources::command_resource","line_number":986}
{"timestamp":"2026-01-09T12:46:20.265883Z","level":"DEBUG","fields":{"message":"PID 224: Checking cache for stale entries"},"target":"dsc_lib::dscresources::command_resource","line_number":986}
{"timestamp":"2026-01-09T12:46:21.496029Z","level":"DEBUG","fields":{"message":"PID 224: Checking cache for stale PSModulePath"},"target":"dsc_lib::dscresources::command_resource","line_number":986}
{"timestamp":"2026-01-09T12:46:21.587766Z","level":"DEBUG","fields":{"message":"PID 224: PSModulePath diff ''"},"target":"dsc_lib::dscresources::command_resource","line_number":986}
{"timestamp":"2026-01-09T12:46:21.608618Z","level":"DEBUG","fields":{"message":"PID 224: OS version: Microsoft Windows NT 10.0.26100.0"},"target":"dsc_lib::dscresources::command_resource","line_number":986}
{"timestamp":"2026-01-09T12:46:21.608937Z","level":"DEBUG","fields":{"message":"PID 224: PowerShell version: 7.5.3"},"target":"dsc_lib::dscresources::command_resource","line_number":986}
{"timestamp":"2026-01-09T12:46:22.767496Z","level":"TRACE","fields":{"message":"PID 224: [\r\n  \"InstanceName\",\r\n  \"ServerName\",\r\n  \"Credential\",\r\n  \"Protocol\",\r\n  \"Port\",\r\n  \"Reasons\",\r\n  \"Name\",\r\n  \"Ensure\",\r\n  \"Collation\",\r\n  \"CompatibilityLevel\",\r\n  \"RecoveryModel\",\r\n  \"OwnerName\",\r\n  \"SnapshotIsolation\",\r\n  \"CatalogCollation\",\r\n  \"IsLedger\",\r\n  \"AcceleratedRecoveryEnabled\",\r\n  \"AnsiNullDefault\",\r\n  \"AnsiNullsEnabled\",\r\n  \"AnsiPaddingEnabled\",\r\n  \"AnsiWarningsEnabled\",\r\n  \"ArithmeticAbortEnabled\",\r\n  \"AutoClose\",\r\n  \"AutoCreateIncrementalStatisticsEnabled\",\r\n  \"AutoCreateStatisticsEnabled\",\r\n  \"AutoShrink\",\r\n  \"AutoUpdateStatisticsAsync\",\r\n  \"AutoUpdateStatisticsEnabled\",\r\n  \"BrokerEnabled\",\r\n  \"ChangeTrackingAutoCleanUp\",\r\n  \"ChangeTrackingEnabled\",\r\n  \"CloseCursorsOnCommitEnabled\",\r\n  \"ConcatenateNullYieldsNull\",\r\n  \"DatabaseOwnershipChaining\",\r\n  \"DataRetentionEnabled\",\r\n  \"DateCorrelationOptimization\",\r\n  \"EncryptionEnabled\",\r\n  \"HonorBrokerPriority\",\r\n  \"IsFullTextEnabled\",\r\n  \"IsParameterizationForced\",\r\n  \"IsReadCommittedSnapshotOn\",\r\n  \"IsSqlDw\",\r\n  \"IsVarDecimalStorageFormatEnabled\",\r\n  \"LocalCursorsDefault\",\r\n  \"NestedTriggersEnabled\",\r\n  \"NumericRoundAbortEnabled\",\r\n  \"QuotedIdentifiersEnabled\",\r\n  \"ReadOnly\",\r\n  \"RecursiveTriggersEnabled\",\r\n  \"RemoteDataArchiveEnabled\",\r\n  \"RemoteDataArchiveUseFederatedServiceAccount\",\r\n  \"TemporalHistoryRetentionEnabled\",\r\n  \"TransformNoiseWords\",\r\n  \"Trustworthy\",\r\n  \"ChangeTrackingRetentionPeriod\",\r\n  \"DefaultFullTextLanguage\",\r\n  \"DefaultLanguage\",\r\n  \"MaxDop\",\r\n  \"MaxDopForSecondary\",\r\n  \"MirroringRedoQueueMaxSize\",\r\n  \"MirroringTimeout\",\r\n  \"TargetRecoveryTime\",\r\n  \"TwoDigitYearCutoff\",\r\n  \"MaxSizeInBytes\",\r\n  \"FilestreamDirectoryName\",\r\n  \"MirroringPartner\",\r\n  \"MirroringPartnerInstance\",\r\n  \"MirroringWitness\",\r\n  \"PersistentVersionStoreFileGroup\",\r\n  \"PrimaryFilePath\",\r\n  \"RemoteDataArchiveCredential\",\r\n  \"RemoteDataArchiveEndpoint\",\r\n  \"RemoteDataArchiveLinkedServer\",\r\n  \"RemoteDatabaseName\",\r\n  \"ChangeTrackingRetentionPeriodUnits\",\r\n  \"ContainmentType\",\r\n  \"DelayedDurability\",\r\n  \"FilestreamNonTransactedAccess\",\r\n  \"LegacyCardinalityEstimation\",\r\n  \"LegacyCardinalityEstimationForSecondary\",\r\n  \"MirroringSafetyLevel\",\r\n  \"PageVerify\",\r\n  \"ParameterSniffing\",\r\n  \"ParameterSniffingForSecondary\",\r\n  \"QueryOptimizerHotfixes\",\r\n  \"QueryOptimizerHotfixesForSecondary\",\r\n  \"UserAccess\"\r\n]"},"target":"dsc_lib::dscresources::command_resource","line_number":988}
{"timestamp":"2026-01-09T12:46:27.244983Z","level":"TRACE","fields":{"message":"PID 224: Output: {\"name\":\"SqlServerDsc/SqlDatabase\",\"type\":\"SqlServerDsc/SqlDatabase\",\"properties\":{\"MirroringPartner\":\"\",\"OwnerName\":\"sa\",\"QueryOptimizerHotfixesForSecondary\":\"Primary\",\"MirroringTimeout\":0,\"CloseCursorsOnCommitEnabled\":false,\"ParameterSniffingForSecondary\":\"Primary\",\"RecoveryModel\":\"Simple\",\"AnsiPaddingEnabled\":false,\"ChangeTrackingAutoCleanUp\":false,\"IsSqlDw\":false,\"ReadOnly\":false,\"UserAccess\":\"Multiple\",\"RemoteDatabaseName\":\"\",\"NestedTriggersEnabled\":true,\"IsParameterizationForced\":false,\"DelayedDurability\":\"Disabled\",\"IsFullTextEnabled\":false,\"CompatibilityLevel\":\"Version160\",\"Trustworthy\":false,\"Port\":null,\"DefaultLanguage\":1033,\"AutoUpdateStatisticsAsync\":false,\"DatabaseOwnershipChaining\":false,\"MaxDop\":0,\"AutoClose\":false,\"EncryptionEnabled\":false,\"FilestreamNonTransactedAccess\":\"Off\",\"PrimaryFilePath\":\"S:\\\\MSSQL\\\\Data\\\\MSSQL16.MSSQLSERVER\\\\MSSQL\\\\DATA\",\"ChangeTrackingRetentionPeriodUnits\":\"None\",\"ChangeTrackingEnabled\":false,\"DefaultFullTextLanguage\":1033,\"Name\":\"model\",\"ConcatenateNullYieldsNull\":false,\"MirroringSafetyLevel\":\"None\",\"DataRetentionEnabled\":false,\"ServerName\":\"V-MSSQL176.xxx\",\"TargetRecoveryTime\":60,\"HonorBrokerPriority\":false,\"Reasons\":[],\"IsVarDecimalStorageFormatEnabled\":false,\"MaxDopForSecondary\":0,\"ContainmentType\":\"None\",\"QueryOptimizerHotfixes\":\"Off\",\"FilestreamDirectoryName\":\"\",\"NumericRoundAbortEnabled\":false,\"AnsiNullsEnabled\":false,\"TemporalHistoryRetentionEnabled\":null,\"MirroringPartnerInstance\":\"\",\"SnapshotIsolation\":false,\"PersistentVersionStoreFileGroup\":\"PRIMARY\",\"TwoDigitYearCutoff\":2049,\"Ensure\":\"Present\",\"AnsiNullDefault\":false,\"RemoteDataArchiveUseFederatedServiceAccount\":false,\"Collation\":\"Latin1_General_CI_AS\",\"AnsiWarningsEnabled\":false,\"AutoCreateStatisticsEnabled\":true,\"MirroringRedoQueueMaxSize\":0,\"RemoteDataArchiveEndpoint\":\"\",\"TransformNoiseWords\":false,\"MaxSizeInBytes\":0.0,\"RecursiveTriggersEnabled\":false,\"RemoteDataArchiveCredential\":\"\",\"LegacyCardinalityEstimation\":\"Off\",\"BrokerEnabled\":false,\"AutoShrink\":false,\"RemoteDataArchiveEnabled\":false,\"Protocol\":null,\"AutoCreateIncrementalStatisticsEnabled\":false,\"CatalogCollation\":\"DatabaseDefault\",\"RemoteDataArchiveLinkedServer\":\"\",\"QuotedIdentifiersEnabled\":false,\"AcceleratedRecoveryEnabled\":false,\"LocalCursorsDefault\":false,\"Credential\":{\"UserName\":\"xxx\",\"Password\":{\"Length\":0}},\"AutoUpdateStatisticsEnabled\":true,\"IsLedger\":false,\"DateCorrelationOptimization\":false,\"PageVerify\":\"Checksum\",\"MirroringWitness\":\"\",\"IsReadCommittedSnapshotOn\":false,\"LegacyCardinalityEstimationForSecondary\":\"Primary\",\"ParameterSniffing\":\"On\",\"ArithmeticAbortEnabled\":false,\"InstanceName\":\"MSSQLSERVER\",\"ChangeTrackingRetentionPeriod\":0}}"},"target":"dsc_lib::dscresources::command_resource","line_number":988}
{"timestamp":"2026-01-09T12:46:27.249614Z","level":"DEBUG","fields":{"message":"PID 224: jsonOutput={\"result\":[{\"name\":\"SqlServerDsc/SqlDatabase\",\"type\":\"SqlServerDsc/SqlDatabase\",\"properties\":{\"MirroringPartner\":\"\",\"OwnerName\":\"sa\",\"QueryOptimizerHotfixesForSecondary\":\"Primary\",\"MirroringTimeout\":0,\"CloseCursorsOnCommitEnabled\":false,\"ParameterSniffingForSecondary\":\"Primary\",\"RecoveryModel\":\"Simple\",\"AnsiPaddingEnabled\":false,\"ChangeTrackingAutoCleanUp\":false,\"IsSqlDw\":false,\"ReadOnly\":false,\"UserAccess\":\"Multiple\",\"RemoteDatabaseName\":\"\",\"NestedTriggersEnabled\":true,\"IsParameterizationForced\":false,\"DelayedDurability\":\"Disabled\",\"IsFullTextEnabled\":false,\"CompatibilityLevel\":\"Version160\",\"Trustworthy\":false,\"Port\":null,\"DefaultLanguage\":1033,\"AutoUpdateStatisticsAsync\":false,\"DatabaseOwnershipChaining\":false,\"MaxDop\":0,\"AutoClose\":false,\"EncryptionEnabled\":false,\"FilestreamNonTransactedAccess\":\"Off\",\"PrimaryFilePath\":\"S:\\\\MSSQL\\\\Data\\\\MSSQL16.MSSQLSERVER\\\\MSSQL\\\\DATA\",\"ChangeTrackingRetentionPeriodUnits\":\"None\",\"ChangeTrackingEnabled\":false,\"DefaultFullTextLanguage\":1033,\"Name\":\"model\",\"ConcatenateNullYieldsNull\":false,\"MirroringSafetyLevel\":\"None\",\"DataRetentionEnabled\":false,\"ServerName\":\"V-MSSQL176.xxx\",\"TargetRecoveryTime\":60,\"HonorBrokerPriority\":false,\"Reasons\":[],\"IsVarDecimalStorageFormatEnabled\":false,\"MaxDopForSecondary\":0,\"ContainmentType\":\"None\",\"QueryOptimizerHotfixes\":\"Off\",\"FilestreamDirectoryName\":\"\",\"NumericRoundAbortEnabled\":false,\"AnsiNullsEnabled\":false,\"TemporalHistoryRetentionEnabled\":null,\"MirroringPartnerInstance\":\"\",\"SnapshotIsolation\":false,\"PersistentVersionStoreFileGroup\":\"PRIMARY\",\"TwoDigitYearCutoff\":2049,\"Ensure\":\"Present\",\"AnsiNullDefault\":false,\"RemoteDataArchiveUseFederatedServiceAccount\":false,\"Collation\":\"Latin1_General_CI_AS\",\"AnsiWarningsEnabled\":false,\"AutoCreateStatisticsEnabled\":true,\"MirroringRedoQueueMaxSize\":0,\"RemoteDataArchiveEndpoint\":\"\",\"TransformNoiseWords\":false,\"MaxSizeInBytes\":0.0,\"RecursiveTriggersEnabled\":false,\"RemoteDataArchiveCredential\":\"\",\"LegacyCardinalityEstimation\":\"Off\",\"BrokerEnabled\":false,\"AutoShrink\":false,\"RemoteDataArchiveEnabled\":false,\"Protocol\":null,\"AutoCreateIncrementalStatisticsEnabled\":false,\"CatalogCollation\":\"DatabaseDefault\",\"RemoteDataArchiveLinkedServer\":\"\",\"QuotedIdentifiersEnabled\":false,\"AcceleratedRecoveryEnabled\":false,\"LocalCursorsDefault\":false,\"Credential\":{\"UserName\":\"xxx\",\"Password\":{\"Length\":0}},\"AutoUpdateStatisticsEnabled\":true,\"IsLedger\":false,\"DateCorrelationOptimization\":false,\"PageVerify\":\"Checksum\",\"MirroringWitness\":\"\",\"IsReadCommittedSnapshotOn\":false,\"LegacyCardinalityEstimationForSecondary\":\"Primary\",\"ParameterSniffing\":\"On\",\"ArithmeticAbortEnabled\":false,\"InstanceName\":\"MSSQLSERVER\",\"ChangeTrackingRetentionPeriod\":0}}]}"},"target":"dsc_lib::dscresources::command_resource","line_number":986}
{"timestamp":"2026-01-09T12:46:27.383110Z","level":"DEBUG","fields":{"message":"Process 'pwsh' id 224 exited with code 0"},"target":"dsc_lib::dscresources::command_resource","line_number":710}
{"timestamp":"2026-01-09T12:46:27.384475Z","level":"ERROR","fields":{"message":"Error: JSON: expected value at line 1 column 1"},"target":"dsc::subcommand","line_number":111}

DSC configuration

{
    "metadata": {
        "description": "SQL Server 2022 Installation on V-MSSQL176.xxx",
        "generated": "2025-11-04T15:42:28Z",
        "author": "Ansible DSC Automation",
        "target": "V-MSSQL176.xxx",
        "instance": "MSSQLSERVER"
    },
    "resources": [
        {
            "type": "SqlServerDsc/SqlDatabase",
            "name": "ConfigureModelDatabase",
            "properties": {
                "ServerName": "V-MSSQL176.xxx",
                "InstanceName": "MSSQLSERVER",
                "Name": "model",
                "RecoveryModel": "Simple",
                "Ensure": "Present",
				"Credential": {
				  "userName": "xxx",
				  "password": "xxx"
				},				
            }
        }
    ],	
    "$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.1/config/document.json"
}

Suggested solution

Readable error output

SQL Server edition and version

2022 Developer Edition

SQL Server PowerShell modules

SqlServerDsc-17.4.0-preview0023

Operating system

Edition	Windows Server 2025 Standard
Version	24H2
Installed on	‎18.‎09.‎2025
OS build	26100.7462
Experience	Windows Feature Experience Pack 1000.26100.275.0

PowerShell version

7.5.2

SqlServerDsc version

17.4.0-preview0023

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThe issue is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions