WARNING: Resulting JSON is truncated as serialization has exceeded the set depth of 3
Closed this issue · 4 comments
Hi, I am new to this tool, I did the following today
Install-Module PSFramework
Install-Module dbatools -Force
Install-Module dbachecks
I ran it against 2 SQL servers but got the following
Tests Passed: 297, Failed: 15, Skipped: 306, Pending: 0, Inconclusive: 0
WARNING: Resulting JSON is truncated as serialization has exceeded the set depth of 3.
[18:31:57][Update-DbcPowerBiDataSource] Wrote results to C:\WINDOWS\temp\dbachecks\dbachecks_1_Default__CIS.json
General Troubleshooting steps
- [ X] Verified running the latest release of dbachecks?
Does (Find-Module dbachecks).Version match (Get-Module dbachecks).Version.ToString()
Yes , I get 2.0.16
- [X ] Verified errors are not related to permissions?
- [ yes] Can duplicate in new/clean PowerShell session (clean =
powershell -NoProfile
)?
Version Information
- Operating System (Name|Version): win 10 20H2
- PowerShell Version: PS 7.2
- SQL Server (Edition|Version): SQL2K16 Developer
Steps to Reproduce
1 - Invoke-DbcCheck -SqlInstance $SQLInstance –ComputerName $SQLInstance -Tag CIS -Show Summary -PassThru | Update-DbcPowerBiDataSource
Thanks for your help
HI, what should I do please? should I update the file manually, if yes, where I find the file?
Thank you @eliassal - I am just pushing the fix up to the gallery now
For CIS I would always recommend that you store the results in a database ;-)
$Sqlinstance = 'localhost'
Invoke-DbcCheck -SqlInstance $SQLInstance -ComputerName $SQLInstance -Tag InstanceConnection -Show Summary -PassThru | Convert-DbcResult -Label Beard-Connectivity | Write-DbcTable -SqlInstance localhost -Database tempdb
Invoke-DbcCheck -SqlInstance $SQLInstance -ComputerName $SQLInstance -Tag CIS -Show Summary -PassThru | Convert-DbcResult -Label Beard-CIS | Write-DbcTable -SqlInstance localhost -Database tempdb
Invoke-DbaQuery -SqlInstance $Sqlinstance -Database tempdb -Query "Select TOP 10 * FROM CheckResults"
Start-DbcPowerBi -FromDatabase
OK Thanks for the recommandation, so I need to update dbchecks using powershell, is this correct?
For "I would always recommend that you store the results in a database", I set 3 SQL servers and 3 computer name as follows
Set-DbcConfig -Name app.sqlinstance -Value sql2k12, sql2k17, SQL2K12\SC2K12
Set-DbcConfig -Name app.computername -Value sql2k12, sql2k17, SQL2K12
so If I want to execute your statements as follows, how I can tel Invoke-DbcCheck to write to tempdb on only 1 host for the 3 instances?
Yes
Update-Module dbachecks
will get the latest version and it is best to use a new PowerShell process once you have updated
Set-DbcConfig -Name app.sqlinstance -Value sql2k12, sql2k17, SQL2K12\SC2K12
Set-DbcConfig -Name app.computername -Value sql2k12, sql2k17, SQL2K12
$checks = 'InstanceConnection','DatabaseExists' # LIst of checks you want
$InstanceToStore = 'HOST/INSTANCE' # the instance that will hold the results
$databaseToStore = 'TheDatabase' # where will results be stored - two tables will be created
$Label = 'Production-CIS' # the label that you wish to give this set of tests
Invoke-DbcCheck -Check $checks | Convert-DbcResult -Label $label | Write-DbcTable -SqlInstance $InstanceToStore -Database $databaseToStore