New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xSQLServerRSConfig: Returns wrong value ($null) from Test-TargetResource #822

Closed
johlju opened this Issue Sep 18, 2017 · 0 comments

Comments

Projects
None yet
1 participant
@johlju
Collaborator

johlju commented Sep 18, 2017

Details of the scenario you tried and the problem that is occurring:
When Reporting Services are not initialized then function Test-TargetResource is returning $null instead of $false.

VERBOSE: [APPVYR-WIN]: LCM:  [ Start  Resource ]  [[xSQLServerRSConfig]Integration_Test]
VERBOSE: [APPVYR-WIN]: LCM:  [ Start  Test     ]  [[xSQLServerRSConfig]Integration_Test]
VERBOSE: [APPVYR-WIN]: LCM:  [ End    Test     ]  [[xSQLServerRSConfig]Integration_Test]  in 0.2390 seconds.
The PowerShell DSC resource C:\projects\xsqlserver\DscResources\MSFT_xSQLServerRSConfig returned results in a format that is not valid. The results from running Test-TargetResource must be the boolean value True or False.
    + CategoryInfo          : InvalidResult: (:) [], CimException
    + FullyQualifiedErrorId : TestTargetResourceInvalidResultFormat
    + PSComputerName        : localhost
 
VERBOSE: [APPVYR-WIN]: LCM:  [ End    Set      ]
The SendConfigurationApply function did not succeed.
    + CategoryInfo          : NotImplemented: (root/Microsoft/...gurationManager:String) [], CimException
    + FullyQualifiedErrorId : MI RESULT 7
    + PSComputerName        : localhost
 
VERBOSE: Operation 'Invoke CimMethod' complete.
VERBOSE: Time taken for configuration job to complete is 74.548 seconds

The code here should handle a $null value.

https://github.com/PowerShell/xSQLServer/blob/b2e553b2a2638fc88df1e815e4867f3733c7eed6/DSCResources/MSFT_xSQLServerRSConfig/MSFT_xSQLServerRSConfig.psm1#L56

The DSC configuration that is using the resource (as detailed as possible):

xSQLServerRSConfig 'Integration_Test'
{
    # Instance name for the Reporting Services.
    InstanceName         = $Node.InstanceName

    <#
        Instance for Reporting Services databases.
        Note: This instance is created in a prior integration test.
    #>
    RSSQLServer          = $Node.RSSQLServer
    RSSQLInstanceName    = $Node.RSSQLInstanceName

    PsDscRunAsCredential = $SqlAdministratorCredential   # <--- DID NOT HAVE WMI RIGHTS

    DependsOn            = @(
        '[xSQLServerSetup]InstallReportingServicesInstance'
    )
}

Version of the Operating System, SQL Server and PowerShell the DSC Target Node is running:
Windows Server 2016, SQL Server 2016, WMF 5.1

What module (SqlServer or SQLPS) and which version of the module the DSC Target Node is running:
SQLPS

Version of the DSC module you're using, or 'dev' if you're using current dev branch:
Dev

johlju added a commit to johlju/SqlServerDsc that referenced this issue Sep 19, 2017

Changes to xSQLServerRSConfig
- No longer returns a null value from Test-TargetResource when Reporting
  Services has not been initialized (issue #822).

@johlju johlju closed this in #825 Sep 20, 2017

johlju added a commit that referenced this issue Sep 20, 2017

xSQLServerRSConfig: No longer returns a null value from Test-TargetRe…
…source (#825)

- Changes to xSQLServerRSConfig
  - No longer returns a null value from Test-TargetResource when Reporting
    Services has not been initialized (issue #822).

@johlju johlju removed the in progress label Sep 20, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment